Skip to main content
POST
Create sandbox

Authorizations

X-API-Key
string
header
required

API key for authentication (format: vr_...)

Body

application/json
name
string
required

DNS-1123 subdomain format

Pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
Example:

"vm-01"

image
string

Image name in name:ver or name format. If omitted, defaults to the latest active code image.

Example:

"code"

cpu
integer

Number of vCPUs

Required range: 1 <= x <= 8
Example:

2

mem
integer

Memory in MiB

Required range: 1024 <= x <= 16384
Example:

2048

orgId
string

Organization that owns the sandbox. When omitted, derived from the authenticated API key (the key's org). When provided, must match the key's organization or the request is rejected.

Example:

"65ae1234567890abcdef1234"

userId
string

User attributed as the sandbox creator. When omitted, derived from the API key (typically the key creator). When provided, must be an owner or member of the resolved org or the request is rejected.

Example:

"65ae1234567890abcdef1234"

sync
boolean
default:true

If true (default), creation blocks until the agent responds (fast readiness check, ~2s timeout)

Example:

true

envVars
object

Environment variables to set on the sandbox

Example:
autoSleep
boolean

If true, the sandbox is auto-snapshotted after idle and wakes on the next request

Example:

true

region
string

Target region for the sandbox

Example:

"eu"

publishPorts
integer[]

Sandbox ports to expose through the public gateway. Each entry is published as a separate public URL once the VM is running.

Required range: 1 <= x <= 65535
Example:

Response

Sandbox created

status
string
Example:

"success"

message
string
Example:

"Sandbox created"

data
object