The Sandbox Lifecycle API is the primary interface for provisioning and managing sandbox environments. Every sandbox follows a predictable state machine:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/opensandbox-group/OpenSandbox/llms.txt
Use this file to discover all available pages before exploring further.
Pending → Running → (optionally) Pausing → Paused → Resuming → Running → Stopping → Terminated. Any state can transition to Failed on a critical error. All endpoints share the base URL http://localhost:8080/v1 and require the OPEN-SANDBOX-API-KEY header for authentication.
POST /v1/sandboxes
Creates a new sandbox from a container image or restores one from a previously saved snapshot. The response is returned immediately withstatus.state: "Pending" — poll GET /v1/sandboxes/{sandboxId} to track provisioning progress until the sandbox reaches Running.
Auth: OPEN-SANDBOX-API-KEY header required.
Exactly one startup source must be provided: image or snapshotId. When image is given, entrypoint is required. When snapshotId is given, entrypoint is optional (defaults to ["tail", "-f", "/dev/null"]).
Request Body
Container image specification. Mutually exclusive with
snapshotId.Snapshot identifier to restore from. Mutually exclusive with
image.Command to run as the sandbox entry process. Format:
[executable, arg1, arg2, ...]. Required when image is provided.Sandbox TTL in seconds (minimum 60). The sandbox auto-terminates after this duration. Omit or set
null to disable automatic expiration (requires manual cleanup).Hard resource caps for the sandbox instance. Required unless using pool mode.
Resource reservations (guaranteed minimums). When provided, enables Kubernetes Burstable QoS. When omitted,
resourceLimits values apply to both limits and requests (Guaranteed QoS). Ignored by Docker runtime.Key-value environment variables injected into the sandbox runtime. Example:
{"DEBUG": "true", "LOG_LEVEL": "info"}.Custom string key-value pairs for tagging and filtering. Use
"name" for a human-readable identifier.Optional platform scheduling constraint.
Outbound network policy applied at sandbox startup.
Credential Vault proxy configuration.
When
true, provisions endpoint access credentials. Supported only for Kubernetes sandboxes in ingress gateway mode. Defaults to false.Storage mounts. Each entry requires
name and mountPath, plus exactly one backend: host, pvc, or ossfs.Opaque provider-specific parameters. Pass through transparently. Well-known key:
access.renew.extend.seconds (300–86400) to enable renew-on-access.Response — 202 Accepted
Unique sandbox identifier.
Current lifecycle status.
The resolved entry process command.
Custom metadata echoed from the creation request.
Platform constraint echoed from request or workload template.
RFC 3339 timestamp of auto-termination. Omitted when manual cleanup is enabled.
RFC 3339 sandbox creation timestamp.
The create response does not include
image, snapshotId, or updatedAt. Use GET /v1/sandboxes/{sandboxId} to retrieve the full sandbox representation.Example
GET /v1/sandboxes
Lists all sandboxes with optional filtering and pagination. Multiplestate values use OR logic; all other filter conditions are ANDed together.
Auth: OPEN-SANDBOX-API-KEY header required.
Query Parameters
Filter by lifecycle state. Pass multiple times for OR logic. Example:
?state=Running&state=Paused.Filter by metadata key-value pairs. Keys and values must be URL-encoded. Example:
?metadata=project%3DApollo.Page number for pagination (minimum 1, default 1).
Number of items per page (minimum 1, default 20).
Response — 200 OK
Array of sandbox objects.
Example
GET /v1/sandboxes/
Returns the complete sandbox resource including startup source (image or snapshotId), entrypoint, current status, and metadata.
Auth: OPEN-SANDBOX-API-KEY header required.
Path Parameters
Unique sandbox identifier.
Response — 200 OK
Unique sandbox identifier.
Full lifecycle status with
state, reason, message, and lastTransitionAt.Container image spec. Present when the sandbox was created from an image.
Source snapshot ID. Present when the sandbox was restored from a snapshot.
Entry process command.
Platform constraint, if any.
Custom metadata key-value pairs.
Auto-termination timestamp. Omitted when manual cleanup is enabled.
Creation timestamp (RFC 3339).
Example
DELETE /v1/sandboxes/
Terminates a sandbox. The sandbox transitions throughStopping to Terminated. Returns 204 No Content on success.
Auth: OPEN-SANDBOX-API-KEY header required.
Path Parameters
Unique sandbox identifier.
Example
POST /v1/sandboxes//pause
Initiates an asynchronous pause of a running sandbox. State transitions throughPausing and eventually reaches Paused. Returns 202 Accepted immediately — poll GET /v1/sandboxes/{sandboxId} to track completion.
Auth: OPEN-SANDBOX-API-KEY header required.
Path Parameters
Unique sandbox identifier.
Example
POST /v1/sandboxes//resume
Resumes a paused sandbox. State transitionsPaused → Resuming → Running. Returns 202 Accepted — poll GET /v1/sandboxes/{sandboxId} to confirm the sandbox has returned to Running.
Auth: OPEN-SANDBOX-API-KEY header required.
Path Parameters
Unique sandbox identifier.
Example
PATCH /v1/sandboxes//metadata
Updates sandbox metadata using JSON Merge Patch (RFC 7396) semantics. Keys with string values are added or replaced; keys withnull values are deleted; absent keys are left unchanged. Returns the full updated sandbox object.
Auth: OPEN-SANDBOX-API-KEY header required.
Path Parameters
Unique sandbox identifier.
Request Body
The request body is the metadata object itself. Example:Example
POST /v1/sandboxes//renew-expiration
Updates the absolute expiration time for a sandbox. The new timestamp must be in the future and after the currentexpiresAt value. Returns only the updated expiresAt field.
Auth: OPEN-SANDBOX-API-KEY header required.
Path Parameters
Unique sandbox identifier.
Request Body
New absolute expiration time in UTC (RFC 3339 format). Must be in the future. Example:
"2025-11-16T14:30:45Z".Response — 200 OK
The new absolute expiration time in UTC (RFC 3339 format).
Example
GET /v1/sandboxes//endpoints/
Resolves the public access endpoint for a service running on a specific port inside the sandbox. The service must be actively listening on that port. Auth:OPEN-SANDBOX-API-KEY header required.
Path Parameters
Unique sandbox identifier.
Port number where the service is listening inside the sandbox (1–65535).
Query Parameters
Return a server-proxied URL. Cannot be combined with
expires. Default: false.Unix epoch seconds (decimal integer string). When set, the server issues a signed access route (OSEP-0011). Cannot be combined with
use_server_proxy=true.Response — 200 OK
Public URL for the service. Format:
{endpoint-host}/sandboxes/{sandboxId}/port/{port}.Required request headers that callers must include when targeting this endpoint. Present when
secureAccess was enabled at sandbox creation.