Run a command and wait for it to finish
Runs a command to completion and returns its full output in a single
response. For live output use POST /exec/stream (Server-Sent Events)
or GET /exec/connect (WebSocket). A non-zero exit code is returned in
the body, not as an HTTP error. The sandbox must be running; a paused
sandbox returns 503. Activate it first with
POST /sandboxes/{sandbox_id}/activate (the SDKs do this automatically).
Authorizations
Per-sandbox token returned by create, resume, and activate. Grants access to a single sandbox's files and commands. Distinct from the team X-API-Key.
Body
Command to execute. Wrapped in /bin/sh -c unless args is provided.
1If provided, command is used as the binary and args as arguments (no shell wrapping).
Environment variables for the command.
Working directory (default /home/user).
Timeout in seconds.