REST API · SSE streaming · persistent volumes

Isolated code execution, on demand.

Mudbase Cells spins up an isolated runtime environment for your code in seconds. Send a command, stream the output, read and write files, start services, and expose ports to the internet. Sessions time out automatically or persist as named cells with durable storage.

Start here

Quick example

curlshell
# 1. Create a Node.js session
curl -X POST https://api.mudbase.dev/api/sandboxes/projects/{projectId} \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"language":"node","languageVersion":"22","timeoutSeconds":300}'

# Response: { "sessionId": "...", "wsUrl": "...", "token": "...", "timeoutAt": "..." }

# 2. Run a command (SSE stream)
curl -N -X POST https://api.mudbase.dev/api/sandboxes/projects/{projectId}/sessions/{sessionId}/exec \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"cmd":["node","-e","console.log(42)"]}'
# 1. Create a Node.js session
curl -X POST https://api.mudbase.dev/api/sandboxes/projects/{projectId} \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"language":"node","languageVersion":"22","timeoutSeconds":300}'

# Response: { "sessionId": "...", "wsUrl": "...", "token": "...", "timeoutAt": "..." }

# 2. Run a command (SSE stream)
curl -N -X POST https://api.mudbase.dev/api/sandboxes/projects/{projectId}/sessions/{sessionId}/exec \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"cmd":["node","-e","console.log(42)"]}'

Supported runtimes

One API, eight languages. Pick the runtime you need when you create a session.

Core concepts

Client library examples

Generate from spec

No published SDK package exists yet. Generate a typed client from the OpenAPI spec, or use the REST API directly. The examples below show the API shape of a generated client.

Generated client shape
import { CellsClient } from "mudbase-cells-sdk";

const cells = new CellsClient({
  apiKey: process.env.CELLS_API_KEY,
  projectId: process.env.CELLS_PROJECT_ID,
});

const session = await cells.sessions.create({
  language: "node",
  languageVersion: "22",
  timeoutSeconds: 300,
});

const result = await cells.exec(session.sessionId, {
  cmd: ["node", "-e", "console.log(42)"],
});

console.log(result.stdout); // "42"
await cells.sessions.close(session.sessionId);
import { CellsClient } from "mudbase-cells-sdk";

const cells = new CellsClient({
  apiKey: process.env.CELLS_API_KEY,
  projectId: process.env.CELLS_PROJECT_ID,
});

const session = await cells.sessions.create({
  language: "node",
  languageVersion: "22",
  timeoutSeconds: 300,
});

const result = await cells.exec(session.sessionId, {
  cmd: ["node", "-e", "console.log(42)"],
});

console.log(result.stdout); // "42"
await cells.sessions.close(session.sessionId);

Common issues

API Reference

Complete reference for all Cells endpoints: authentication, rate limits, request and response schemas.

View API Reference