Skip to main content
POST
Create a sandbox

Authorizations

Authorization
string
header
required

Archil API key, including its key- prefix

Query Parameters

wait
boolean
default:false

Hold the request for a completed sandbox lifecycle transition

Body

application/json
name
string

Sandbox name, unique within the account. A random word-list name is generated when omitted.

Required string length: 1 - 63
Pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
vcpu_count
integer
default:1
Required range: 1 <= x <= 32
mem_size_mib
integer
default:2048
Required range: 256 <= x <= 65536
base_image
string

Public Linux OCI image reference with a linux/amd64 manifest for Archil's public sandbox service. Docker shorthand and tags are accepted; the deployment's platform manifest is pinned at creation. Defaults to node:24-bookworm (Debian with Node.js, Python, git, and a C toolchain) when neither this nor image_id is set. Mutually exclusive with image_id.

image_id
string

ID from Build Image, for a public or private image. For private images, build with registry_auth first, then pass the returned ID here. The sandbox boots the image's current digest. Mutually exclusive with base_image.

Pattern: ^[0-9a-f]{64}$
ports
integer[]

TCP ports to expose publicly when the sandbox is created.

Required range: 1 <= x <= 65535
enable_service_ingress
boolean
default:false

Allow services inside the sandbox to expose ingress. When false, services still run but their ports must be exposed explicitly through the API. Retained across starts, resumes, and forks.

env
object

Environment variables applied to every process

network
object

Sandbox network policy. New sandboxes on free plans receive deny-all egress with no allowlist exceptions. Start/resume and forks retain the stored policy. For paid accounts, egress is unrestricted when omitted.

mounts
object[]

Archil disks mounted inside the guest for the first session; start can replace them for later sessions. Inherited by forks. A sandbox with mounts must be stopped before it can be forked.

max_ttl_seconds
integer
default:86400

Lifetime budget applied independently to each powered-on session. Expiry pauses the sandbox, preserving memory and processes for resume. Timeout resets cannot extend a session beyond 24 hours.

Required range: 60 <= x <= 86400
idle_ttl_seconds
integer
default:1800

Pause after this many seconds without a direct process connection, preserving memory and processes for resume. Defaults to 1800 (30 minutes) when omitted. Zero disables idle expiry.

Required range: 0 <= x <= 86400
max_concurrent_execs
integer
default:32

Maximum number of concurrently attached process sessions. Detached processes and one-shot process controls do not count.

Required range: 1 <= x <= 256

Response

The sandbox was created

success
boolean
required
Example:

true

data
object
required