Runtime
Run a shell command
Runs cmd inside the sandbox via a shell, so pipes, &&, redirects, and installed CLI tools all work. Sandbox must be in status ready.
Pass stream: true to receive stdout / stderr as they arrive. The response then uses Content-Type: text/event-stream with one JSON object per data: line; the final event is { "type": "done", ... }. See ExecStreamFrame for the event shape.
post/sandboxes/{id}/exec
Path parameters
idstring required
24-char hex id of the sandbox.
Request body
Example request
{
"env": {
"NODE_ENV": "production",
"DATABASE_URL": "postgres://..."
}
}Response
Command completed.
When the request body has stream: true, the response is text/event-stream, one ExecStreamFrame per data: event, the last being a done event.
Example response
{
"message": "Exec completed"
}