Skip to content

Reference

API reference

Every public endpoint, with a request you can paste and the response it returns.

Conventions

  • Base URL https://api.sandboxplease.com. Send Authorization: Bearer $SANDBOXPLEASE_API_KEY except on catalog routes.
  • Money is in US dollars (price_per_hour, cost); times are ISO 8601 in UTC.
  • Every response carries an x-request-id header; errors repeat it as error.request_id. Quote it when you write to support.
  • Errors are { error: { code, message, hint, docs_url } }: hint says what to do. All codes are on Errors.
  • The whole API as OpenAPI 3.1: https://api.sandboxplease.com/v1/openapi.json. The SDKs generate their types from it; point any OpenAPI client or code generator at it.
  • Retry 429 and 5xx with backoff. Creates are safe to retry with an Idempotency-Key header; the SDKs do both for you.
Streaming exec · NDJSON
{"type":"stdout","data":"42\n"}
{"type":"stderr","data":"warning: …\n"}
{"type":"exit","exit_code":0}

Workspaces

Credits, API keys, provider keys, routing preferences, sandboxes and logs belong to a workspace. Every account has a personal one; team workspaces share them between members with a role: owner, admin, billing or member.

  • An API key belongs to one workspace, so every call above runs and bills there. Nothing else to send: the SDKs and your existing keys work unchanged.
  • Dashboard routes (/v1/account/*, /v1/workspace/*) take the signed-in session and act in the workspace named by X-SandboxPlease-Workspace: <id>, or the personal one without it. GET /v1/workspaces lists them with your role.
  • A call your role cannot make answers 403 with the code forbidden, and the message names what your role is missing.

Create a sandbox

POST/v1/sandboxes

Starts a sandbox on the best provider for the request and falls back to the next one when a create fails; attempts lists every provider it tried, skipped the providers you named that could not run it and why. Send an Idempotency-Key to retry safely: a replay returns the first sandbox with 200 and the header idempotent-replayed: true instead of starting a second one.

sandboxbody
string · "auto" (default), a provider id ("e2b") or provider and size ("e2b/large").
sizebody
"small" | "standard" | "large" | a provider's own size name | { cpu, memory_gb } · Overrides the size in the slug. Defaults to standard. A provider with its own size names takes them too, e.g. "minisandbox/default".
timeoutbody
integer · Lifetime in seconds, up to 86400. Defaults to 3600.
idle_timeoutbody
integer · Kill the sandbox after this many seconds without a call on it (a command counts until it ends). Off by default.
templatebody
string · Provider template or image to boot from. "sandboxplease/base" (the default for "auto") is the same Ubuntu, Python, Node and Bun on every provider; "provider-default" boots each provider's own image.
envbody
object · Environment variables set in the sandbox.
from_snapshotbody
string · Start from a snapshot (POST /v1/sandboxes/:id/snapshot): the sandbox runs on the snapshot's provider, at its size, with its files (and memory on fork providers). It never falls back to another provider. Leave sandbox, size and template out.
countbody
integer · Start this many sandboxes (1 to 20) in parallel and answer { data: [...] }. All or nothing: when one fails, the others are killed. With from_snapshot, N copies of one setup.
devicesbody
{ kind, os_version? }[] · Beta. Cloud mobile devices, driven from inside the sandbox with miniSandbox's device tool. Only miniSandbox sandboxes take them: the request routes to minisandbox, and naming another provider is refused. Each device bills per started minute on credits, even on your own provider key (prices in GET /v1/catalog). Pausing the sandbox releases them; resuming boots new ones of the same kinds. Available: android_phone, android_tablet, ios_simulator, ipad, apple_watch, iphone_duo. Coming soon (refused with feature_not_live): android_physical, android_tv, iphone_physical. At most 3 devices per sandbox and 10 attached at once per workspace (your organization); for more, contact support at support@sandboxplease.com. See the mobile devices guide.
gpubody
{ type?, count?, min_vram_gb? } · GPUs attached to the sandbox, e.g. { "type": "H100", "count": 2 }. type is a model ("T4", "L4", "A100", "H100", "B200"…) or "any" (the default); count is 1 to 8; min_vram_gb keeps models with at least that much memory per GPU. Only providers that offer it are tried, the cheapest first; the others are skipped. Bills on credits at the provider's list price per GPU-hour, on top of the size; offers that come with their own vCPUs and memory (bundled in GET /v1/catalog) replace the size instead. Every offer and its price: GET /v1/catalog (gpus) or the GPUs page.
networkbody
"allow-all" | "deny-all" | { allow: string[] } · What the sandbox may reach. "deny-all" cuts it off; { allow } lets through only these domains (*.example.com for subdomains), IPs and CIDR ranges, up to 100. Private and metadata ranges stay blocked. Only providers that enforce it are tried, the others are skipped with network_policy_unsupported. See the network guide.
provider_optionsbody
{ [provider]: object } · Native create fields per provider, merged into the request of the provider that is picked; the others are ignored. template overrides the generic one. See the provider options guide.
providerbody
object · Routing: order, allow_fallbacks, sort, require, only, ignore, region. require takes yes/no capabilities as an array (["pause", "internet"]) or an object of capabilities to minimums and values ({ "vcpu": 8, "arch": "arm64", "gpu": "any" }), or maximums for prices, minimum billed time and retention ({ "egress_price": 0 }); internet is measured daily ({ "internet": "developer" } asks for package and container registries, GitHub, Ubuntu, nodejs.org and the Playwright CDN), registries asks for PyPI and npm only. gpu, gpu_count and gpu_vram_gb attach the GPU like the gpu field, routed on the GPUs a provider rents through SandboxPlease; persistent_volumes and secret_store route only to your own provider keys. See the routing and capabilities guides.
Idempotency-Keyheader
string · Up to 255 characters. The SDKs send a fresh one per create.
Response · 201
{
  "id": "sbx_7f3a9c21e4b05d68a1c2",
  "sandbox": "e2b/standard",
  "provider": "e2b",
  "provider_sandbox_id": "i9xk3l2q8m1n0p7r6s5t",
  "provider_metadata": {
    "sandboxID": "i9xk3l2q8m1n0p7r6s5t",
    "templateID": "rki5dems9wqfm4r03t7g",
    "domain": "e2b.app",
    "envdVersion": "0.6.4"
  },
  "region": "us",
  "network": null,
  "size": {
    "name": "standard",
    "cpu": 2,
    "memory_gb": 4
  },
  "status": "running",
  "billing": "credits",
  "price_per_hour": 0.1656,
  "cost": 0,
  "compute_cost": 0,
  "fallback": {
    "from": "daytona",
    "reason": "no_capacity",
    "message": "Daytona had no free capacity (503), so it ran on E2B."
  },
  "cold_start_ms": 412,
  "started_at": "2026-11-19T10:00:00.000Z",
  "expires_at": "2026-11-19T11:00:00.000Z",
  "idle_timeout": null,
  "devices": [],
  "gpu": null,
  "device_price_per_minute": 0,
  "device_cost": 0,
  "device_minutes": 0,
  "ended_at": null,
  "end_reason": null,
  "from_snapshot": null,
  "attempts": [
    {
      "provider": "daytona",
      "ok": false,
      "error": "daytona: 503 Service Unavailable",
      "reason": "no_capacity",
      "latency_ms": 1210
    },
    {
      "provider": "e2b",
      "ok": true,
      "latency_ms": 412
    }
  ],
  "skipped": []
}

Errors:400 invalid_request400 unknown_sandbox400 unknown_size401 unauthorized401 invalid_key403 account_suspended403 invite_required403 key_disabled403 policy_violation429 rate_limited403 new_account_limit400 no_eligible_provider400 unknown_provider400 provider_option_conflict400 template_not_allowed402 insufficient_credits402 key_limit_reached429 policy_limit_reached503 billing_unavailable409 byok_key_missing429 too_many_sandboxes400 too_many_devices429 device_limit_reached409 feature_not_live404 snapshot_not_found410 snapshot_expired502 provider_error502 provider_unavailable

Quote a sandbox

POST/v1/quoteNo key

Takes the body of Create a sandbox and answers what that create would do, without starting anything: candidates are the providers it would try, in the order auto routes, each with the vCPU and memory it really serves, its price per hour (compute, GPU, devices, total), how it bills and its cold start; skipped lists the others with the same reasons create gives, and unlock says what makes one usable (own_key, enablement, credits_paused, unhealthy, balance, key_policy; null when it cannot run the request at all). Create and quote share one routing function, so the first candidate is the provider create picks and its total is the rate it bills. Without a key it quotes public prices on credits; with a key it adds your own provider keys, routing defaults, key policy and balance, and limits lists the account, workspace and key limits that apply: refuses true when the create would fail (code is its error), false when the limit only shortens the sandbox (lifetime_s per candidate), with lift saying how to lift it.

…body
Create a sandbox body · Every field of Create a sandbox except from_snapshot and count.
durationbody
integer · Seconds to estimate the cost of, rounded the way the candidate bills (estimate.cost).
Response · 200
{
  "view": "account",
  "limits": [
    {
      "limit": "new_account_lifetime",
      "refuses": true,
      "code": "new_account_limit",
      "message": "New accounts keep a sandbox at most 3600 seconds",
      "lift": "Pass timeout: 3600 or less, or wait until 2026-12-02, when the new-account limit lifts (7 days after sign-up)."
    }
  ],
  "candidates": [
    {
      "provider": "instabox",
      "name": "InstaBox",
      "sandbox": "instabox/standard",
      "billing": "credits",
      "region": "us",
      "size": {
        "name": "standard",
        "cpu": 2,
        "memory_gb": 4
      },
      "gpu": {
        "type": "A100",
        "count": 1,
        "vram_gb": 80
      },
      "price_per_hour": {
        "compute": 0.0821,
        "gpu": 1.99,
        "devices": 0,
        "total": 2.0721
      },
      "billed_per": {
        "increment_s": 1,
        "minimum_s": 0,
        "boot": true
      },
      "estimate": {
        "duration_s": 3600,
        "cost": 2.0721
      },
      "unmetered_charges": [],
      "cold_start_p50_ms": 2140,
      "lifetime_s": 7200
    }
  ],
  "skipped": [
    {
      "provider": "koyeb",
      "name": "Koyeb",
      "reason": "does not offer A100",
      "message": "Koyeb rents A100 only through provider_options on your own key",
      "unlock": "own_key"
    },
    {
      "provider": "e2b",
      "name": "E2B",
      "reason": "does not offer A100",
      "message": "E2B does not offer A100",
      "unlock": null
    }
  ]
}

Errors:400 invalid_request400 unknown_sandbox400 unknown_size400 unknown_provider400 provider_option_conflict401 unauthorized401 invalid_key403 account_suspended403 invite_required403 key_disabled403 policy_violation429 rate_limited

Quote many bodies

POST/v1/quote/batchNo key

Runs Quote a sandbox for many bodies at once, as a filter sidebar needs: bodies maps your own keys to one to eight create bodies each, at most 400 bodies in all. Each key gets the providers any of its bodies routes to for you (your keys and balance when authenticated), each once at its cheapest total per hour. A body create would refuse routes nowhere.

bodiesbodyrequired
object · Your keys to arrays of Quote a sandbox bodies.
Response · 200
{
  "routes": {
    "a100": [
      {
        "provider": "instabox",
        "total": 2.0721
      }
    ],
    "volumes": []
  }
}

Errors:400 invalid_request401 unauthorized401 invalid_key403 account_suspended403 invite_required403 key_disabled403 policy_violation429 rate_limited

List sandboxes

GET/v1/sandboxes

Your running and paused sandboxes, newest first.

Response · 200
{
  "data": [
    {
      "id": "sbx_7f3a9c21e4b05d68a1c2",
      "sandbox": "e2b/standard",
      "provider": "e2b",
      "provider_sandbox_id": "i9xk3l2q8m1n0p7r6s5t",
      "provider_metadata": {
        "sandboxID": "i9xk3l2q8m1n0p7r6s5t",
        "templateID": "rki5dems9wqfm4r03t7g",
        "domain": "e2b.app",
        "envdVersion": "0.6.4"
      },
      "region": "us",
      "network": null,
      "size": {
        "name": "standard",
        "cpu": 2,
        "memory_gb": 4
      },
      "status": "running",
      "billing": "credits",
      "price_per_hour": 0.1656,
      "cost": 0,
      "compute_cost": 0,
      "fallback": null,
      "cold_start_ms": 412,
      "started_at": "2026-11-19T10:00:00.000Z",
      "expires_at": "2026-11-19T11:00:00.000Z",
      "idle_timeout": null,
      "devices": [],
      "gpu": null,
      "device_price_per_minute": 0,
      "device_cost": 0,
      "device_minutes": 0,
      "ended_at": null,
      "end_reason": null,
      "from_snapshot": null
    }
  ]
}

Errors:401 unauthorized401 invalid_key403 account_suspended403 invite_required403 key_disabled403 policy_violation429 rate_limited

Get a sandbox

GET/v1/sandboxes/:id

One sandbox with its provider, status and cost so far, including ended ones.

idpathrequired
string · The sandbox id.
Response · 200
{
  "id": "sbx_7f3a9c21e4b05d68a1c2",
  "sandbox": "e2b/standard",
  "provider": "e2b",
  "provider_sandbox_id": "i9xk3l2q8m1n0p7r6s5t",
  "provider_metadata": {
    "sandboxID": "i9xk3l2q8m1n0p7r6s5t",
    "templateID": "rki5dems9wqfm4r03t7g",
    "domain": "e2b.app",
    "envdVersion": "0.6.4"
  },
  "region": "us",
  "network": null,
  "size": {
    "name": "standard",
    "cpu": 2,
    "memory_gb": 4
  },
  "status": "running",
  "billing": "credits",
  "price_per_hour": 0.1656,
  "cost": 0,
  "compute_cost": 0,
  "fallback": null,
  "cold_start_ms": 412,
  "started_at": "2026-11-19T10:00:00.000Z",
  "expires_at": "2026-11-19T11:00:00.000Z",
  "idle_timeout": null,
  "devices": [],
  "gpu": null,
  "device_price_per_minute": 0,
  "device_cost": 0,
  "device_minutes": 0,
  "ended_at": null,
  "end_reason": null,
  "from_snapshot": null
}

Errors:401 unauthorized401 invalid_key403 account_suspended403 invite_required403 key_disabled403 policy_violation429 rate_limited404 not_found

Kill a sandbox

DELETE/v1/sandboxes/:id

Stops the sandbox. Billing stops at the second it ends. Killing an ended sandbox is a no-op.

idpathrequired
string · The sandbox id.
Response · 200
{
  "id": "sbx_7f3a9c21e4b05d68a1c2",
  "sandbox": "e2b/standard",
  "provider": "e2b",
  "provider_sandbox_id": "i9xk3l2q8m1n0p7r6s5t",
  "provider_metadata": {
    "sandboxID": "i9xk3l2q8m1n0p7r6s5t",
    "templateID": "rki5dems9wqfm4r03t7g",
    "domain": "e2b.app",
    "envdVersion": "0.6.4"
  },
  "region": "us",
  "network": null,
  "size": {
    "name": "standard",
    "cpu": 2,
    "memory_gb": 4
  },
  "status": "killed",
  "billing": "credits",
  "price_per_hour": 0.1656,
  "cost": 0.0023,
  "compute_cost": 0,
  "fallback": null,
  "cold_start_ms": 412,
  "started_at": "2026-11-19T10:00:00.000Z",
  "expires_at": "2026-11-19T11:00:00.000Z",
  "idle_timeout": null,
  "devices": [],
  "gpu": null,
  "device_price_per_minute": 0,
  "device_cost": 0,
  "device_minutes": 0,
  "ended_at": "2026-11-19T10:00:50.000Z",
  "end_reason": "killed",
  "from_snapshot": null
}

Errors:401 unauthorized401 invalid_key403 account_suspended403 invite_required403 key_disabled403 policy_violation429 rate_limited404 not_found

Kill all running sandboxes

POST/v1/sandboxes/kill-all

Kills every running or paused sandbox the key reaches, in one call: use it when your agent lost track of its sandboxes. An owner's or admin's key reaches the whole workspace, a member's key only that member's sandboxes. A sandbox the provider is slow to stop counts as pending: billing already stopped and SandboxPlease retries every minute.

providerbody
string · Only this provider's sandboxes, e.g. e2b.
keybody
string · Only the sandboxes of this API key id.
older_than_hoursbody
integer · Only the sandboxes running for longer than this many hours (1 to 24).
Response · 200
{
  "killed": 2,
  "pending": 0,
  "killed_ids": [
    "sbx_7f3a9c21e4b05d68a1c2",
    "sbx_7d1e04c2a9b35f60e8d1"
  ],
  "pending_ids": []
}

Errors:401 unauthorized401 invalid_key403 account_suspended403 invite_required403 key_disabled403 policy_violation429 rate_limited400 invalid_request

Pause a sandbox

POST/v1/sandboxes/:id/pause

Freezes the sandbox where the provider can. Create it with provider: { require: ["pause"] }. Mobile devices cannot keep their state: pause releases them and resume boots new ones of the same kinds.

idpathrequired
string · The sandbox id.
Response · 200
{
  "id": "sbx_7f3a9c21e4b05d68a1c2",
  "sandbox": "e2b/standard",
  "provider": "e2b",
  "provider_sandbox_id": "i9xk3l2q8m1n0p7r6s5t",
  "provider_metadata": {
    "sandboxID": "i9xk3l2q8m1n0p7r6s5t",
    "templateID": "rki5dems9wqfm4r03t7g",
    "domain": "e2b.app",
    "envdVersion": "0.6.4"
  },
  "region": "us",
  "network": null,
  "size": {
    "name": "standard",
    "cpu": 2,
    "memory_gb": 4
  },
  "status": "paused",
  "billing": "credits",
  "price_per_hour": 0.1656,
  "cost": 0,
  "compute_cost": 0,
  "fallback": null,
  "cold_start_ms": 412,
  "started_at": "2026-11-19T10:00:00.000Z",
  "expires_at": "2026-11-19T11:00:00.000Z",
  "idle_timeout": null,
  "devices": [],
  "gpu": null,
  "device_price_per_minute": 0,
  "device_cost": 0,
  "device_minutes": 0,
  "ended_at": null,
  "end_reason": null,
  "from_snapshot": null
}

Errors:401 unauthorized401 invalid_key403 account_suspended403 invite_required403 key_disabled403 policy_violation429 rate_limited404 not_found409 sandbox_ended409 byok_key_missing502 provider_error502 provider_unavailable400 unsupported

Resume a sandbox

POST/v1/sandboxes/:id/resume

Brings a paused sandbox back with its memory and files. On credits, the balance must cover its next 10 minutes. A sandbox with mobile devices boots new ones, within the workspace's device limit.

idpathrequired
string · The sandbox id.
Response · 200
{
  "id": "sbx_7f3a9c21e4b05d68a1c2",
  "sandbox": "e2b/standard",
  "provider": "e2b",
  "provider_sandbox_id": "i9xk3l2q8m1n0p7r6s5t",
  "provider_metadata": {
    "sandboxID": "i9xk3l2q8m1n0p7r6s5t",
    "templateID": "rki5dems9wqfm4r03t7g",
    "domain": "e2b.app",
    "envdVersion": "0.6.4"
  },
  "region": "us",
  "network": null,
  "size": {
    "name": "standard",
    "cpu": 2,
    "memory_gb": 4
  },
  "status": "running",
  "billing": "credits",
  "price_per_hour": 0.1656,
  "cost": 0,
  "compute_cost": 0,
  "fallback": null,
  "cold_start_ms": 412,
  "started_at": "2026-11-19T10:00:00.000Z",
  "expires_at": "2026-11-19T11:00:00.000Z",
  "idle_timeout": null,
  "devices": [],
  "gpu": null,
  "device_price_per_minute": 0,
  "device_cost": 0,
  "device_minutes": 0,
  "ended_at": null,
  "end_reason": null,
  "from_snapshot": null
}

Errors:401 unauthorized401 invalid_key403 account_suspended403 invite_required403 key_disabled403 policy_violation429 rate_limited404 not_found409 sandbox_ended409 byok_key_missing502 provider_error502 provider_unavailable402 insufficient_credits429 device_limit_reached400 unsupported

Snapshot a sandbox

POST/v1/sandboxes/:id/snapshot

Captures a running sandbox so new sandboxes can start from it (create with from_snapshot and count). kind "fork" keeps files, memory and running processes; "snapshot" keeps files. The sandbox keeps running. Snapshots last 7 days; on credits, storage bills at the provider's list price when there is one. Create the sandbox with provider: { require: ["snapshot"] } or ["fork"].

idpathrequired
string · The sandbox id.
Response · 201
{
  "id": "snap_4c1d9e7a20b3f85e6d17",
  "sandbox_id": "sbx_7f3a9c21e4b05d68a1c2",
  "provider": "e2b",
  "kind": "fork",
  "region": "us",
  "size": {
    "name": "standard",
    "cpu": 2,
    "memory_gb": 4
  },
  "size_bytes": null,
  "billing": "credits",
  "storage_cost": 0,
  "status": "ready",
  "created_at": "2026-11-19T10:05:00.000Z",
  "expires_at": "2026-11-26T10:05:00.000Z",
  "deleted_at": null
}

Errors:401 unauthorized401 invalid_key403 account_suspended403 invite_required403 key_disabled403 policy_violation429 rate_limited404 not_found409 sandbox_ended409 sandbox_paused409 byok_key_missing502 provider_error502 provider_unavailable400 snapshot_unsupported429 too_many_snapshots

List snapshots

GET/v1/snapshots

Your snapshots that sandboxes can still start from, newest first.

Response · 200
{
  "data": [
    {
      "id": "snap_4c1d9e7a20b3f85e6d17",
      "sandbox_id": "sbx_7f3a9c21e4b05d68a1c2",
      "provider": "e2b",
      "kind": "fork",
      "region": "us",
      "size": {
        "name": "standard",
        "cpu": 2,
        "memory_gb": 4
      },
      "size_bytes": null,
      "billing": "credits",
      "storage_cost": 0,
      "status": "ready",
      "created_at": "2026-11-19T10:05:00.000Z",
      "expires_at": "2026-11-26T10:05:00.000Z",
      "deleted_at": null
    }
  ]
}

Errors:401 unauthorized401 invalid_key403 account_suspended403 invite_required403 key_disabled403 policy_violation429 rate_limited

Get a snapshot

GET/v1/snapshots/:id

One snapshot with its provider, kind, status and expiry, including deleted and expired ones.

idpathrequired
string · The snapshot id.
Response · 200
{
  "id": "snap_4c1d9e7a20b3f85e6d17",
  "sandbox_id": "sbx_7f3a9c21e4b05d68a1c2",
  "provider": "e2b",
  "kind": "fork",
  "region": "us",
  "size": {
    "name": "standard",
    "cpu": 2,
    "memory_gb": 4
  },
  "size_bytes": null,
  "billing": "credits",
  "storage_cost": 0,
  "status": "ready",
  "created_at": "2026-11-19T10:05:00.000Z",
  "expires_at": "2026-11-26T10:05:00.000Z",
  "deleted_at": null
}

Errors:401 unauthorized401 invalid_key403 account_suspended403 invite_required403 key_disabled403 policy_violation429 rate_limited404 snapshot_not_found

Delete a snapshot

DELETE/v1/snapshots/:id

Deletes the snapshot on its provider. Sandboxes started from it keep running.

idpathrequired
string · The snapshot id.
Response · 200
{
  "id": "snap_4c1d9e7a20b3f85e6d17",
  "sandbox_id": "sbx_7f3a9c21e4b05d68a1c2",
  "provider": "e2b",
  "kind": "fork",
  "region": "us",
  "size": {
    "name": "standard",
    "cpu": 2,
    "memory_gb": 4
  },
  "size_bytes": null,
  "billing": "credits",
  "storage_cost": 0,
  "status": "deleted",
  "created_at": "2026-11-19T10:05:00.000Z",
  "expires_at": "2026-11-26T10:05:00.000Z",
  "deleted_at": "2026-11-19T10:30:00.000Z"
}

Errors:401 unauthorized401 invalid_key403 account_suspended403 invite_required403 key_disabled403 policy_violation429 rate_limited404 snapshot_not_found502 provider_error

Run a command

POST/v1/sandboxes/:id/exec

Runs a shell command and returns its output once it exits. With stream: true the response is NDJSON, one {"type":"stdout"|"stderr","data"} per chunk, then {"type":"exit","exit_code"}.

idpathrequired
string · The sandbox id.
cmdbodyrequired
string · The shell command.
cwdbody
string · Working directory.
envbody
object · Extra environment variables.
timeoutbody
integer · Seconds before the command is killed.
streambody
boolean · Stream output as NDJSON. Defaults to false.
exec_optionsbody
{ [provider]: object } · Native command fields for the sandbox's provider, e.g. { vercel: { sudo: true } }.
Response · 200
{
  "exit_code": 0,
  "stdout": "42\n",
  "stderr": ""
}

Errors:400 invalid_request400 unknown_provider400 provider_option_conflict400 unsupported429 policy_limit_reached401 unauthorized401 invalid_key403 account_suspended403 invite_required403 key_disabled403 policy_violation429 rate_limited404 not_found409 sandbox_ended409 sandbox_paused409 byok_key_missing502 provider_error502 provider_unavailable

Read a file or list a directory

GET/v1/sandboxes/:id/files

Returns the raw bytes of the file at path. Add &list to list the directory instead.

idpathrequired
string · The sandbox id.
pathqueryrequired
string · Absolute path in the sandbox.
listquery
flag · List the directory at path.
Response · 200
{
  "data": [
    {
      "name": "app.py",
      "path": "/home/user/app.py",
      "type": "file"
    }
  ]
}

Errors:400 invalid_request401 unauthorized401 invalid_key403 account_suspended403 invite_required403 key_disabled403 policy_violation429 rate_limited404 not_found409 sandbox_ended409 sandbox_paused409 byok_key_missing502 provider_error502 provider_unavailable

Write a file

PUT/v1/sandboxes/:id/files

Writes the raw request body to path, creating parent directories.

idpathrequired
string · The sandbox id.
pathqueryrequired
string · Absolute path in the sandbox.
Response · 200
{
  "path": "/home/user/app.py",
  "bytes": 14
}

Errors:400 invalid_request401 unauthorized401 invalid_key403 account_suspended403 invite_required403 key_disabled403 policy_violation429 rate_limited404 not_found409 sandbox_ended409 sandbox_paused409 byok_key_missing502 provider_error502 provider_unavailable

Get a public port URL

GET/v1/sandboxes/:id/ports/:port

A public URL for a port the sandbox listens on. Create it with provider: { require: ["ports"] }.

idpathrequired
string · The sandbox id.
portpathrequired
integer · 1 to 65535.
Response · 200
{
  "url": "https://3000-ixk2c9.e2b.app"
}

Errors:401 unauthorized401 invalid_key403 account_suspended403 invite_required403 key_disabled403 policy_violation429 rate_limited404 not_found409 sandbox_ended409 sandbox_paused409 byok_key_missing502 provider_error502 provider_unavailable400 unsupported

Get a device's screen

GET/v1/sandboxes/:id/devices/:device/screen

The current screen of one of the sandbox's mobile devices, as an image (PNG). Coordinates for input are pixels of this image. Answers device_booting until the device is ready.

idpathrequired
string · The sandbox id.
devicepathrequired
string · The device id, from the sandbox's devices.
Response · 200
<PNG bytes>

Errors:401 unauthorized401 invalid_key403 account_suspended403 invite_required403 key_disabled403 policy_violation429 rate_limited404 not_found409 sandbox_ended409 sandbox_paused409 byok_key_missing502 provider_error502 provider_unavailable409 device_booting

Tap, swipe, type or press a key on a device

POST/v1/sandboxes/:id/devices/:device/input

One input on one of the sandbox's mobile devices: {"type": "tap", x, y}, {"type": "swipe", x1, y1, x2, y2}, {"type": "text", text} or {"type": "key", key} with key back (Android), home or enter. Coordinates are pixels of the screen image.

idpathrequired
string · The sandbox id.
devicepathrequired
string · The device id, from the sandbox's devices.
typebodyrequired
string · tap, swipe, text or key.
Response · 200
{
  "ok": true
}

Errors:400 invalid_request401 unauthorized401 invalid_key403 account_suspended403 invite_required403 key_disabled403 policy_violation429 rate_limited404 not_found409 sandbox_ended409 sandbox_paused409 byok_key_missing502 provider_error502 provider_unavailable409 device_booting

Get the key's balance and limit

GET/v1/key

The account balance and what is left of this key's credit limit in its current period. Check it before a long job.

Response · 200
{
  "name": "claude-code on laptop",
  "balance_usd": 24.5,
  "credit_limit_usd": 10,
  "limit_remaining_usd": 9.82,
  "usage_usd": 0.18,
  "limit_reset": "month"
}

Errors:401 unauthorized401 invalid_key403 account_suspended403 invite_required403 key_disabled403 policy_violation429 rate_limited

Start a device login

POST/v1/auth/deviceNo key

For an agent or CLI without a key. Agents: send verification_url (it carries user_code) to the person as a chat message and end your turn; tool output is not visible to them. Poll the token endpoint only once they say they approved. The code expires after expires_in seconds, and an approved code can be claimed for that long again. No key needed.

client_namebody
string · Who asks, shown to the person, e.g. "claude-code".
hostnamebody
string · The machine it runs on, shown to the person.
Response · 200
{
  "device_code": "spdc_4f1c9a0e7b2d4c6e8a1b3d5f7091a2c4e6b8d0f1a3c5e7092b4d6f8a0c2e4f6a",
  "user_code": "BCDF-GHJK",
  "verification_url": "https://sandboxplease.com/device?code=BCDF-GHJK",
  "interval": 5,
  "expires_in": 900
}

Errors:400 invalid_request429 rate_limited

Poll a device login

POST/v1/auth/device/tokenNo key

Returns the new API key once, after the person approves the code. Until then it answers authorization_pending; slow_down when polled faster than interval; access_denied or expired_token end the login. No key needed.

device_codebodyrequired
string · From POST /v1/auth/device.
Response · 200
{
  "key": "sp-v1-0123456789abcdef0123456789abcdef0123456789abcdef",
  "id": "6f1d2c3b-4a59-4e8f-9a7b-1c2d3e4f5a6b",
  "name": "claude-code on laptop",
  "credit_limit_usd": 10,
  "limit_reset": "month"
}

Errors:400 invalid_request400 authorization_pending429 slow_down403 access_denied400 expired_token429 rate_limited

List providers

GET/v1/catalogNo key

Every provider with its capabilities (each with its source, how it was verified and when), sizes, list prices, cold start and 30-day uptime, without the failures our own account caused (cold_start_p50_ms is the figure sort latency routes by, as cold_start_basis says: a standard sandbox's benchmarked time to a first command, else the median of the day's probes; cold_start_p95_ms is the 30-day tail), and every mobile device kind with its price per minute. access says how the caller reaches each provider with no filter, as Quote a sandbox routes the default body: credits, own_key (your provider key), byok_only, credits_paused, unavailable (message and unlock say why) or hidden (it cannot run the default request). No key needed: without one, access is what anyone sees.

Response · 200
{
  "devices_live": true,
  "providers": [
    {
      "id": "e2b",
      "name": "E2B",
      "description": "Firecracker microVM sandboxes for AI agents, with pause/resume, snapshots and forks.",
      "website": "https://e2b.dev",
      "features": [
        "pause",
        "ports",
        "fork",
        "snapshot",
        "custom_image"
      ],
      "capabilities": {
        "pause": {
          "value": true,
          "source": "https://docs.e2b.dev/sandbox/persistence",
          "verified": "docs",
          "checked_at": "2026-11-24"
        },
        "internet": {
          "value": "open",
          "source": "https://sandboxplease.com/docs/network",
          "verified": "live",
          "checked_at": "2026-11-24T06:00:00.000Z"
        }
      },
      "isolation": "microvm",
      "regions": [
        "us",
        "eu"
      ],
      "beta": false,
      "new": false,
      "max_lifetime_s": 3600,
      "max_lifetime_on_our_plan": true,
      "verified_at": "2026-11-24T06:00:00.000Z",
      "byok_options": [
        "volumes"
      ],
      "byok_only": false,
      "credits_paused": null,
      "access": {
        "status": "credits",
        "message": null,
        "unlock": null
      },
      "proven_at": "2026-11-24T05:58:36.980Z",
      "gpus": [],
      "list_price": null,
      "billed_per": {
        "increment_s": 1,
        "minimum_s": 0,
        "boot": true
      },
      "unmetered_charges": [],
      "security": null,
      "statement": null,
      "base_image": {
        "via": "template",
        "available": true,
        "bootstrap_s": null,
        "verified_at": "2026-11-24T06:00:00.000Z"
      },
      "network": {
        "internet": "open",
        "checked_at": "2026-11-24T06:00:00.000Z",
        "lockdown": true,
        "allowlist": true,
        "allow_domains": true,
        "allow_cidrs": true
      },
      "cold_start_p50_ms": 412,
      "cold_start_p95_ms": 905,
      "cold_start_basis": "benchmark",
      "cold_start_samples": 4310,
      "cold_start_sources": {
        "probes": 2880,
        "traffic": 1430
      },
      "uptime_30d": 0.998,
      "own_sizes": false,
      "sizes": [
        {
          "name": "standard",
          "cpu": 2,
          "memory_gb": 4,
          "price_per_hour": 0.1656,
          "verified": true,
          "generic": [],
          "byok_only": false
        }
      ],
      "upcoming_sizes": []
    }
  ],
  "devices": [
    {
      "kind": "android_phone",
      "label": "Android phone",
      "os": "Android",
      "availability": "available",
      "price_per_minute": 0.05
    }
  ]
}

Get the base image

GET/v1/catalog/base-imageNo key

sandboxplease/base on every provider: how it gets there, whether it runs there now, and its last verify.sh output. No key needed.

Response · 200
{
  "image": "sandboxplease/base",
  "version": "3f1c9a2be4d0",
  "expected_verify_output": "python=3.12.16\nnode=22.23.5\n...",
  "providers": [
    {
      "id": "e2b",
      "name": "E2B",
      "via": "template",
      "available": true,
      "bootstrap_s": null,
      "verified_at": "2026-11-23T06:00:00.000Z",
      "verify_output": "python=3.12.16\nnode=22.23.5\n..."
    }
  ]
}

List templates

GET/v1/templatesNo key

The templates each provider starts sandboxes from, to pass as template at create: sandboxplease/base (source "sandboxplease"), the provider's public templates ("public") and, with your own provider key, the templates your provider account built ("yours", usable on byok only). size is the size a template sets, null when it runs at the size asked; usable_on says whether it runs on credits, on your own key, or both. providers[].any_image is true when any public container image also runs there; providers[].yours is listed, no_key, unsupported (the provider cannot list them) or unavailable (listing failed). No key needed: without one you see what runs on credits.

providerquery
string · Only this provider, e.g. "e2b".
Response · 200
{
  "data": [
    {
      "name": "sandboxplease/base",
      "provider": "e2b",
      "source": "sandboxplease",
      "size": null,
      "tools": [
        "python 3.12.16",
        "node 22.23.5"
      ],
      "usable_on": [
        "credits",
        "byok"
      ],
      "updated_at": "2026-11-29T06:00:00.000Z"
    },
    {
      "name": "code-interpreter-v1",
      "provider": "e2b",
      "source": "public",
      "size": null,
      "tools": [],
      "usable_on": [
        "credits",
        "byok"
      ],
      "updated_at": null
    },
    {
      "name": "my-app",
      "provider": "e2b",
      "source": "yours",
      "size": {
        "cpu": 2,
        "memory_gb": 4
      },
      "tools": [],
      "usable_on": [
        "byok"
      ],
      "updated_at": "2026-11-28T17:42:10.000Z"
    }
  ],
  "providers": [
    {
      "id": "e2b",
      "any_image": false,
      "yours": "listed"
    }
  ]
}

Errors:400 unknown_provider401 unauthorized401 invalid_key403 account_suspended403 invite_required403 key_disabled403 policy_violation429 rate_limited

List capabilities

GET/v1/catalog/capabilitiesNo key

Every capability the catalog tracks, grouped, with its kind (boolean, number, enum, list), unit, allowed values and the parameter that uses it. Each one is a key of provider.require. No key needed.

Response · 200
{
  "groups": [
    {
      "id": "compute",
      "label": "Compute"
    }
  ],
  "capabilities": [
    {
      "id": "vcpu",
      "group": "compute",
      "label": "Max vCPU",
      "description": "The most vCPUs one sandbox gets through SandboxPlease.",
      "kind": "number",
      "unit": "vcpu",
      "use": "size"
    }
  ]
}

Get the routed uptime

GET/v1/catalog/routed-uptimeNo key

The share of customer create requests SandboxPlease served over the last 30 days, after fallback. null under 100 requests. No key needed.

Response · 200
{
  "uptime_30d": 0.9991,
  "creates_30d": 18342
}

Get a provider's uptime

GET/v1/catalog/:provider/uptimeNo key

Daily probe results for the last 30 days. our_account_failures counts the probes our own account made fail (its plan, funds, rate limit or key, or our adapter): uptime leaves them out, as they say nothing of the provider's availability. No key needed.

providerpathrequired
string · A provider id, e.g. "e2b".
Response · 200
{
  "days": [
    {
      "day": "2026-11-19",
      "probes": 144,
      "ok": 142,
      "our_account_failures": 2
    }
  ]
}

Errors:400 unknown_provider

Get provider status

GET/v1/statusNo key

Each provider's current status and open incidents, read from its public status page every 2 minutes, whether routing currently sends it sandboxes (paused after repeated create failures, retrying once the backoff ends), and 90 days of daily probe results. Failures our own account caused (our_account_failures) count neither in uptime_90d nor in the routing state shown here; on credits, three refusals of our whole account in a row pause the provider for credits traffic only. No key needed.

Response · 200
{
  "api": {
    "status": "operational",
    "checked_at": "2026-11-20T09:30:00.000Z"
  },
  "synthetic": {
    "status": "operational",
    "interval_s": 300,
    "last_run": {
      "at": "2026-11-20T09:28:00.000Z",
      "ok": true,
      "failed_step": null
    },
    "uptime_90d": 0.9917,
    "days": [
      {
        "day": "2026-11-20",
        "probes": 288,
        "ok": 288,
        "status": "operational"
      }
    ]
  },
  "providers": [
    {
      "id": "e2b",
      "name": "E2B",
      "status": "degraded",
      "status_page": "https://status.e2b.dev",
      "routing": "active",
      "routing_retry_at": null,
      "checked_at": "2026-11-20T09:29:12.000Z",
      "incidents": [
        {
          "name": "Elevated sandbox create latency",
          "impact": "degraded",
          "started_at": "2026-11-20T08:55:00.000Z",
          "url": "https://status.e2b.dev/incidents/01JD"
        }
      ],
      "uptime_90d": 0.9991,
      "days": [
        {
          "day": "2026-11-20",
          "probes": 54,
          "ok": 54,
          "our_account_failures": 0,
          "status": "degraded"
        }
      ]
    }
  ]
}

Get rankings

GET/v1/rankingsNo key

Sandboxes started per provider per week across SandboxPlease. Nothing is published (published false, no weeks) until the window holds at least 50 sandboxes from 5 customer accounts; our own and test accounts never count. A provider used by fewer than 3 teams that week is listed in few_teams instead, with no count, so no team can be told apart. No key needed.

weeksquery
integer · 1 to 52. Defaults to 12.
Response · 200
{
  "published": true,
  "weeks": [
    {
      "week_start": "2026-11-16T00:00:00.000Z",
      "sandboxes": {
        "e2b": 1204,
        "modal": 830
      },
      "few_teams": [
        "koyeb"
      ]
    }
  ]
}

Errors:400 invalid_request

Get usage rankings

GET/v1/rankings/usageNo key

Sandboxes started and sandbox hours per provider over a window, by day (7 days) or week (30 and 90 days). Nothing is published until the window holds threshold.sandboxes sandboxes from threshold.accounts customer accounts; our own and test accounts never count. A provider's day or week behind fewer than 3 teams is left out, and providers totals add up published cells only. No key needed.

daysquery
integer · 7, 30 or 90. Defaults to 30.
Response · 200
{
  "window_days": 30,
  "bucket": "week",
  "threshold": {
    "sandboxes": 50,
    "accounts": 5
  },
  "published": true,
  "buckets": [
    {
      "start": "2026-11-16T00:00:00.000Z",
      "sandboxes": {
        "e2b": 1204
      },
      "hours": {
        "e2b": 310.5
      }
    }
  ],
  "providers": [
    {
      "provider": "e2b",
      "sandboxes": 1204,
      "hours": 310.5
    }
  ]
}

Errors:400 invalid_request

Get benchmarks

GET/v1/benchmarksNo key

Measured performance of every provider per size over the last 30 days (or days), from one vantage point: median and p95 of each metric, with its sample count and the dates of the first and last run. Latency metrics also split their median into network_p50, an empty request to the provider's API host, and provider_p50, the rest. regions lists where the measured sandboxes ran, when the provider reports it. A median from fewer than min_samples runs is preliminary. Providers never measured have measured false. No key needed.

vantagequery
string · Where the benchmark ran from: eu (Belgium, the default) or us (Virginia).
daysquery
integer · The window: 7, 30 or 90. Defaults to 30.
Response · 200
{
  "window_days": 30,
  "vantage": "eu",
  "runner_region": "eu",
  "vantages": [
    {
      "id": "eu",
      "label": "From Europe",
      "location": "Belgium (Google Cloud europe-west1)",
      "runs": 84
    },
    {
      "id": "us",
      "label": "From the US",
      "location": "Virginia (Google Cloud us-east4)",
      "runs": 80
    }
  ],
  "min_samples": 5,
  "sizes": [
    {
      "name": "standard",
      "cpu": 2,
      "memory_gb": 4
    }
  ],
  "metrics": [
    {
      "id": "cold_start_ms",
      "label": "Cold start",
      "unit": "ms",
      "better": "lower"
    }
  ],
  "workload": {
    "exec": "true",
    "execCalls": 20
  },
  "providers": [
    {
      "id": "e2b",
      "name": "E2B",
      "measured": true,
      "regions": [
        "us",
        "eu"
      ],
      "last_run_at": "2026-11-23T04:17:09.000Z"
    }
  ],
  "results": [
    {
      "provider": "e2b",
      "size": "standard",
      "metric": "cold_start_ms",
      "samples": 12,
      "p50": 412,
      "p95": 655,
      "network_p50": 104,
      "provider_p50": 308,
      "regions": [],
      "first_at": "2026-11-12T04:16:58.000Z",
      "last_at": "2026-11-23T04:17:09.000Z"
    }
  ]
}

Download benchmark runs

GET/v1/benchmarks/runs.csvNo key

Every benchmark run of the last 90 days as CSV, one row per provider, size and run. No key needed.

Response · 200
id,provider,size,runner_region,trigger,status,skip_reason,cold_start_ms,...,exec_network_ms,network_host,sandbox_region,...
41,e2b,standard,eu,schedule,ok,,412,...,98.4,49983-{sandbox}.e2b.app:443,,...

Get the OpenAPI spec

GET/v1/openapi.jsonNo key

This API as an OpenAPI 3.1 document: every public route, its parameters, request body, responses and errors. The SDKs generate their types from it; point any OpenAPI client generator at it. No key needed.

Response · 200
{
  "openapi": "3.1.1",
  "info": {
    "title": "SandboxPlease API",
    "version": "v1"
  },
  "paths": {}
}