Reference
Execute code
Run code in the sandbox. Streams NDJSON events as they happen.
POST
Sandbox id from
POST /v1/sandboxes.Source code to execute.
python or bash. Python uses the sandbox’s persistent REPL
(state carries across calls); bash runs in a fresh subprocess.Semantics
- REPL state persists across Python
execcalls. Variables, imports, and open file handles stay alive. - Bash does not persist. Each bash
execis a fresh subprocess. - Serialized per sandbox. Only one
execruns at a time. Concurrent requests queue; if you want parallelism,fork(). - Exceptions don’t poison the REPL. An uncaught Python exception
produces
exit.data != 0but the next call still works.

