Getting Started

Sandbox gives you isolated Linux environments via a simple REST API. Create a sandbox, run commands, read/write files, and tear it down when you're done. No SDK required — just HTTP.

1

Get your API key

All API requests require a Bearer token. Generate one here or from your dashboard.

2

Create a sandbox

Spin up an isolated Linux environment with sensible defaults. Just POST to the endpoint.

curlcurl -X POST https://sandbox.developersdigest.tech/api/v1/sandboxes \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
node.jsconst res = await fetch('https://sandbox.developersdigest.tech/api/v1/sandboxes', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
});
const sandbox = await res.json();
// { id: "sb_abc123", status: "running", ... }
pythonimport requests

res = requests.post(
    "https://sandbox.developersdigest.tech/api/v1/sandboxes",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
)
sandbox = res.json()
print(sandbox["id"])  # sb_abc123
3

Execute a command

Run any shell command inside the sandbox. You get stdout, stderr, exit code, and execution time.

curlcurl -X POST https://sandbox.developersdigest.tech/api/v1/sandboxes/SANDBOX_ID/exec \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"command": "echo Hello && python3 -c \"print(2+2)\"" }'
node.jsconst exec = await fetch(
  `https://sandbox.developersdigest.tech/api/v1/sandboxes/${sandbox.id}/exec`,
  {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ command: 'pip install pandas && python3 -c "import pandas; print(pandas.__version__)"' }),
  }
);
const result = await exec.json();
// { stdout: "2.2.0\n", stderr: "", exitCode: 0, durationMs: 4521 }
4

Read & write files

Full filesystem access. Write code, read results, list directories.

curl — write a filecurl -X PUT "https://sandbox.developersdigest.tech/api/v1/sandboxes/SANDBOX_ID/files?path=/app/hello.py" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"content": "print(\"Hello from sandbox!\")"}'
node.js — write + run// Write a file
await fetch(`https://sandbox.developersdigest.tech/api/v1/sandboxes/${id}/files?path=/app/hello.py`, {
  method: 'PUT',
  headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' },
  body: JSON.stringify({ content: 'print("Hello from sandbox!")' }),
});

// Run it
const exec = await fetch(`https://sandbox.developersdigest.tech/api/v1/sandboxes/${id}/exec`, {
  method: 'POST',
  headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' },
  body: JSON.stringify({ command: 'python3 /app/hello.py' }),
});
console.log((await exec.json()).stdout); // Hello from sandbox!
curl — read a filecurl "https://sandbox.developersdigest.tech/api/v1/sandboxes/SANDBOX_ID/files?path=/app/hello.py" \
  -H "Authorization: Bearer YOUR_API_KEY"
# { "path": "/app/hello.py", "content": "print(\"Hello from sandbox!\")" }
curl — list directorycurl "https://sandbox.developersdigest.tech/api/v1/sandboxes/SANDBOX_ID/files?path=/app&list=true" \
  -H "Authorization: Bearer YOUR_API_KEY"
# { "path": "/app", "files": [...] }
5

Kill the sandbox

Clean up when you're done. Compute stops billing the second you kill it.

curlcurl -X DELETE https://sandbox.developersdigest.tech/api/v1/sandboxes/SANDBOX_ID \
  -H "Authorization: Bearer YOUR_API_KEY"
# { "id": "sb_abc123", "status": "stopped" }
node.jsawait fetch(`https://sandbox.developersdigest.tech/api/v1/sandboxes/${sandbox.id}`, {
  method: 'DELETE',
  headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
});
6

Use a language template

Pass an image parameter to use a specific runtime. Available templates:

Python 3.12python:3.12-slim
Node.js 22node:22-alpine
Go 1.23golang:1.23-alpine
Rustrust:1-slim
Ubuntu 24.04ubuntu:24.04
Alpinealpine:latest
curlcurl -X POST https://sandbox.developersdigest.tech/api/v1/sandboxes \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"image": "node:22-alpine"}'
node.jsconst res = await fetch('https://sandbox.developersdigest.tech/api/v1/sandboxes', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ image: 'python:3.12-slim' }),
});

API Reference

Base URL: https://sandbox.developersdigest.tech/api/v1. All endpoints require Authorization: Bearer YOUR_API_KEY.

Sandboxes

POST/sandboxes

Create a new sandbox.

Request body

{
  "vcpus": 1,          // 1-4 (pro: up to 4)
  "memoryMb": 512,     // 512-4096
  "storageMb": 1024,   // disk size
  "timeoutMs": 1800000,// auto-kill after 30min
  "templateId": "default",
  "envVars": { "KEY": "value" }
}

Response

{
  "id": "sb_abc123",
  "status": "running",
  "vcpus": 1,
  "memoryMb": 512,
  "region": "us-east-1",
  "expiresAt": "2026-03-13T12:30:00.000Z",
  "createdAt": "2026-03-13T12:00:00.000Z"
}
GET/sandboxes

List all your sandboxes.

Response

[{ "id": "sb_abc123", "status": "running", ... }]
GET/sandboxes/:id

Get sandbox details.

Response

{ "id": "sb_abc123", "status": "running", "vcpus": 1, ... }
DELETE/sandboxes/:id

Kill a sandbox and stop billing.

Response

{ "id": "sb_abc123", "status": "stopped" }

Execution

POST/sandboxes/:id/exec

Execute a command and wait for output.

Request body

{
  "command": "echo hello",
  "timeoutMs": 30000
}

Response

{
  "stdout": "hello\n",
  "stderr": "",
  "exitCode": 0,
  "durationMs": 12
}
POST/sandboxes/:id/processes

Start a background process (long-running servers, etc).

Request body

{
  "command": "python3 -m http.server 8080",
  "cwd": "/app",
  "env": { "PORT": "8080" }
}

Response

{ "pid": 42, "command": "python3 -m http.server 8080" }
GET/sandboxes/:id/processes

List running processes.

DELETE/sandboxes/:id/processes

Kill all running processes.

Files

GET/sandboxes/:id/files?path=/app

Read a file's contents.

Response

{ "path": "/app/index.js", "content": "..." }
GET/sandboxes/:id/files?path=/app&list=true

List files in a directory.

Response

{ "path": "/app", "files": ["index.js", "package.json"] }
PUT/sandboxes/:id/files?path=/app/index.js

Write a file.

Request body

{ "content": "console.log('hello')" }

Response

{ "path": "/app/index.js", "written": true }
DELETE/sandboxes/:id/files?path=/app/tmp&recursive=true

Delete a file or directory.

Response

{ "path": "/app/tmp", "deleted": true }

Lifecycle

POST/sandboxes/:id/pause

Pause a running sandbox. No billing while paused.

Response

{ "id": "sb_abc123", "status": "paused" }
POST/sandboxes/:id/resume

Resume a paused sandbox.

Response

{ "id": "sb_abc123", "status": "running" }
POST/sandboxes/:id/ports

Expose a port with a public URL.

Request body

{ "port": 8080 }

Response

{ "port": 8080, "url": "https://sb-abc123-8080.sandbox.dev" }
GET/sandboxes/:id/ports

List exposed ports.

Pricing

Free

1 hour/mo

3,600 compute seconds. No credit card.

Pro — $20/mo

30 hours/mo

108,000 compute seconds. Per-second billing.

Billing is per-second, rounded up. You only pay for the time your sandbox is running. Paused sandboxes don't count.