Execute a command inside a sandbox
**DEPRECATED** — will be removed in a future version. Prefer opening an interactive exec session with the WebSocket endpoint (see `POST /sandboxes/{sandboxId}/exec-token` + `wss://.../terminal`) for any non-trivial command execution. This REST call is limited to 300 seconds and does not stream output incrementally. Executes a shell command inside the sandbox and returns stdout, stderr, and exit code. The sandbox must be in Running phase. The command runs in a non-interactive shell (no TTY).
DEPRECATED — will be removed in a future version.
Prefer opening an interactive exec session with the WebSocket endpoint
(see POST /sandboxes/{sandboxId}/exec-token + wss://.../terminal) for
any non-trivial command execution. This REST call is limited to 300 seconds
and does not stream output incrementally.
Executes a shell command inside the sandbox and returns stdout, stderr, and exit code. The sandbox must be in Running phase. The command runs in a non-interactive shell (no TTY).
Authorization
ApiKeyAuth In: header
Path Parameters
Sandbox identifier.
- Single-cluster: a bare UUID v7 such as
5de15c92-8fb5-440f-a9ea-7f62f734f1b9. - Cross-cluster: a
{clusterID}.{uuid}composite such ascluster1.5de15c92-8fb5-440f-a9ea-7f62f734f1b9(dot-separated). TheclusterIDprefix tells the gateway which Worker cluster owns this sandbox; the server parses it out transparently. Discover valid cluster IDs viaGET /clusters.
Because of the composite form, this field is NOT a strict RFC 4122 UUID —
clients must treat it as an opaque string. Parsing reference: pkg/utils/cluster/sandbox_id.go::SplitSandboxID.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://sandboxes/5de15c92-8fb5-440f-a9ea-7f62f734f1b9/exec" \ -H "Content-Type: application/json" \ -d '{ "command": "echo hello" }'{ "exitCode": 0, "stdout": "string", "stderr": "string"}{ "error": "string", "errorCode": "API_KEY_REQUIRED", "detail": null}{ "error": "string", "errorCode": "API_KEY_REQUIRED", "detail": null}{ "error": "string", "errorCode": "API_KEY_REQUIRED", "detail": null}{ "error": "string", "errorCode": "API_KEY_REQUIRED", "detail": null}