Checkout Sandbox

Complete sandbox documentation in structured pages with examples for setup, SDK usage, and API flows. Current supported languages are Python and Node.js.

API Reference

Endpoints for health checks, single-shot execution, and persistent sandbox sessions.

GET /healthz

1{ "status": "ok" }

POST /api/v1/execute

Request

1{
2  "language": "python",
3  "code": "print('Hello')",
4  "timeout_ms": 5000
5}

Success response

1{
2  "status": "success",
3  "stdout": "Hello\n",
4  "stderr": "",
5  "execution_time_ms": 123
6}

Sandbox Session API

  • POST /api/v1/sandboxes: Create a sandbox session.
  • GET /api/v1/sandboxes/:id: Fetch sandbox metadata.
  • POST /api/v1/sandboxes/:id/execute: Execute code in a sandbox.
  • DELETE /api/v1/sandboxes/:id: Mark sandbox as deleted.
  • GET /api/v1/capabilities: Return runtime and limits metadata.

Execute request

1{
2  "language": "nodejs",
3  "code": "console.log(2+2)",
4  "timeout_ms": 5000
5}

Execute response

1{
2  "api_version": "v1",
3  "kind": "SandboxExecution",
4  "sandbox": {
5    "id": "sbx_...",
6    "state": "active",
7    "createdAt": "...",
8    "updatedAt": "...",
9    "expiresAt": "...",
10    "executionCount": 1
11  },
12  "result": {
13    "status": "success",
14    "stdout": "4\n",
15    "stderr": "",
16    "execution_time_ms": 321
17  }
18}

Common Error Codes

  • invalid_payload (400)
  • unsupported_language (422)
  • disallowed_capability (422)
  • timeout_exceeds_limit (422)
  • code_too_large (413)
  • sandbox_not_found (404)
  • sandbox_deleted (409)
  • unauthorized (401)