Create a sandbox
const url = 'https://api.global.stillbox.example/v1/sandboxes';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"access":"shared","team_id":"example","environment":"example","name":"example","internet":{"mode":"open","allowed_hosts":["github.com","registry.npmjs.org","pypi.org"]},"repository":"example","image":"example","from_checkpoint":"example","command":["example"],"env":{"additionalProperty":"example"},"vcpus":2,"memory_mb":4096,"disk_mb":4096,"auto_sleep_seconds":180}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.global.stillbox.example/v1/sandboxes \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "access": "shared", "team_id": "example", "environment": "example", "name": "example", "internet": { "mode": "open", "allowed_hosts": [ "github.com", "registry.npmjs.org", "pypi.org" ] }, "repository": "example", "image": "example", "from_checkpoint": "example", "command": [ "example" ], "env": { "additionalProperty": "example" }, "vcpus": 2, "memory_mb": 4096, "disk_mb": 4096, "auto_sleep_seconds": 180 }'Creates a sandbox and starts it as soon as a server has room. Send an Idempotency-Key header to make
retries safe: repeating a request with the same key returns the sandbox the first request created.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Send image for a new sandbox, or from_checkpoint to resume a checkpoint as a new sandbox.
object
Who sees and works in the sandbox: everyone in the organization (shared, the default), one team and the
owners (team), or only its creator (private; owners and auditors see that it exists, and owners can stop
or delete it).
The team a team sandbox belongs to.
An environment’s ID. The sandbox gets its current version (repositories, variables, secrets, setup, MCP servers, house rules).
Defaults to the image’s name, e.g. claude-code.
Where the sandbox may connect. open is the internet (private networks are always blocked). allowlist is
only the web (ports 80 and 443) on allowed_hosts and their subdomains; DNS keeps working.
object
A public repository to clone into the sandbox’s home folder when it first starts, as an https address
(https://github.com/owner/repo). This is what “Open in Stillbox” links use (ADR 0025): the organization must
allow them, and the repository’s code host must be one of its open_link_hosts.
Container image to run, e.g. docker.io/library/alpine:3.
A ready checkpoint to resume: the new sandbox starts with the checkpoint’s memory, processes and disk, on a
server of the same CPU type. Its image, command, size and environment come from the checkpoint; only
auto_sleep_seconds may be sent with it.
Replaces the image’s command.
Environment variables added to the image’s. Don’t put real credentials here: the platform keeps keys outside sandboxes.
object
Put the sandbox to sleep after this long idle (memory kept); 0 turns auto-sleep off.
Responses
Section titled “Responses”The sandbox (state pending until a server starts it)
object
Who sees and works in the sandbox: everyone in the organization (shared, the default), one team and the
owners (team), or only its creator (private; owners and auditors see that it exists, and owners can stop
or delete it).
The team a team sandbox belongs to.
The environment the sandbox was made from, and the version it got.
object
A name people choose, e.g. “Support bot”.
Empty means the image’s own command.
A new size is recorded and its server hasn’t applied it yet.
The sandbox goes to sleep after this long idle; 0 means never.
How long the sandbox has been idle (no CPU, network, agent turn or terminal), as last reported.
For a duplicate, the sandbox it was copied from.
For a sandbox made from a checkpoint, the checkpoint’s ID.
Take a checkpoint every this many hours while the sandbox runs; 0 means never.
How many periodic checkpoints to keep; older ones are deleted.
What the sandbox is doing now. pending: waiting for a server with room. asleep: its memory and processes
are saved to disk and it uses no memory or CPU; any request wakes it. starting, sleeping, waking,
stopping and deleting: a server is carrying out a change. failed: the server could not start it
(see error).
Why the platform stopped the sandbox, e.g. a suspended organization or suspected crypto mining.
The repository the sandbox was opened from, if any.
The ID of the person who created the sandbox, when one did (not an admin or a schedule).
object
The sandbox’s server has put these rules in force; changes take a few seconds.
Present when the sandbox’s team limits it to these hosts (ADR 0040).
Present when the sandbox is limited at all - what it may actually reach.
Example
{ "access": "shared", "state": "pending", "desired_state": "running", "internet": { "mode": "open" }}The request is invalid
object
Example
{ "code": "not_found"}The API key is missing or invalid
object
Example
{ "code": "not_found"}Only an owner can do this (owner_only), or the invitation is for another address (not_invited)
object
Example
{ "code": "not_found"}