API Reference
About This API
Section titled “About This API”Agent Sandboxes is OpenSandbox running on Nirvana’s NKS with a custom, performance-tuned configuration.
The API is built on OpenSandbox, but we manage a fully customized deployment with:
- Custom NKS Configuration — Optimized cluster setup tuned for your workload requirements
- Integrated Storage Solution — Custom storage backend through the
extensionsfield (not available in vanilla OpenSandbox) - Per-Customer Performance Tuning — Your sandbox cluster is configured specifically for your performance and reliability needs
The endpoints documented here cover the most common operations. For additional OpenSandbox endpoints and advanced options, see the OpenSandbox documentation.
Coming Soon: Nirvana-specific endpoints and enhanced management features tailored to your infrastructure.
Authentication
Section titled “Authentication”All API requests require the OPEN-SANDBOX-API-KEY header:
-H "OPEN-SANDBOX-API-KEY: YOUR_API_KEY"Base URLs
Section titled “Base URLs”- API Server:
{API_ENDPOINT}(provided by Nirvana Labs) - Gateway:
{GATEWAY_ENDPOINT}(provided by Nirvana Labs)
Replace
{API_ENDPOINT}and{GATEWAY_ENDPOINT}with the actual URLs provided when you receive your sandbox credentials.
Sandboxes
Section titled “Sandboxes”Create Sandbox
Section titled “Create Sandbox”Request:
POST /sandboxesContent-Type: application/jsonOPEN-SANDBOX-API-KEY: YOUR_API_KEYBody:
{ "image": { "uri": "python:3.12-slim" }, "entrypoint": ["/bin/sh", "-c", "command"], "resourceLimits": { "cpu": "2", "memory": "2Gi" }, "extensions": { "persistence": "true", "storageClass": "local-path", "storageSize": "50Gi" }}Response:
{ "id": "sandbox-id-uuid", "image": { "uri": "python:3.12-slim" }, "status": { "state": "Running", "reason": "DependenciesReady", "message": "Pod is Ready; Service Exists", "lastTransitionAt": "2026-07-02T10:37:23Z" }, "createdAt": "2026-07-02T10:37:16Z"}Get Sandbox
Section titled “Get Sandbox”Request:
GET /sandboxes/{sandbox_id}OPEN-SANDBOX-API-KEY: YOUR_API_KEYResponse: Returns the full sandbox object with current status.
List Sandboxes
Section titled “List Sandboxes”Request:
GET /sandboxesOPEN-SANDBOX-API-KEY: YOUR_API_KEYResponse:
{ "items": [ { /* sandbox object */ }, { /* sandbox object */ } ], "pagination": { "page": 1, "pageSize": 20 }}Pause Sandbox
Section titled “Pause Sandbox”Request:
POST /sandboxes/{sandbox_id}/pauseOPEN-SANDBOX-API-KEY: YOUR_API_KEYDetails:
- Pod is deleted, PVC is retained
- Instant operation
- State preserved if persistence enabled
Resume Sandbox
Section titled “Resume Sandbox”Request:
POST /sandboxes/{sandbox_id}/resumeOPEN-SANDBOX-API-KEY: YOUR_API_KEYDetails:
- Creates new pod with same
/workspacePVC - Instant operation
- Agent continues from checkpoint
Delete Sandbox
Section titled “Delete Sandbox”Request:
DELETE /sandboxes/{sandbox_id}OPEN-SANDBOX-API-KEY: YOUR_API_KEYDetails:
- Sandbox is terminated and resources are cleaned up
- Instant operation
Endpoints & Access
Section titled “Endpoints & Access”Get Service Endpoint
Section titled “Get Service Endpoint”Request:
GET /sandboxes/{sandbox_id}/endpoints/{port}OPEN-SANDBOX-API-KEY: YOUR_API_KEYResponse:
{ "endpoint": "{GATEWAY_ENDPOINT}", "headers": { "OpenSandbox-Ingress-To": "{sandbox_id}-{port}" }}Usage:
curl -H "OpenSandbox-Ingress-To: {sandbox_id}-{port}" \ $GATEWAY_ENDPOINT/pathProxy Endpoint (via API Server)
Section titled “Proxy Endpoint (via API Server)”Request:
GET /sandboxes/{sandbox_id}/proxy/{port}/{path}OPEN-SANDBOX-API-KEY: YOUR_API_KEYExample:
curl $API_ENDPOINT/sandboxes/abc123/proxy/8000/state.json \ -H "OPEN-SANDBOX-API-KEY: YOUR_API_KEY"Details:
- Routes through API server (simpler, no custom headers needed)
- Suitable for JSON/API requests
- Lower throughput than gateway for large files
Diagnostics
Section titled “Diagnostics”Get Sandbox Logs
Section titled “Get Sandbox Logs”Request:
GET /sandboxes/{sandbox_id}/diagnostics/logsOPEN-SANDBOX-API-KEY: YOUR_API_KEYGet Sandbox Events
Section titled “Get Sandbox Events”Request:
GET /sandboxes/{sandbox_id}/diagnostics/eventsOPEN-SANDBOX-API-KEY: YOUR_API_KEYInspect Sandbox
Section titled “Inspect Sandbox”Request:
GET /sandboxes/{sandbox_id}/diagnostics/inspectOPEN-SANDBOX-API-KEY: YOUR_API_KEYReturns detailed pod and resource information.
Status States
Section titled “Status States”Running— Sandbox is active and readyPaused— Pod deleted, PVC retainedPending— Creating pod, waiting for resourcesFailed— Sandbox failed to start or crashedTerminated— Sandbox deleted
Error Responses
Section titled “Error Responses”All errors include a detail field with error information:
{ "code": "ERROR_CODE", "message": "Human-readable error message", "detail": "Additional context"}Common errors:
MISSING_API_KEY— API key header missingINVALID_API_KEY— API key incorrectPOD_READY_TIMEOUT— Sandbox failed to start within timeoutSANDBOX_NOT_FOUND— Sandbox ID doesn’t exist