Execute code in a sandboxed environment. Supports Python, JavaScript, TypeScript, Bash, C, C++, Go, Ruby, Rust, Java, and C#.
Request Body
Language to execute: python, javascript, typescript, bash, c, c++, go, ruby, rust, java, csharp
Code to execute (shorthand for single file). Either code or files must be provided.
Array of files for multi-file execution. Each file has name (optional) and content (required).
Standard input to pass to the program
Language version selector. * uses the latest installed version.
Run timeout in milliseconds
Compile timeout in milliseconds (for compiled languages)
Response
Compilation result (only for compiled languages: C, C++, Go, Rust, Java)
Execution result containing stdout, stderr, code (exit code), signal, time_ms, memory_kb
curl -X POST https://api.runtools.ai/v1/execute \
-H "Authorization: Bearer rt_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"language": "python",
"code": "print(sum(range(1, 101)))"
}'
{
"language": "python",
"version": "3.12.3",
"run": {
"stdout": "5050\n",
"stderr": "",
"code": 0,
"signal": null,
"time_ms": 22,
"memory_kb": 9088
}
}
Notes
- Each execution is fully isolated — no state persists between calls
- Code runs in a Linux namespace sandbox with process, filesystem, and resource isolation
- Network access is disabled inside the sandbox
- For persistent environments with SSH, files, and packages, use Sandboxes instead
- Maximum execution time is configurable per request (default: 5 seconds)