Sandbox states
Creating and Snapshotting above are transient phases, not values the API
returns. Only three states are ever reported in the state field:
Create a sandbox
- Python
- TypeScript
Create with full options
- Python
- TypeScript
SandboxInfo model
TheSandboxInfo object is returned by create(), get(), and list().
Inspect a sandbox
- Python
- TypeScript
List sandboxes
- Python
- TypeScript
Connect to an existing sandbox
Useconnect() to reconnect to a running or paused sandbox from a different process or after a restart.
- Python
- TypeScript
Extend timeout
- Python
- TypeScript
Pause and resume
Pausing a sandbox preserves the full memory state and filesystem. No CPU is consumed while paused. The sandbox can be resumed instantly.- Python
- TypeScript
SandboxMetrics model
- Python
- TypeScript
Resource configuration
Resources (vCPUs, memory, disk) are fixed at the template level — they cannot be overridden per sandbox. Sending aresources field in Sandbox.create() is rejected with HTTP 400 "resources field is not supported; set resources at template level".
To run with different resource sizing, build or select a template with the desired allocation. See Templates.
Each sandbox receives its own copy-on-write rootfs derived from the template. Template-derived resources are also validated against your account tier on every create — requests exceeding
MaxVCPUs, MaxMemoryMB, or MaxStorageGiB return HTTP 403.Kill a sandbox
- Python
- TypeScript
Auto-injected environment variables
Every sandbox receives these environment variables automatically:Lifecycle configuration
on_timeout="pause", the sandbox is paused rather than destroyed when it
times out: a pause snapshot is taken and the sandbox stops consuming CPU and
memory, exactly as if you had called sbx.pause(). Wake it up with
sbx.resume(), which also re-arms the timeout. A pause that fails is retried
a few times; if it still fails, the sandbox is killed instead. A paused sandbox
is kept until you resume or kill it; its timeout does not run while it is
paused.
auto_resume is accepted but not yet enforced: a paused sandbox is resumed only
by an explicit resume() call.
Maximum runtime per session is 1 hour on the Free tier, 72 hours on Pro and 7 days on Enterprise. Pausing stops the clock; resuming re-arms the sandbox’s timeout.