v2

latestOpenAPI 3.1.0Proprietaryraw.githubusercontent.com2026-04-0912817.8 KB
Exec

Execute a command and stream output via SSE

Runs a command and streams stdout/stderr chunks as Server-Sent Events. Each event is a JSON payload. The final event includes exit_code and finished: true. Idle sandboxes are automatically resumed before execution.

post/sandboxes/{sandbox_id}/exec/stream

Request body

commandstring required

Command to execute. Wrapped in /bin/sh -c unless args is provided.

argsstring[]

If provided, command is used as the binary and args as arguments (no shell wrapping).

envobject

Environment variables for the command.

working_dirstring

Working directory (default /home/user).

timeout_sinteger

Timeout in seconds.

Response

SSE stream. Each line starting with data: contains a JSON ExecStreamEvent. The final event has finished: true.