Skip to main content
POST
/
v1
/
execute
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
  }
}
Execute code in a sandboxed environment. Supports Python, JavaScript, TypeScript, Bash, C, C++, Go, Ruby, Rust, Java, and C#.

Request Body

language
string
required
Language to execute: python, javascript, typescript, bash, c, c++, go, ruby, rust, java, csharp
code
string
required
Code to execute (shorthand for single file). Either code or files must be provided.
files
array
Array of files for multi-file execution. Each file has name (optional) and content (required).
stdin
string
Standard input to pass to the program
version
string
default:"*"
Language version selector. * uses the latest installed version.
run_timeout
number
default:"5000"
Run timeout in milliseconds
compile_timeout
number
default:"10000"
Compile timeout in milliseconds (for compiled languages)

Response

language
string
Language that was used
version
string
Runtime version used
compile
object
Compilation result (only for compiled languages: C, C++, Go, Rust, Java)
run
object
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)