API Reference
About this API
Section titled “About this API”Sandboxes are managed with the OpenSandbox Sandbox Lifecycle API (server v0.2.0), served by the Nirvana API. OpenSandbox SDKs work unchanged when pointed at the base URL below.
Sandbox clusters, the clusters sandboxes run on, are managed with the Nirvana API’s own endpoints. See Sandbox Clusters.
Base URL
Section titled “Base URL”https://api.nirvanalabs.io/v1Sandbox endpoints are under /v1/sandboxes.
Authentication
Section titled “Authentication”Use a Nirvana organization API key. See Authentication. Send it in either header:
-H "OPEN-SANDBOX-API-KEY: $NIRVANA_API_KEY"# or-H "Authorization: Bearer $NIRVANA_API_KEY"OpenSandbox SDKs send OPEN-SANDBOX-API-KEY. There is no separate sandbox key.
The key needs the sandbox permission on the project of the sandbox cluster:
read to list and get sandboxes, edit for everything else. A key scoped to
some projects only sees sandboxes on clusters in those projects.
Sandboxes
Section titled “Sandboxes”Create sandbox
Section titled “Create sandbox”POST /v1/sandboxesBody:
{ "image": { "uri": "python:3.12-slim" }, "entrypoint": ["python3", "-m", "http.server", "8000"], "resourceLimits": { "cpu": "2", "memory": "2Gi" }, "extensions": { "nirvana.sandbox_cluster_id": "123e4567-e89b-12d3-a456-426614174000" }}extensions["nirvana.sandbox_cluster_id"] is required. It is the ID of the
sandbox cluster to create the sandbox on, and the cluster’s status must be
ready.
Nirvana enforces these rules on top of OpenSandbox:
- Only
pvcvolumes are accepted.hostandossfsvolumes are rejected. See Persistence & Storage. snapshotIdis rejected. Creating sandboxes from snapshots is not supported.- Secure access is always on. Ports can only be reached through signed endpoints.
Response:
{ "id": "0b9e1c2d-3f4a-4b5c-8d6e-7f8091a2b3c4", "image": { "uri": "python:3.12-slim" }, "status": { "state": "Running", "reason": "DependenciesReady", "message": "Pod is Ready; Service Exists", "lastTransitionAt": "2026-07-02T10:37:23Z" }, "extensions": { "nirvana.sandbox_cluster_id": "123e4567-e89b-12d3-a456-426614174000", "nirvana.region": "us-sva-2" }, "createdAt": "2026-07-02T10:37:16Z"}Every sandbox returned by the API carries nirvana.sandbox_cluster_id and
nirvana.region in its extensions.
Get sandbox
Section titled “Get sandbox”GET /v1/sandboxes/{sandbox_id}Returns the sandbox with its current status.
List sandboxes
Section titled “List sandboxes”GET /v1/sandboxesLists sandboxes on every ready sandbox cluster in the projects your key can
read. It takes OpenSandbox’s state, metadata, page and pageSize query
parameters. There is no filter by cluster. To find a cluster’s sandboxes, use
extensions["nirvana.sandbox_cluster_id"] in the response, or tag your
sandboxes with metadata and filter on it.
Response:
{ "items": [ { /* sandbox object */ }, { /* sandbox object */ } ], "pagination": { "page": 1, "pageSize": 20 }}Update metadata
Section titled “Update metadata”PATCH /v1/sandboxes/{sandbox_id}/metadataChanges the sandbox’s metadata.
Renew expiration
Section titled “Renew expiration”POST /v1/sandboxes/{sandbox_id}/renew-expirationBody:
{ "expiresAt": "2026-07-02T12:00:00Z"}expiresAt is required, as an RFC 3339 timestamp. The response returns the new
expiresAt.
Delete sandbox
Section titled “Delete sandbox”DELETE /v1/sandboxes/{sandbox_id}Terminates the sandbox and cleans up its resources.
Get endpoint
Section titled “Get endpoint”GET /v1/sandboxes/{sandbox_id}/endpoints/{port}?expires={unix_seconds}Returns a signed endpoint for a port of the sandbox: the sandbox cluster’s gateway hostname, and the headers to send with every request to it:
{ "endpoint": "gw.0123456789ab.nirvanacloud.net", "headers": { "OpenSandbox-Ingress-To": "<sandbox_id>-8080-<token>" }}expires is optional, as Unix epoch seconds in the future. Without it, the
endpoint expires with the sandbox, or after 1 hour if the sandbox doesn’t
expire. An endpoint never lasts more than 24 hours.
Send requests over HTTPS to endpoint with the returned headers. Requests
without them are rejected. Use endpoint and headers exactly as returned and
don’t build the routing yourself; how the gateway routes requests may change. See
Access Sandbox Endpoints.
Not supported
Section titled “Not supported”These OpenSandbox operations are not available through the Nirvana API:
POST /v1/sandboxes/{sandbox_id}/pauseand/resumereturn409SANDBOX_PAUSE_NOT_SUPPORTED.- Creating sandboxes from snapshots.
hostandossfsvolumes.
Status states
Section titled “Status states”Pending: the sandbox is starting.Running: the sandbox is active and ready.Failed: the sandbox failed to start or crashed.Terminated: the sandbox was deleted.
Error responses
Section titled “Error responses”Errors on /v1/sandboxes use OpenSandbox’s error shape:
{ "code": "ERROR_CODE", "message": "Human-readable error message"}Errors on /v1/sandbox_clusters use the Nirvana API’s usual error shape.