API reference · Schema
RunCodeRequest
languagestringrequiredpython (one interpreter per sandbox: state persists between runs), javascript (Node, a fresh process per run) or shell (bash, a fresh process per run)
One of
pythonjavascriptshellcodestringrequiredMachine-readable code
stdinstringGiven to the code on standard input
timeout_secondsintegerTime limit (default 60)
1–900
max_output_bytesintegerstdout + stderr cap; the run is cut off past it (default 1048576)
1024–4194304
Example
{
"language": "python",
"code": "x = 21 * 2\nprint(x)",
"timeout_seconds": 30
}Used by
- Run code in the sandbox and wait for the result (or stream it)
POST /v1/sandboxes/{sandbox_id}/runs