ScalixScalix Docs
Sign up

Sandboxes API

Ephemeral microVM sandboxes for agent code execution

REST API endpoints for Sandboxes. 9 operations.

List your sandboxes

plaintext
GET /v1/sandboxes

Auth: Bearer API key

Responses

StatusDescription
200{sandboxes: [...], total}
401Missing or invalid API key

operationId: sandboxList

Create an ephemeral sandbox

plaintext
POST /v1/sandboxes

Boots an isolated microVM. Ephemeral sandboxes are disposable: they stop at their idle or hard timeout and nothing on the rootfs persists past stop. Compute is billed per vCPU-hour and GB-hour of allocation while running.

Auth: Bearer API key

Request body

application/json (required) — schema SandboxCreateRequest.

Request body for creating an ephemeral sandbox.

FieldTypeRequiredDescription
runtimestring | nullNoRuntime image. node22 is available today; other values are rolling out and fail placement until their images ship.
resourcesobjectNoResource shape. Defaults: 1 vCPU, 512 MB memory, 5 GB disk.
timeout_msinteger | null (int64)NoHard lifetime in milliseconds (60000..86400000, default 300000). The sandbox also stops earlier at its idle timeout.
portsarray<integer (int32)>NoGuest ports to expose.
sourceobjectNo{type: "git", url, branch?} clones a repository into the sandbox.
envobjectNoEnvironment variables for the guest.

Responses

StatusDescription
201Sandbox created (initially PROVISIONING)
401Missing or invalid API key
402Credit exhausted or plan limit reached
503No capacity for the requested resources

operationId: sandboxCreate

Delete a sandbox and tear down its microVM

plaintext
DELETE /v1/sandboxes/{id}

Auth: Bearer API key

Parameters

NameInTypeRequiredDescription
idpathstringYesSandbox id

Responses

StatusDescription
204Deleted
404Not found

operationId: sandboxDelete

Get a sandbox by id

plaintext
GET /v1/sandboxes/{id}

Auth: Bearer API key

Parameters

NameInTypeRequiredDescription
idpathstringYesSandbox id

Responses

StatusDescription
200Sandbox details
404Not found

operationId: sandboxGet

Run a command inside a running sandbox (synchronous)

plaintext
POST /v1/sandboxes/{id}/commands

Auth: Bearer API key

Parameters

NameInTypeRequiredDescription
idpathstringYesSandbox id

Request body

application/json (required) — schema SandboxCommandRequest.

Request body for running a command inside a sandbox.

FieldTypeRequiredDescription
cmdstringYes
argsarray<string>No
cwdstring | nullNoWorking directory inside the guest.
envobjectNo
detachedboolean | nullNoRun without waiting for completion.

Responses

StatusDescription
200Command result
400Sandbox is not running
404Not found

operationId: sandboxRunCommand

Extend a sandbox's hard deadline

plaintext
POST /v1/sandboxes/{id}/extend

Auth: Bearer API key

Parameters

NameInTypeRequiredDescription
idpathstringYesSandbox id

Request body

application/json (required) — schema SandboxExtendRequest.

Request body for extending a sandbox's hard deadline.

FieldTypeRequiredDescription
duration_msinteger (int64)YesMilliseconds to add to the current expiry.

Responses

StatusDescription
200Updated sandbox
404Not found

operationId: sandboxExtend

Write files into a sandbox

plaintext
POST /v1/sandboxes/{id}/files

Auth: Bearer API key

Parameters

NameInTypeRequiredDescription
idpathstringYesSandbox id

Request body

application/json (required) — schema SandboxWriteFilesRequest.

Request body for writing files into a sandbox. Writable roots inside the guest are /app, /scalix, /build, and /tmp.

FieldTypeRequiredDescription
filesarray<object>YesFiles to write: [{path, content}].

Responses

StatusDescription
204Files written
404Not found
502Path outside the allowed guest roots

operationId: sandboxWriteFiles

Read a file from a sandbox. The guest path follows /files/

plaintext
GET /v1/sandboxes/{id}/files/{path}

Auth: Bearer API key

Parameters

NameInTypeRequiredDescription
idpathstringYesSandbox id
pathpathstringYesGuest file path, e.g. app/output.json

Responses

StatusDescription
200File content (application/octet-stream)
404File or sandbox not found

operationId: sandboxReadFile

Snapshot a sandbox - not available

plaintext
POST /v1/sandboxes/{id}/snapshot

Ephemeral sandboxes are disposable; state does not persist past stop. This endpoint returns 501 until snapshots ship (demand-gated).

Auth: Bearer API key

Parameters

NameInTypeRequiredDescription
idpathstringYesSandbox id

Responses

StatusDescription
501Snapshots are not available for ephemeral sandboxes

operationId: sandboxSnapshot