Sandboxes
Create Sandbox
string
required
Base image template. See Available Templates below.
integer
Number of vCPUs (1-8, default: 2).
integer
Memory in MB (128-8192, default: 512).
integer
Disk in GB (1-50, default: 5).
string
Network access:
full, none, or allowlist.string[]
Allowed hosts when network_mode is
allowlist.object
Environment variables as key-value pairs.
string
Git repository URL to clone (HTTPS).
string
PAT or OAuth token for private repositories. GitHub:
ghp_..., GitLab: personal access token.string
Branch to checkout (default: main/master).
string
Specific commit SHA to checkout (overrides repo_branch).
string
Monorepo subdirectory to extract into /workspace.
number
Maximum spend in USD.
string
Shell command to run after creation.
integer
Idle timeout in seconds before auto-sleep.
string[]
Packages to pre-install (npm/pip packages).
string[]
AI agents to install:
claude, aider, codex.201 Created
List Sandboxes
200 OK
Get Sandbox
Execute a Command
Run a shell command inside a sandbox and get the output back. Supports pipes, redirects, and environment variables. This is how you interact with sandboxes programmatically — including prompting installed AI agents.POST /v1/sandboxes/{id}/exec
string
required
Shell command to execute. Runs via
/bin/sh -c inside the sandbox with the sandbox’s environment (including any env vars set at creation).200 OK
"agents": ["claude"], you can prompt Claude Code non-interactively:
A failed command still returns HTTP
200 — the API call succeeded; the command result is data. Exec requests can run for up to 5 minutes, so long agent prompts are fine.wss://api.caged.dev/v1/sandboxes/{id}/terminal.
Pause Sandbox
Freezes the sandbox in memory. No compute charges while paused. An auto-snapshot is created.Resume Sandbox
Unfreezes a paused sandbox.Destroy Sandbox
Permanently destroys a sandbox and all its data.204 No Content