Static Methods
Sandbox.create(opts?)
Create a new sandbox. HTTP API →
Template name
Idle timeout in seconds
API key (falls back to
OPENCOMPUTER_API_KEY env var)API URL (falls back to
OPENCOMPUTER_API_URL env var)Environment variables
Arbitrary metadata
CPU cores (max 4)
Memory in MB (max 2048)
Name of a pre-built snapshot
Build log callback (when using
image)Promise<Sandbox>
Sandbox.connect(sandboxId, opts?)
Connect to an existing sandbox. HTTP API →
Sandbox ID
API key
API URL
Promise<Sandbox>
Sandbox.createFromCheckpoint(checkpointId, opts?)
Create a new sandbox from a checkpoint. HTTP API →
Checkpoint ID
Idle timeout
Promise<Sandbox>
Sandbox.createCheckpointPatch(checkpointId, opts)
Create a patch for a checkpoint. HTTP API →
Target checkpoint
Bash script
Description
Promise<PatchResult>
Sandbox.listCheckpointPatches(checkpointId, opts?)
HTTP API →
Returns: Promise<PatchInfo[]>
Sandbox.deleteCheckpointPatch(checkpointId, patchId, opts?)
HTTP API →
Returns: Promise<void>
Instance Methods
sandbox.kill()
Terminate the sandbox. HTTP API →
Returns: Promise<void>
sandbox.isRunning()
Check if the sandbox is running.
Returns: Promise<boolean>
sandbox.hibernate()
Snapshot VM state and stop. No compute cost while hibernated. HTTP API →
Returns: Promise<void>
sandbox.wake(opts?)
Resume a hibernated sandbox. HTTP API →
Idle timeout after wake
Promise<void>
sandbox.setTimeout(timeout)
Update the idle timeout. HTTP API →
New timeout in seconds
Promise<void>
sandbox.createCheckpoint(name)
Create a named checkpoint. HTTP API →
Checkpoint name (unique per sandbox)
Promise<CheckpointInfo>
sandbox.listCheckpoints()
HTTP API → — Returns: Promise<CheckpointInfo[]>
sandbox.restoreCheckpoint(checkpointId)
Revert in-place to a checkpoint. HTTP API →
Returns: Promise<void>
sandbox.deleteCheckpoint(checkpointId)
HTTP API → — Returns: Promise<void>
sandbox.createPreviewURL(opts)
HTTP API →
Container port (1–65535)
Custom domain
Auth configuration
Promise<PreviewURLResult>
sandbox.listPreviewURLs()
HTTP API → — Returns: Promise<PreviewURLResult[]>
sandbox.deletePreviewURL(port)
HTTP API → — Returns: Promise<void>
Properties
Sandbox ID (readonly)
Current status (readonly)
Deprecated — alias for
execTypes
SandboxOpts
SandboxOpts
CheckpointInfo
CheckpointInfo
PatchInfo / PatchResult
PatchInfo / PatchResult
PreviewURLResult
PreviewURLResult