curl --request POST \
--url https://api.example.com/v1/sandboxes \
--header 'Content-Type: application/json' \
--data '
{
"image": {
"uri": "<string>",
"auth": {
"username": "<string>",
"password": "<string>"
}
},
"timeout": 123,
"resourceLimits": {},
"entrypoint": [
{}
],
"env": {},
"metadata": {},
"networkPolicy": {
"defaultAction": "<string>",
"egress": [
{
"action": "<string>",
"target": "<string>"
}
]
},
"volumes": [
{
"name": "<string>",
"mountPath": "<string>",
"readOnly": true,
"subPath": "<string>",
"host": {
"path": "<string>"
},
"pvc": {
"claimName": "<string>"
}
}
],
"extensions": {}
}
'{
"202": {},
"400": {},
"401": {},
"409": {},
"500": {},
"id": "<string>",
"status": {
"state": "<string>",
"reason": "<string>",
"message": "<string>",
"lastTransitionAt": "<string>"
},
"metadata": {},
"entrypoint": [
{}
],
"expiresAt": "<string>",
"createdAt": "<string>",
"X-Request-ID": "<string>",
"Location": "<string>"
}Create a new sandbox from a container image
curl --request POST \
--url https://api.example.com/v1/sandboxes \
--header 'Content-Type: application/json' \
--data '
{
"image": {
"uri": "<string>",
"auth": {
"username": "<string>",
"password": "<string>"
}
},
"timeout": 123,
"resourceLimits": {},
"entrypoint": [
{}
],
"env": {},
"metadata": {},
"networkPolicy": {
"defaultAction": "<string>",
"egress": [
{
"action": "<string>",
"target": "<string>"
}
]
},
"volumes": [
{
"name": "<string>",
"mountPath": "<string>",
"readOnly": true,
"subPath": "<string>",
"host": {
"path": "<string>"
},
"pvc": {
"claimName": "<string>"
}
}
],
"extensions": {}
}
'{
"202": {},
"400": {},
"401": {},
"409": {},
"500": {},
"id": "<string>",
"status": {
"state": "<string>",
"reason": "<string>",
"message": "<string>",
"lastTransitionAt": "<string>"
},
"metadata": {},
"entrypoint": [
{}
],
"expiresAt": "<string>",
"createdAt": "<string>",
"X-Request-ID": "<string>",
"Location": "<string>"
}Creates a new sandbox from a container image with optional resource limits, environment variables, and metadata. Sandboxes are provisioned directly from the specified image without requiring a pre-created template.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.
OPEN-SANDBOX-API-KEY header.
Show properties
"python:3.11" (Docker Hub)"ubuntu:22.04""gcr.io/my-project/model-server:v1.0""private-registry.company.com:5000/app:latest"cpu: "500m", memory: "512Mi").Common resource types:cpu: CPU allocation in millicores (e.g., “250m” for 0.25 CPU cores)memory: Memory allocation in bytes or human-readable format (e.g., “512Mi”, “1Gi”)gpu: Number of GPU devices (e.g., “1”){
"cpu": "500m",
"memory": "512Mi",
"gpu": "1"
}
[executable, arg1, arg2, ...]Examples:["python", "/app/main.py"]["/bin/bash"]["java", "-jar", "/app/app.jar"]["node", "server.js"]{
"API_KEY": "secret-key",
"DEBUG": "true",
"LOG_LEVEL": "info"
}
{
"name": "Data Processing Sandbox",
"project": "data-processing",
"team": "ml",
"environment": "staging"
}
Show properties
allow, denyShow volume properties
Show properties
storage.id) to prevent collisions.Show properties
image and updatedAt fields. Use GET /v1/sandboxes/{sandboxId} to retrieve the complete sandbox information including image spec.id: Unique sandbox identifierstatus.state: "Pending" (auto-starting provisioning)status.reason and status.message indicating initialization stagemetadata, expiresAt, createdAt: Core sandbox informationGET /v1/sandboxes/{sandboxId}. The sandbox will automatically transition to Running state once provisioning completes.curl -X POST http://localhost:8080/v1/sandboxes \
-H "OPEN-SANDBOX-API-KEY: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"image": {
"uri": "python:3.11"
},
"timeout": 3600,
"resourceLimits": {
"cpu": "500m",
"memory": "512Mi"
},
"entrypoint": ["python", "/app/main.py"],
"networkPolicy": {
"defaultAction": "deny",
"egress": [
{
"action": "allow",
"target": "pypi.org"
}
]
}
}'
curl -X POST http://localhost:8080/v1/sandboxes \
-H "OPEN-SANDBOX-API-KEY: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"image": {
"uri": "python:3.11"
},
"timeout": 3600,
"resourceLimits": {
"cpu": "500m",
"memory": "512Mi"
},
"entrypoint": ["python", "/app/main.py"],
"networkPolicy": {
"defaultAction": "allow",
"egress": [
{
"action": "deny",
"target": "bad.example.com"
}
]
}
}'
{
"id": "sandbox-abc123",
"status": {
"state": "Pending",
"reason": "provisioning",
"message": "Sandbox is being provisioned",
"lastTransitionAt": "2026-03-01T10:30:00Z"
},
"metadata": {},
"entrypoint": ["python", "/app/main.py"],
"expiresAt": "2026-03-01T11:30:00Z",
"createdAt": "2026-03-01T10:30:00Z"
}