The Sandbox Lifecycle API coordinates how untrusted workloads are created, executed, paused, resumed, and finally disposed. This API focuses on the primary lifecycle flows for sandboxes, which are provisioned directly from container images without requiring pre-created templates.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/alibaba/OpenSandbox/llms.txt
Use this file to discover all available pages before exploring further.
Sandbox Lifecycle
A sandbox follows this lifecycle:- Creation → Sandbox enters
Pendingstate (auto-starts) - Execution → Transitions to
Runningstate - Pause (optional) →
Pausing→Paused(asynchronous process) - Resume (optional) → Returns to
RunningfromPaused - Termination →
Stopping→Terminated(can be triggered by kill action, TTL expiry, or error) - Error → Any state can transition to
Failedon critical errors
Sandbox States
Thestatus field provides fine-grained details through state, reason, and message.
Common State Values
- Pending: Sandbox is being provisioned
- Running: Sandbox is running and ready to accept requests
- Pausing: Sandbox is in the process of pausing
- Paused: Sandbox has been paused while retaining its state
- Stopping: Sandbox is being terminated
- Terminated: Sandbox has been successfully terminated
- Failed: Sandbox encountered a critical error
State Transitions
- Pending → Running (after creation completes)
- Running → Pausing (when pause is requested)
- Pausing → Paused (pause operation completes)
- Paused → Running (when resume is requested)
- Running/Paused → Stopping (when kill is requested or TTL expires)
- Stopping → Terminated (kill/timeout operation completes)
- Pending/Running/Paused → Failed (on error)
New state values may be added in future versions. Clients should handle unknown state values gracefully.
Authentication
API Key authentication is required for all operations:HTTP Header
Environment Variable
For SDK clients:Base URL
All lifecycle API endpoints use the base path:Core Endpoints
The Lifecycle API provides the following endpoint groups:Sandbox Management
POST /v1/sandboxes- Create a sandbox from a container imageGET /v1/sandboxes- List sandboxes with filtering and paginationGET /v1/sandboxes/{sandboxId}- Get detailed sandbox informationDELETE /v1/sandboxes/{sandboxId}- Delete a sandbox
State Control
POST /v1/sandboxes/{sandboxId}/pause- Pause a running sandboxPOST /v1/sandboxes/{sandboxId}/resume- Resume a paused sandboxPOST /v1/sandboxes/{sandboxId}/renew-expiration- Renew sandbox timeout
Network Access
GET /v1/sandboxes/{sandboxId}/endpoints/{port}- Get access endpoint for a service port
Resource Configuration
Sandboxes support flexible resource configuration similar to Kubernetes:Common Features
Container Image Support
Create sandboxes from public or private registry images:- Docker Hub:
python:3.11,ubuntu:22.04 - GCR:
gcr.io/my-project/model-server:v1.0 - Private registries with authentication
Timeout Management
All sandboxes require atimeout (60-86400 seconds) on creation. Use the renewal endpoint to extend timeout before expiry.
Metadata & Filtering
Attach custom metadata for management, filtering, and tagging. Use thename key for human-readable identifiers.
Pagination
List operations support pagination withpage and pageSize query parameters.