create_sandbox
Create an isolated cloud sandbox. Returns {id, status, url?}. For app servers pass start (long-lived command) and ports — the app MUST listen on the injected $PORT env var, and the returned url is a public preview. Destroy sandboxes when done — a running sandbox holds a concurrency slot and keeps metering.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "create_sandbox"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | environment variables, KEY=VAL | |
| slug | No | DNS label this sandbox is hosted and resolved under; also its name on a network tag (<slug>.pd) | |
| vcpu | No | vCPUs (0 = template default) | |
| image | No | custom docker image instead of a template | |
| ports | No | preview ports (app must bind $PORT) | |
| start | No | long-lived app/server command; makes the sandbox serve a preview URL | |
| public | No | make the preview URL reachable without a token (shareable link); default false = private | |
| runtime | No | pin isolation runtime: firecracker | docker (omit = auto) | |
| volumes | No | standalone volumes to attach (see create_volume) | |
| networks | No | opt-in network tags. Sandboxes cannot reach each other by default; two in the same org on the same node reach each other only if they share a tag, and resolve each other as <slug>.pd | |
| template | No | template id (see list_templates); default python-3.11 | |
| memory_mb | No | memory MB (0 = template default) | |
| storage_mb | No | disk MB (0 = template default) | |
| secret_refs | No | vault secrets (see list_secrets) to put in the sandbox's environment by name | |
| idle_seconds | No | idle auto-pause; -1 = never pause (always-on servers) | |
| proxied_secrets | No | vault secrets the sandbox may use but never sees: it gets NAME=pd-proxied and NAME_PROXY_URL, and the node adds the secret to calls made through that URL to host. Point the SDK's base URL at it, e.g. OPENAI_BASE_URL=$OPENAI_API_KEY_PROXY_URL/v1 | |
| timeout_seconds | No | sandbox lifetime (0 = plan default) |