create_sandbox
Creates a Docker sandbox with its own daemon and deploys a compose stack inside it, giving each app a URL. Use it to spin up an isolated environment for a coding agent.
Instructions
Create sandbox HTTP POST /sandboxes
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cpus | No | CPU limit (cores). Default SANDBOX_CPUS; users up to SANDBOX_MAX_CPUS, the admin up to the host. | |
| name | Yes | ||
| memory | No | Memory limit (512m, 4g). Default SANDBOX_MEMORY; users up to SANDBOX_MAX_MEMORY, the admin up to the host. | |
| compose | No | Use this compose text instead of the template's compose.yaml (the template's before_script and defaults still apply). GET /templates/:name gives the template's text to start from. At most 256 KB. | |
| runtime | No | How the sandbox runs (GET /runtimes). Omit for DEFAULT_RUNTIME (auto: sysbox where installed, else dind). | |
| ssh_keys | No | Extra SSH public keys for this sandbox only (your keys from /ssh-keys always get in) | |
| template | No | What runs inside (GET /templates). Omit for DEFAULT_TEMPLATE (starter). | |
| idle_timeout | No | Stop the sandbox after this long without HTTP traffic; the next request wakes it. 0 or off = never. Omit for template idle_timeout (default 30m). | |
| deep_sleep_after | No | Take the sandbox down (containers + network freed, data kept) after it has been stopped this long; the next request rebuilds it. "off" disables. Omit for template deep_sleep_after (default 7d). | |
| create_inner_stack | No | Whether to deploy the inner docker-compose stack defined in the template |