Execute Sandbox command
Runs the command synchronously by default (timeout configurable via timeoutSeconds, 600s cap). With detached: true the command starts in the background and a process id is returned immediately; poll /sandboxes/{sandboxId}/commands/{processId} for status and logs. With stream: true the output arrives as the command writes it, as newline-delimited JSON (application/x-ndjson): {"type":"started"}, then {"type":"stdout"|"stderr","data":"..."} per chunk, and last {"type":"exit",...} (the synchronous result without stdout/stderr) or {"type":"error","error":"...","message":"..."}. Returns 400 invalid_timeout when timeoutSeconds is not an integer in 1-600. A command sent while the sandbox is still starting (right after a resume) waits up to 60s for it to be ready instead of failing; 409 boat_starting (retryable) is returned only if it is still not ready by then. A sandbox that is not starting (error, stopped) returns 409 sandbox_not_ready with retryable: false and its state at once: resume or recover it first. Command execution is never retried automatically: a 502 boat_direct_failed means the command may already be running on the sandbox.
Authorizations
Boat bearer token in the form boat_.... Service API keys authenticate sandbox operations.
Path Parameters
Public Sandbox id returned by create/list/get sandbox calls.
^bx_[23456789abcdefghjkmnpqrstuvwxyz]{8}$Body
Relative working directory inside the sandbox work directory.
Command timeout in seconds. Values outside 1-600 are rejected with a 400 invalid_timeout error.
1 <= x <= 600Start the command in the background and return a process id immediately instead of waiting for it to finish. Output goes to a log file on the sandbox; poll the status endpoint for it.
Stream the output as the command writes it: the response is newline-delimited JSON (application/x-ndjson), one CommandStreamFrame per line. Ignored with detached.
Response
Command result (synchronous), process start confirmation (detached), or the output stream (stream: true).
- Option 1
- Option 2
true
Stable success envelope discriminator added by v1.
"command.finished"True when the memory ceiling killed the command or one of its processes and the command failed.