Create Sandbox
Lifecycle API
Create Sandbox
Create a new sandbox from a container image
POST
Create Sandbox
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.
Authentication
API Key authentication is required via theOPEN-SANDBOX-API-KEY header.
Request Body
Container image specification for the sandbox
Sandbox timeout in seconds. The sandbox will automatically terminate after this duration.
- Minimum: 60
- Maximum: 86400
Runtime resource constraints for the sandbox instance. Similar to Kubernetes resource specifications.SDK clients should provide sensible defaults (e.g.,
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”)
The command to execute as the sandbox’s entry process (required).Explicitly specifies the user’s expected main process, allowing the sandbox management service to reliably inject control processes before executing this command.Format:
[executable, arg1, arg2, ...]Examples:["python", "/app/main.py"]["/bin/bash"]["java", "-jar", "/app/app.jar"]["node", "server.js"]
Environment variables to inject into the sandbox runtime.Example:
Custom key-value metadata for management, filtering, and tagging.Use “name” key for a human-readable identifier.Example:
Optional outbound network policy for the sandbox. If omitted or empty, the sidecar starts in allow-all mode until updated.
Storage mounts for the sandbox. Each volume entry specifies a named backend-specific storage source and common mount settings.
Opaque container for provider-specific or transient parameters not supported by the core API.Best Practices:
This field is reserved for internal features, experimental flags, or temporary behaviors. Standard parameters should be proposed as core API fields.
- Namespacing: Use prefixed keys (e.g.,
storage.id) to prevent collisions. - Pass-through: SDKs and middleware must treat this object as opaque and pass it through transparently.
Response
Unique sandbox identifier
Current lifecycle status and detailed state information
Custom metadata from creation request
Entry process specification from creation request
Timestamp when sandbox will auto-terminate (RFC 3339 format)
Sandbox creation timestamp (RFC 3339 format)
Response Headers
Unique request identifier for tracing
URI of the newly created sandbox resource
The create response does not include
image and updatedAt fields. Use GET /v1/sandboxes/{sandboxId} to retrieve the complete sandbox information including image spec.Status Code
Sandbox created and accepted for provisioning.The returned sandbox includes:
id: Unique sandbox identifierstatus.state: "Pending"(auto-starting provisioning)status.reasonandstatus.messageindicating initialization stagemetadata,expiresAt,createdAt: Core sandbox information
GET /v1/sandboxes/{sandboxId}. The sandbox will automatically transition to Running state once provisioning completes.Error Responses
The request was invalid or malformed
Authentication credentials are missing or invalid
The operation conflicts with the current state
An unexpected server error occurred