/api/v1/sessionsCreate a new sandbox session
/api/v1/sessions/{session_id}Destroy an existing session
/api/v1/sessions/{session_id}/execExecute code in the sandbox environment
/api/v1/sessions/{session_id}/packagesInstall packages in the sandbox environment
/api/v1/sessions/{session_id}/hibernateHibernate a session to save resources
/api/v1/sessions/{session_id}/restoreRestore a previously hibernated session
Focus on the current execution path only, skipping exponential branching complexity.
Catch and fix errors instantly–line by line, no post-hoc tracing.
Define function stubs first, fill logic only when called (like human iterative coding).
Persist sessions mid-execution, ideal for long-running processes and iterative workflows.
// Request
POST /api/v1/sessions
Content-Type: application/json
{
"runtime":"python3.9"
}
// Response
{
"session_id":"sess_abc123xyz",
"status":"ready",
"runtime":"python3.9",
"created_at":"2023-05-15T15:30:45Z"
}// Request
POST /api/v1/sessions/sess_abc123xyz/exec
Content-Type: application/json
{
"code":"def find_primes(n):\n if n <Link 2:\n return []\n return [x for x in range(2, n+1) if all(x % y != 0 for y in range(2, int(x**0.5) + 1))]\n\nprint(find_primes(20))"
}
// Response
{
"status":"success",
"output":"[2, 3, 5, 7, 11, 13, 17, 19]",
"execution_time": 0.0045
}// Request
POST /api/v1/sessions/sess_abc123xyz/packages
Content-Type: application/json
{
"packages": ["numpy","pandas==1.4.2"]
}
// Response
{
"status":"success",
"installed": [
{"name":"numpy","version":"1.23.5"},
{"name":"pandas","version":"1.4.2"}
]
}Our sandbox runtime provides the execution environment that AI platforms need
Integrate our sandbox API to safely execute code generated by your AI models
Build interactive coding tutorials or educational platforms