TheDocumentation Index
Fetch the complete documentation index at: https://docs.superserve.ai/llms.txt
Use this file to discover all available pages before exploring further.
Sandbox class is the main entry point for the SDK. Python ships both a sync Sandbox and an AsyncSandbox with identical method names.
Import
Authentication
The SDK readsSUPERSERVE_API_KEY from the environment by default. Pass apiKey / api_key explicitly to override, and baseUrl / base_url to target a different control-plane URL.
Factory methods
Sandbox.create
Create and boot a new sandbox. Synchronous - when the promise resolves, the VM is active.
| Option | Type | Description |
|---|---|---|
name | string | Required. Human-readable sandbox name. |
fromTemplate / from_template | string | Template | Template name, UUID, or Template instance to boot from. Defaults to superserve/base. |
fromSnapshot / from_snapshot | string | Snapshot UUID to boot from. |
timeoutSeconds / timeout_seconds | number | Max active lifetime before auto-pause. API-side upper bound (subject to change). |
metadata | Record<string, string> | String tags. |
envVars / env_vars | Record<string, string> | Env vars injected into every process. |
network | NetworkConfig | Egress allow/deny rules. |
apiKey / api_key | string | Overrides SUPERSERVE_API_KEY. |
baseUrl / base_url | string | Overrides SUPERSERVE_BASE_URL. |
signal | AbortSignal | TypeScript only - abort the creation request. |
Sandbox.connect
Reconnect to an existing sandbox by ID. Fetches info and a fresh access token.
Sandbox.list
List sandboxes on the authenticated team. metadata filters combine with AND.
SandboxInfo.
Sandbox.killById / Sandbox.kill_by_id
Delete a sandbox by ID without instantiating it. Idempotent.
Methods on sandbox
getInfo / get_info
Fetch the current server-side state. Returns a fresh SandboxInfo - the returned sandbox’s own status / metadata properties are snapshots and are not mutated.
pause
Checkpoint the VM state to disk. The sandbox transitions to paused. Returns nothing.
resume
Restore a paused sandbox. The backend rotates the per-sandbox access token; the SDK re-injects it into sandbox.files transparently.
kill
Delete the sandbox. Idempotent - swallows 404.
update
Patch metadata and/or network on a live sandbox.
Properties on sandbox
id, name, status, and metadata are read-only snapshots taken at construction. Call getInfo() / get_info() for fresh data.
Types
SandboxStatus
active- running and ready to accept commandspaused- stopped with state saved to diskresuming- transient, briefly visible while a paused sandbox is being restored toactive(retry shortly)failed- the sandbox couldn’t boot or resume; the entry remains until you delete it
404.
SandboxInfo
NetworkConfig
Retries
GET and DELETE requests auto-retry on429, 502, 503, 504, and network errors with exponential backoff + jitter (3 attempts max). POST and PATCH are not retried - the SDK surfaces the error so you can decide.
See Errors.
Errors
Sandbox methods commonly raise:AuthenticationError- missing or invalid API keyValidationError- bad request bodyNotFoundError- sandbox doesn’t exist (exceptkill/killById, which swallow 404)ConflictError- wrong state (e.g., pausing an already-paused sandbox, or patchingnetworkwhile paused)ServerError- platform error