Skip to main content
POST
/
api
/
sandboxes
Create Sandbox
curl --request POST \
  --url https://app.opencomputer.dev/api/sandboxes \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "templateID": "<string>",
  "timeout": 123,
  "cpuCount": 123,
  "memoryMB": 123,
  "envs": {},
  "metadata": {},
  "image": {},
  "snapshot": "<string>"
}
'
{
  "sandboxID": "sb-abc123",
  "status": "running",
  "region": "use2",
  "workerID": "w-use2-abc123"
}

Documentation Index

Fetch the complete documentation index at: https://docs.opencomputer.dev/llms.txt

Use this file to discover all available pages before exploring further.

Create a new sandbox.
templateID
string
Template name (default: "base")
timeout
integer
Idle timeout in seconds (default: 300)
cpuCount
integer
CPU cores. Must match an allowed tier: 1, 2, or 4. If omitted but memoryMB is set, inferred automatically.
memoryMB
integer
Memory in MB. Must match an allowed tier: 1024, 4096, 8192, or 16384. If omitted but cpuCount is set, inferred automatically.
The allowed CPU/memory combinations are:
MemoryvCPU
1024 MB (1 GB)1
4096 MB (4 GB)1
8192 MB (8 GB)2
16384 MB (16 GB)4
The 1 GB tier provides 1 vCPU on a best-effort basis. For guaranteed CPU allocation, use the 4 GB tier or above. If both cpuCount and memoryMB are provided, they must match one of these tiers.
envs
object
Environment variables as key-value pairs
metadata
object
Arbitrary key-value pairs
image
object
Declarative image manifest (see Image builder)
snapshot
string
Name of a pre-built snapshot for instant boot
{
  "sandboxID": "sb-abc123",
  "status": "running",
  "region": "use2",
  "workerID": "w-use2-abc123"
}