API endpoints
Last updated: 25 November 2026 · API v1 (beta)
This page lists all the endpoints of the public API. The base URL is https://api.hadronbox.tr/v1; for authentication, rate limits and the error format, see the API page. Every request needs the Authorization: Bearer hb_live_… header.
The page is generated at build time from the contract file, the openapi.json (opens in a new tab) document; the two are always the same. The field descriptions are shown as written in the document. The error codes in the response table are the codes that can come back with that status; their meanings are on the Error codes page.
Account
Account information
GET /v1/me
Returns the user the key belongs to, the organization, memberships, package and authentication type.
Scope required for a scoped key: account:read
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: MeResponse, meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
429 Too many requests | ApiError | RATE_LIMITED |
Machines
List machines
GET /v1/sandboxes
Returns the organization's machines in pages; supports search and sorting. The response also carries the machine quota.
Scope required for a scoped key: machines:read
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
page | number | No | query parameter · default: 1 · value: 1–10000 |
limit | number | No | query parameter · default: 20 · value: 1–100 |
search | string | No | query parameter · length: 0–100 |
sortOrder | "asc" | "desc" | No | query parameter · default: "desc" |
status | "creating" | "running" | "paused" | "stopped" | "error" | No | query parameter |
sortBy | "name" | "status" | "createdAt" | No | query parameter · default: "createdAt" |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: Machine[], meta, pagination: Pagination, quota: MachineQuota } | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
429 Too many requests | ApiError | RATE_LIMITED |
Create a machine
POST /v1/sandboxes
Creates a new machine. The optional sandboxId is an idempotency key: calling again with the same ID returns the existing machine. A template (templateCode) and a snapshot (snapshotId) cannot be given together.
Scope required for a scoped key: machines:create
Request body (JSON, CreateSandboxDto)
| Field | Type | Required | Description |
|---|---|---|---|
autoPause | boolean | No | Pause after the idle timeout; false needs package autoPauseOptional (beta package: 403 AUTO_PAUSE_REQUIRED)default: true |
env | SandboxEnvVarDto[] | No | Write-once, encrypted at rest; values are never returned (only envKeys)items: 0–100 |
goldenImage | string | No | LEGACY (SDK); 400 CONFLICTING_SOURCE together with templateCode/snapshotIdlength: 1–500 · example: "ai-sandbox/golden" |
idleTimeoutMinutes | number | No | TASK-194: idle minutes before auto-pause; default = plan idleTimeoutMinutes; 5..plan value, else 400 IDLE_TIMEOUT_OUT_OF_RANGEvalue: 5–1440 · example: 10 |
imageTag | string | No | LEGACY (SDK)length: 0–100 · example: "v1.2" |
name | string | Yes | pattern: ^[a-z0-9][a-z0-9-]{1,39}$ · example: "ubuntu-dev" |
sandboxId | string | No | Idempotency keylength: 5–64 · example: "sbx_a1b2c3d4" |
size | "small" | "medium" | "large" | No | Size preset: small 2 vCPU / 2 GiB, medium 2 vCPU / 4 GiB, large 4 vCPU / 8 GiB. Default small (desktop images: medium). Must fit plan maxVcpu/maxMemoryMib, else 402 PLAN_LIMIT_SIZE; a desktop image below medium → 400 DESKTOP_SIZE_TOO_SMALL (details { size, minSize }) |
snapshotId | string | No | XOR with templateCodeexample: "snp_0f8e6c1a-2b3c-4d5e-8f90-123456789abc" |
templateCode | string | No | Catalogue template; default = the isDefault templateexample: "standard" |
tools | "node" | "python" | "go" | "rust" | "docker" | "claude-code" | "codex" | "gemini-cli" | "copilot-cli" | "aider" | "opencode"[] | No | TASK-357: unique catalogue tool ids (status ga) installed in the background after boot; `requires` are added automatically (claude-code adds node). Per-tool state: GET /sandboxes/:id/tools. 400 TOOLS_WITH_SNAPSHOT with snapshotId (the snapshot carries its own tools; add more later with POST /sandboxes/:id/tools), 400 TOOLS_DISK_BUDGET when the estimated disk use is above the tool diskitems: 0–16 · example: ["claude-code"] |
Responses
| Status | Body | Error codes |
|---|---|---|
201 Created | { data: Machine, meta } | — |
400 Invalid request | ApiError | VALIDATIONRESERVED_ENV_KEYCONFLICTING_SOURCEIDLE_TIMEOUT_OUT_OF_RANGETOOLS_WITH_SNAPSHOTTOOLS_DISK_BUDGETDESKTOP_SIZE_TOO_SMALL |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
402 Package limit | ApiError | PLAN_UPGRADE_REQUIREDPLAN_LIMIT_MACHINESPLAN_LIMIT_SIZE |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDACCOUNT_SUSPENDEDACCOUNT_INACTIVEAUTO_PAUSE_REQUIREDINSUFFICIENT_SCOPENEW_ACCOUNT_LIMIT |
404 Not found | ApiError | SNAPSHOT_NOT_FOUNDTEMPLATE_NOT_FOUND |
409 Conflict | ApiError | NAME_TAKENSNAPSHOT_NOT_READY |
429 Too many requests | ApiError | RATE_LIMITED |
503 Service temporarily unavailable | ApiError | ENCRYPTION_UNAVAILABLE |
Pause machines in bulk
POST /v1/sandboxes/bulk/pause
Pauses up to 50 machines. The result is returned per ID; a machine that is already paused counts as a success.
Scope required for a scoped key: machines:manage
Request body (JSON, BulkSandboxDto)
| Field | Type | Required | Description |
|---|---|---|---|
ids | string[] | Yes | items: 1–50 · example: ["sbx_1","sbx_2"] |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: BulkResult, meta } | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
429 Too many requests | ApiError | RATE_LIMITED |
Resume machines in bulk
POST /v1/sandboxes/bulk/resume
Resumes up to 50 machines. The result is returned per ID; a machine that is already running counts as a success.
Scope required for a scoped key: machines:manage
Request body (JSON, BulkSandboxDto)
| Field | Type | Required | Description |
|---|---|---|---|
ids | string[] | Yes | items: 1–50 · example: ["sbx_1","sbx_2"] |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: BulkResult, meta } | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
429 Too many requests | ApiError | RATE_LIMITED |
Get a machine
GET /v1/sandboxes/{id}
Returns a machine by its ID. Only the names of the environment variables (envKeys) are returned, never their values.
Scope required for a scoped key: machines:read
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: MachineDetail, meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SANDBOX_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Machine auto-pause settings
PATCH /v1/sandboxes/{id}
Updates the idle time (idleTimeoutMinutes) and automatic pausing (autoPause).
Scope required for a scoped key: machines:manage
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Request body (JSON, UpdateSandboxSettingsDto)
| Field | Type | Required | Description |
|---|---|---|---|
autoPause | boolean | No | false = never auto-pause when idle (package autoPauseOptional; beta package: 403 AUTO_PAUSE_REQUIRED)example: true |
idleTimeoutMinutes | number | No | Idle minutes before auto-pause; 5..package idleTimeoutMinutes (beta package 15)value: 5–1440 · example: 10 |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: Machine, meta } | — |
400 Invalid request | ApiError | VALIDATIONIDLE_TIMEOUT_OUT_OF_RANGE |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDAUTO_PAUSE_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SANDBOX_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Delete a machine
POST /v1/sandboxes/{id}/destroy
Deletes the machine (soft delete). Environment variables and secret links are deleted permanently.
Scope required for a scoped key: machines:delete
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
201 Created | { data: Machine, meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SANDBOX_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Run a command in a machine
POST /v1/sandboxes/{id}/exec
Starts the command and returns an executionId and a pid. Stream the output with a separate request.
Scope required for a scoped key: machines:exec
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter |
Request body (JSON, ExecDaemonDto)
| Field | Type | Required | Description |
|---|---|---|---|
command | string | Yes | length: 0–4000 · example: "ls -la" |
timeoutMs | number | No | value: 1–3600000 · example: 30000 |
Responses
| Status | Body | Error codes |
|---|---|---|
201 Created | { data: ExecStarted, meta } | — |
400 Invalid request | ApiError | VALIDATIONCOMMAND_BLOCKED |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
429 Too many requests | ApiError | SANDBOX_HOST_BUSYRATE_LIMITED |
Stop a command
POST /v1/sandboxes/{id}/executions/{executionId}/cancel
Stops a running command in the machine (its process group is terminated). If the command has already finished, it returns cancelled: false.
Scope required for a scoped key: machines:exec
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter |
executionId | string | Yes | path parameter |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: CancelExecution, meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | — |
429 Too many requests | ApiError | RATE_LIMITED |
Stream command output
GET /v1/sandboxes/{id}/executions/{executionId}/output
Streams the output of an execution as Server-Sent Events: stdout, stderr, exit and error events. By default line breaks inside the data are escaped as \n; if the request adds the X-Sse-Data-Encoding: json header, every data line is a JSON string that decodes one to one.
Scope required for a scoped key: machines:exec
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter |
executionId | string | Yes | path parameter |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | text/event-stream | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | — |
429 Too many requests | ApiError | RATE_LIMITED |
Read a file
GET /v1/sandboxes/{id}/files
Reads a file of the machine. The path is relative to the workspace; it cannot leave the workspace.
Scope required for a scoped key: machines:exec
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter |
path | string | Yes | query parameter · length: 1–500 · example: "workspace/agent/main.py" |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: ReadFile, meta } | — |
400 Invalid request | ApiError | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | — |
429 Too many requests | ApiError | RATE_LIMITED |
Write a file
PUT /v1/sandboxes/{id}/files
Writes to a file of the machine. The path is relative to the workspace; it cannot leave the workspace.
Scope required for a scoped key: machines:exec
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter |
path | string | Yes | query parameter · length: 1–500 · example: "workspace/agent/main.py" |
Request body (JSON, WriteFileDto)
| Field | Type | Required | Description |
|---|---|---|---|
content | string | Yes | length: 0–1048576 · example: "# hello\nprint(\"hi\")\n" |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: WriteFile, meta } | — |
400 Invalid request | ApiError | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
429 Too many requests | ApiError | RATE_LIMITED |
Download a file (raw)
GET /v1/sandboxes/{id}/files/raw
Downloads a file of the machine as it is (application/octet-stream), streamed; up to 100 MiB, or 8 MiB on hosts that are not upgraded yet. The path is relative to /workspace; the machine must be running.
Scope required for a scoped key: machines:exec
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter |
path | string | Yes | query parameter · length: 1–500 · example: "workspace/agent/main.py" |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | application/octet-stream | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | — |
409 Conflict | ApiError | INVALID_STATE |
413 | ApiError | — |
429 Too many requests | ApiError | RATE_LIMITED |
Upload a file (raw)
PUT /v1/sandboxes/{id}/files/raw
Writes the bytes of the body (application/octet-stream) to a file of the machine, streamed; up to 100 MiB with Content-Length, or 8 MiB for chunked bodies and hosts that are not upgraded yet. Parent directories are created and the file is replaced in one step. The machine must be running.
Scope required for a scoped key: machines:exec
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter |
path | string | Yes | query parameter · length: 1–500 · example: "workspace/agent/main.py" |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: WriteFile, meta } | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
409 Conflict | ApiError | INVALID_STATE |
413 | ApiError | — |
415 | ApiError | — |
429 Too many requests | ApiError | RATE_LIMITED |
Pause a machine
POST /v1/sandboxes/{id}/pause
Pauses a running machine.
Scope required for a scoped key: machines:manage
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
201 Created | { data: Machine, meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SANDBOX_NOT_FOUND |
409 Conflict | ApiError | INVALID_STATE |
429 Too many requests | ApiError | RATE_LIMITED |
Resume a machine
POST /v1/sandboxes/{id}/resume
Starts a paused machine again.
Scope required for a scoped key: machines:manage
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
201 Created | { data: Machine, meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPENEW_ACCOUNT_LIMIT |
404 Not found | ApiError | SANDBOX_NOT_FOUND |
409 Conflict | ApiError | INVALID_STATE |
429 Too many requests | ApiError | RATE_LIMITED |
List background services
GET /v1/sandboxes/{id}/services
Returns the machine's background services with their state (pending, starting, running, backoff, crashloop, stopped, failed, unsupported), ordered by name. While the machine is not running the state reads pending.
Scope required for a scoped key: machines:read
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: MachineService[], meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SANDBOX_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Add a background service
POST /v1/sandboxes/{id}/services
Adds a named command that runs on the machine without an open terminal (bash -lc, as the machine user). It starts within seconds when the machine runs, otherwise when it next runs. A service does not keep the machine awake. The number of services per machine depends on the package limit. Do not put secrets in the command; read them from a file in /workspace.
Scope required for a scoped key: machines:exec
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Request body (JSON, CreateMachineServiceDto)
| Field | Type | Required | Description |
|---|---|---|---|
command | string | Yes | Shell command, run with `bash -lc` as the machine user (1-4096 bytes, no NUL). Never put secrets in it: read them from a file in /workspace instead (e.g. `set -a; . /workspace/.env; set +a; opencode serve`).example: "opencode serve --port 4096" |
cwd | string | No | Working directory: absolute, at most 256 bytes, no ".." segmentdefault: "/workspace" · example: "/workspace" |
enabled | boolean | No | false = defined but stopped (POST .../start runs it)default: true |
name | string | Yes | Unique per machine: lower-case letter, then up to 31 lower-case letters, digits or `-`pattern: ^[a-z][a-z0-9-]{0,31}$ · example: "opencode" |
restart | "always" | "on-failure" | No | always = restart whenever it exits; on-failure = not after a clean exit (code 0)default: "always" |
Responses
| Status | Body | Error codes |
|---|---|---|
201 Created | { data: MachineService, meta } | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
402 Package limit | ApiError | PLAN_LIMIT_SERVICES |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SANDBOX_NOT_FOUND |
409 Conflict | ApiError | SERVICE_NAME_TAKEN |
429 Too many requests | ApiError | RATE_LIMITED |
Change a service
PATCH /v1/sandboxes/{id}/services/{name}
Changes the command, working directory or restart policy of a service; the service restarts with the new definition. The name cannot change.
Scope required for a scoped key: machines:exec
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
name | string | Yes | path parameter · pattern: ^[a-z][a-z0-9-]{0,31}$ · example: "opencode" |
Request body (JSON, UpdateMachineServiceDto)
| Field | Type | Required | Description |
|---|---|---|---|
command | string | No | Shell command, run with `bash -lc` as the machine user (1-4096 bytes, no NUL). Never put secrets in it: read them from a file in /workspace instead (e.g. `set -a; . /workspace/.env; set +a; opencode serve`).example: "opencode serve --port 4096" |
cwd | string | No | Working directory (absolute, no "..")example: "/workspace" |
restart | "always" | "on-failure" | No |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: MachineService, meta } | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SANDBOX_NOT_FOUNDSERVICE_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Delete a service
DELETE /v1/sandboxes/{id}/services/{name}
Stops the service on the machine and removes its definition; the name can be used again.
Scope required for a scoped key: machines:manage
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
name | string | Yes | path parameter · pattern: ^[a-z][a-z0-9-]{0,31}$ · example: "opencode" |
Responses
| Status | Body | Error codes |
|---|---|---|
204 No content | — | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SANDBOX_NOT_FOUNDSERVICE_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Get service logs
GET /v1/sandboxes/{id}/services/{name}/logs
Returns the last output of a service (stdout and stderr, tail bytes, default 65536). Output is kept only in the machine memory (last 256 KiB per service); the API never stores it.
Scope required for a scoped key: machines:exec
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
name | string | Yes | path parameter · pattern: ^[a-z][a-z0-9-]{0,31}$ · example: "opencode" |
tail | number | No | Last N bytes of output to returnquery parameter · default: 65536 · value: 1–262144 |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: MachineServiceLogs, meta } | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SANDBOX_NOT_FOUNDSERVICE_NOT_FOUND |
409 Conflict | ApiError | INVALID_STATESERVICES_UNSUPPORTED |
429 Too many requests | ApiError | RATE_LIMITED |
503 Service temporarily unavailable | ApiError | SANDBOX_HOST_UNAVAILABLE |
Restart a service
POST /v1/sandboxes/{id}/services/{name}/restart
Restarts a running service now. The machine must be running; start a stopped service first.
Scope required for a scoped key: machines:exec
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
name | string | Yes | path parameter · pattern: ^[a-z][a-z0-9-]{0,31}$ · example: "opencode" |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: MachineService, meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SANDBOX_NOT_FOUNDSERVICE_NOT_FOUND |
409 Conflict | ApiError | INVALID_STATESERVICES_UNSUPPORTEDSERVICE_DISABLED |
429 Too many requests | ApiError | RATE_LIMITED |
503 Service temporarily unavailable | ApiError | SANDBOX_HOST_UNAVAILABLE |
Start a service
POST /v1/sandboxes/{id}/services/{name}/start
Starts a stopped service (enabled = true). Does nothing when nothing changes.
Scope required for a scoped key: machines:exec
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
name | string | Yes | path parameter · pattern: ^[a-z][a-z0-9-]{0,31}$ · example: "opencode" |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: MachineService, meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SANDBOX_NOT_FOUNDSERVICE_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Stop a service
POST /v1/sandboxes/{id}/services/{name}/stop
Stops a service and keeps its definition (enabled = false). Does nothing when nothing changes.
Scope required for a scoped key: machines:manage
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
name | string | Yes | path parameter · pattern: ^[a-z][a-z0-9-]{0,31}$ · example: "opencode" |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: MachineService, meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SANDBOX_NOT_FOUNDSERVICE_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Stop a machine
POST /v1/sandboxes/{id}/stop
Stops a running or paused machine.
Scope required for a scoped key: machines:manage
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
201 Created | { data: Machine, meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SANDBOX_NOT_FOUND |
409 Conflict | ApiError | INVALID_STATE |
429 Too many requests | ApiError | RATE_LIMITED |
List a machine's tools
GET /v1/sandboxes/{id}/tools
Returns the tools selected for the machine and their install states (pending, installing, ready, failed).
Scope required for a scoped key: machines:read
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: MachineTool[], meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SANDBOX_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Add tools to a machine
POST /v1/sandboxes/{id}/tools
Adds tools from the catalogue to a running machine. Required tools (for example Node.js) are added automatically and the install continues in the background. Tools that are already on the machine are left unchanged.
Scope required for a scoped key: machines:manage
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Request body (JSON, AddMachineToolsDto)
| Field | Type | Required | Description |
|---|---|---|---|
tools | "node" | "python" | "go" | "rust" | "docker" | "claude-code" | "codex" | "gemini-cli" | "copilot-cli" | "aider" | "opencode"[] | Yes | Unique catalogue tool ids (status ga); `requires` are added automatically; already added tools are kept as they areitems: 1–16 · example: ["codex"] |
Responses
| Status | Body | Error codes |
|---|---|---|
202 Accepted (asynchronous) | { data: MachineTool[], meta } | — |
400 Invalid request | ApiError | VALIDATIONTOOLS_DISK_BUDGET |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SANDBOX_NOT_FOUND |
409 Conflict | ApiError | INVALID_STATE |
429 Too many requests | ApiError | RATE_LIMITED |
Retry a tool install
POST /v1/sandboxes/{id}/tools/{toolId}/retry
Queues a tool whose install failed again.
Scope required for a scoped key: machines:manage
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
toolId | string | Yes | path parameter · pattern: ^[a-z0-9][a-z0-9-]{0,63}$ · example: "claude-code" |
Responses
| Status | Body | Error codes |
|---|---|---|
202 Accepted (asynchronous) | { data: MachineTool, meta } | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SANDBOX_NOT_FOUNDTOOL_NOT_FOUND |
409 Conflict | ApiError | INVALID_STATETOOL_NOT_RETRYABLE |
429 Too many requests | ApiError | RATE_LIMITED |
Machine spending
GET /v1/sandboxes/{id}/usage
Returns the machine’s compute spend this month, its hourly rate, the approximate cost of the open run and the machine’s own budget.
Scope required for a scoped key: machines:read
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: MachineUsage, meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SANDBOX_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Preview ports
List preview ports
GET /v1/sandboxes/{id}/ports
Returns the machine's open preview ports, oldest first. The url field is the preview address.
Scope required for a scoped key: machines:read
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: ExposedPort[], meta } | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SANDBOX_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Open a port (preview address)
POST /v1/sandboxes/{id}/ports
Opens a TCP port of the machine at an address of the form https://<port>-<random>.hbox.tr. Access is private by default: only organization members can open the address. Reserved ports (52, 5900-5999, 6080, 8052) cannot be opened; the number of open ports depends on the package limit.
Scope required for a scoped key: machines:manage
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Request body (JSON, ExposePortDto)
| Field | Type | Required | Description |
|---|---|---|---|
access | "private" | "public" | No | private: preview cookie or token required. public: not available yet (preview links are private only)default: "private" |
autoWake | boolean | No | A request to a paused machine wakes itdefault: true |
label | string | No | length: 0–60 · example: "vite dev server" |
port | number | Yes | Guest TCP port (not 52, 5900-5999, 6080, 8052)value: 1–65535 · example: 3000 |
Responses
| Status | Body | Error codes |
|---|---|---|
201 Created | { data: ExposedPort, meta } | — |
400 Invalid request | ApiError | VALIDATIONPORT_RESERVED |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
402 Package limit | ApiError | PLAN_UPGRADE_REQUIREDPLAN_LIMIT_PORTS |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPEFEATURE_NOT_AVAILABLE |
404 Not found | ApiError | SANDBOX_NOT_FOUND |
409 Conflict | ApiError | PORT_ALREADY_EXPOSED |
429 Too many requests | ApiError | RATE_LIMITED |
Get a preview port
GET /v1/sandboxes/{id}/ports/{portId}
Returns one preview port of the machine by its ID.
Scope required for a scoped key: machines:read
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
portId | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ · example: "prt_0f8e6c1a-2b3c-4d5e-8f90-123456789abc" |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: ExposedPort, meta } | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | PORT_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Close a port
DELETE /v1/sandboxes/{id}/ports/{portId}
Closes a preview port. The address stops working at once and is never reused; opening the same port again produces a new address.
Scope required for a scoped key: machines:manage
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
portId | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ · example: "prt_0f8e6c1a-2b3c-4d5e-8f90-123456789abc" |
Responses
| Status | Body | Error codes |
|---|---|---|
204 No content | — | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | PORT_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Create a preview access token
POST /v1/sandboxes/{id}/ports/{portId}/tokens
Creates a time-limited access token for a private preview port. Send the token in the X-Hadronbox-Preview-Token header of your requests. The lifetime is between 60 seconds and 24 hours (default 1 hour); when requested with an API key it cannot go past the key's expiry date. No token is issued for blocked ports.
Scope required for a scoped key: machines:manage
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
portId | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ · example: "prt_0f8e6c1a-2b3c-4d5e-8f90-123456789abc" |
Request body (JSON, IssuePreviewTokenDto)
| Field | Type | Required | Description |
|---|---|---|---|
ttlSeconds | number | No | Token lifetime in seconds; capped at the calling API key expirydefault: 3600 · value: 60–86400 |
Responses
| Status | Body | Error codes |
|---|---|---|
201 Created | { data: PreviewToken, meta } | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDACCOUNT_SUSPENDEDACCOUNT_INACTIVEINSUFFICIENT_SCOPEPREVIEW_BLOCKED |
404 Not found | ApiError | PORT_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
503 Service temporarily unavailable | ApiError | EDGE_UNAVAILABLE |
Revoke a preview access token
DELETE /v1/sandboxes/{id}/ports/{portId}/tokens/{jti}
Revokes a preview access token by its ID (jti); it stops working within 35 seconds at the latest. An unknown jti also returns 204.
Scope required for a scoped key: machines:manage
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
portId | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ · example: "prt_0f8e6c1a-2b3c-4d5e-8f90-123456789abc" |
jti | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{22}$ · example: "Q2hhbmdlTWVQbGVhc2UxMg" |
Responses
| Status | Body | Error codes |
|---|---|---|
204 No content | — | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | PORT_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Terminal sessions
List terminal sessions
GET /v1/sandboxes/{id}/terminal-sessions
Returns the machine's terminal sessions in pages, newest first. Members see their own sessions; owners and admins see all of them. Keystrokes and output are never stored.
Scope required for a scoped key: machines:read
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
page | number | No | query parameter · default: 1 · value: 1–10000 |
limit | number | No | query parameter · default: 20 · value: 1–100 |
status | "pending" | "active" | "detached" | "ended" | No | query parameter |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: TerminalSession[], meta, pagination: Pagination } | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SANDBOX_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Open a terminal
POST /v1/sandboxes/{id}/terminal-sessions
Opens an interactive terminal session on the machine and returns a single-use ticket that is valid for 60 seconds. The ticket is sent only in the subprotocol header of the terminal connection (hb.term.v1, hb.tkt.<ticket>); it is never written to the address or to a log. A paused machine is woken first (status: waking). The number of concurrent sessions is limited by the package, and sessions per machine by 8.
Scope required for a scoped key: machines:exec
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Request body (JSON, CreateTerminalSessionDto)
| Field | Type | Required | Description |
|---|---|---|---|
clientKind | "cli" | "web" | "sdk" | No | default: "cli" |
cols | number | Yes | value: 1–1000 · example: 120 |
command | string | No | Command instead of the login shell (≤ 1024 bytes). May carry secrets: never logged; only argv0 is stored.length: 0–1024 · example: "npm run dev" |
rows | number | Yes | value: 1–1000 · example: 40 |
term | "xterm-256color" | "xterm" | "screen-256color" | "tmux-256color" | "vt100" | No | default: "xterm-256color" |
Responses
| Status | Body | Error codes |
|---|---|---|
201 Created | { data: TerminalTicket, meta } | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
402 Package limit | ApiError | PLAN_LIMIT_TERMINALS |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SANDBOX_NOT_FOUND |
409 Conflict | ApiError | INVALID_STATEMACHINE_OWNER_SUSPENDEDMACHINE_ABUSE_HOLD |
429 Too many requests | ApiError | RATE_LIMITEDTERMINAL_LIMIT_MACHINE |
503 Service temporarily unavailable | ApiError | EDGE_UNAVAILABLE |
Get a terminal session
GET /v1/terminal-sessions/{id}
Returns one terminal session by its ID: state, start and end time, end reason, exit code and byte counters.
Scope required for a scoped key: machines:read
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: TerminalSession, meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | TERMINAL_SESSION_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Close a terminal session
DELETE /v1/terminal-sessions/{id}
Ends the session; the connection closes within 35 seconds at the latest. The person who opened the session, or an owner or admin, can close it.
Scope required for a scoped key: machines:exec
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
204 No content | — | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | TERMINAL_SESSION_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
503 Service temporarily unavailable | ApiError | — |
Get a reconnect ticket
POST /v1/terminal-sessions/{id}/tickets
Returns a new single-use ticket to reconnect to a session you opened. If resume is true, the first frame must be RESUME. A ticket cannot be issued for someone else's session.
Scope required for a scoped key: machines:exec
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Request body (JSON, IssueTerminalTicketDto)
| Field | Type | Required | Description |
|---|---|---|---|
cols | number | No | default: 80 · value: 1–1000 · example: 120 |
rows | number | No | default: 24 · value: 1–1000 · example: 40 |
term | "xterm-256color" | "xterm" | "screen-256color" | "tmux-256color" | "vt100" | No | default: "xterm-256color" |
Responses
| Status | Body | Error codes |
|---|---|---|
201 Created | { data: TerminalTicket, meta } | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | TERMINAL_SESSION_NOT_FOUND |
409 Conflict | ApiError | INVALID_STATEMACHINE_OWNER_SUSPENDEDMACHINE_ABUSE_HOLD |
429 Too many requests | ApiError | RATE_LIMITEDTERMINAL_LIMIT_MACHINE |
503 Service temporarily unavailable | ApiError | EDGE_UNAVAILABLE |
Snapshots
List snapshots
GET /v1/snapshots
Returns the organization's snapshots in pages; supports search, a status filter and sorting. sizeBytes is a decimal string.
Scope required for a scoped key: snapshots:read
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
page | number | No | query parameter · default: 1 · value: 1–10000 |
limit | number | No | query parameter · default: 20 · value: 1–100 |
search | string | No | query parameter · length: 0–100 |
sortOrder | "asc" | "desc" | No | query parameter · default: "desc" |
status | "pending" | "creating" | "ready" | "failed" | No | query parameter |
sortBy | "name" | "createdAt" | No | query parameter · default: "createdAt" |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: Snapshot[], meta, pagination: Pagination } | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
429 Too many requests | ApiError | RATE_LIMITED |
Take a snapshot
POST /v1/snapshots
Takes a snapshot of a running or paused machine asynchronously. The response is in the pending state; when it is ready, the status becomes ready.
Scope required for a scoped key: snapshots:write
Request body (JSON, CreateSnapshotDto)
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | pattern: ^[a-z0-9][a-z0-9-]{1,39}$ · example: "bireysel" |
sandboxId | string | Yes | example: "sbx_0f8e6c1a-2b3c-4d5e-8f90-123456789abc" |
Responses
| Status | Body | Error codes |
|---|---|---|
202 Accepted (asynchronous) | { data: Snapshot, meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
402 Package limit | ApiError | PLAN_LIMIT_SNAPSHOTS |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SANDBOX_NOT_FOUND |
409 Conflict | ApiError | NAME_TAKENSANDBOX_NOT_SNAPSHOTTABLE |
429 Too many requests | ApiError | RATE_LIMITED |
503 Service temporarily unavailable | ApiError | SNAPSHOTS_UNAVAILABLE |
Delete a snapshot
DELETE /v1/snapshots/{id}
Deletes the snapshot. An owner, an admin or the user who created the snapshot can delete it.
Scope required for a scoped key: snapshots:write
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
204 No content | — | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERFORBIDDEN_ROLESESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SNAPSHOT_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Copy from a snapshot
POST /v1/snapshots/{id}/fanout
Opens 1 to 10 machines from a ready snapshot at once (name-1 … name-N). The machine limit, balance and spend budget are checked first; with allOrNothing on (the default) nothing is opened if they do not cover every machine, with it off as many as fit are opened and the rest come back in the failed list with a code. The response also carries the estimated hourly cost. An API key needs the machines:create scope.
Scope required for a scoped key: machines:create
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Request body (JSON, FanoutSnapshotDto)
| Field | Type | Required | Description |
|---|---|---|---|
allOrNothing | boolean | No | true: if the machine limit, the credit balance or the spend budget cannot cover all `count` machines, nothing is opened and the request fails (402). false: as many machines as fit are opened and the rest are listed in `failed`default: true |
count | number | Yes | How many machines to openvalue: 1–10 · example: 3 |
namePrefix | string | No | Machines are named `<namePrefix>-1` ... `<namePrefix>-N`; default: the snapshot namepattern: ^[a-z0-9][a-z0-9-]{0,34}$ · example: "deney" |
size | "small" | "medium" | "large" | No | Size of every machine; default: the snapshot default |
Responses
| Status | Body | Error codes |
|---|---|---|
201 Created | { data: SnapshotFanout, meta } | — |
400 Invalid request | ApiError | VALIDATIONDESKTOP_SIZE_TOO_SMALL |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
402 Package limit | ApiError | PLAN_LIMIT_MACHINESPLAN_LIMIT_SIZECREDIT_INSUFFICIENTBUDGET_EXCEEDED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SNAPSHOT_NOT_FOUND |
409 Conflict | ApiError | NAME_TAKENSNAPSHOT_NOT_READY |
429 Too many requests | ApiError | RATE_LIMITED |
Templates
List templates
GET /v1/templates
Returns the machine template catalogue. The locked field means the template is premium and the package does not allow premium templates.
Scope required for a scoped key: machines:read
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: Template[], meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
429 Too many requests | ApiError | RATE_LIMITED |
Usage
Usage summary
GET /v1/usage/summary
Returns machine and vCPU hours, the daily series (Europe/Istanbul days), the breakdown per machine and the package limits (used / limit / percent / state).
Scope required for a scoped key: account:read
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
range | "7d" | "14d" | "30d" | "period" | No | query parameter · default: "14d" |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: UsageSummary, meta } | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
429 Too many requests | ApiError | RATE_LIMITED |
Credits
Credit balance
GET /v1/credits
Returns the balance (in kuruş, VAT included), the state (ok / low / exhausted), the hourly spend rate, the estimated remaining minutes, the credit lots that expire within 14 days and whether the balance is enforced (enforced).
Scope required for a scoped key: account:read
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: Credit, meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
429 Too many requests | ApiError | RATE_LIMITED |
List spend budgets
GET /v1/credits/budgets
Returns the organization’s spend budgets with this month’s (Europe/Istanbul) spend, percentage and live state. Amounts are approximate; metering lags a few minutes.
Scope required for a scoped key: account:read
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: BudgetList, meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
429 Too many requests | ApiError | RATE_LIMITED |
Add a spend budget
POST /v1/credits/budgets
Sets a monthly TL limit for the organization (no sandboxId) or one machine. Defaults: warn at 80%, pause at 100%. Works independently of balance enforcement. Owners and admins only; an API key needs the budgets:write scope.
Scope required for a scoped key: budgets:write
Request body (JSON, CreateBudgetDto)
| Field | Type | Required | Description |
|---|---|---|---|
action | "warn" | "pause" | No | At 100 %: pause = pause running machines in scope (no automatic resume); warn = notice onlydefault: "pause" |
limitKurus | number | Yes | Monthly limit in kuruş, KDV dahil (1 TL = 100)value: 100–100000000 · example: 20000 |
sandboxId | string | No | Machine id for a machine budget; omit for the organization budgetpattern: ^[A-Za-z0-9_-]{1,64}$ |
warnPercent | number | No | Warning threshold (% of the limit)default: 80 · value: 1–99 |
Responses
| Status | Body | Error codes |
|---|---|---|
201 Created | { data: Budget, meta } | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERFORBIDDEN_ROLESESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SANDBOX_NOT_FOUND |
409 Conflict | ApiError | BUDGET_EXISTS |
429 Too many requests | ApiError | RATE_LIMITED |
Change a spend budget
PATCH /v1/credits/budgets/{id}
Changes the limit, the warning threshold or the action at the limit (pause / warn). Machines the budget paused do not resume on their own.
Scope required for a scoped key: budgets:write
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Request body (JSON, UpdateBudgetDto)
| Field | Type | Required | Description |
|---|---|---|---|
action | "warn" | "pause" | No | |
limitKurus | number | No | value: 100–100000000 |
warnPercent | number | No | value: 1–99 |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: Budget, meta } | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERFORBIDDEN_ROLESESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | BUDGET_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Remove a spend budget
DELETE /v1/credits/budgets/{id}
Removes the budget. Machines it paused do not resume on their own; you resume them.
Scope required for a scoped key: budgets:write
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
204 No content | — | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERFORBIDDEN_ROLESESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | BUDGET_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Credit ledger
GET /v1/credits/ledger
Returns the credit movements newest first, paged with a cursor. Hourly usage rows are folded into one row per Europe/Istanbul day; filter by type and date range.
Scope required for a scoped key: account:read
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
cursor | string | No | nextCursor of the previous page (opaque)query parameter · length: 0–400 |
limit | number | No | query parameter · default: 50 · value: 1–100 |
type | "grant" | "usage" | "adjustment" | "expiry" | "refund" | "reversal" | No | query parameter |
from | string | No | Inclusive start (ISO 8601 with a zone, or YYYY-MM-DD)query parameter |
to | string | No | Exclusive end (ISO 8601 with a zone, or YYYY-MM-DD)query parameter |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: CreditLedgerPage, meta } | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
429 Too many requests | ApiError | RATE_LIMITED |
Credit packages
GET /v1/credits/packages
Returns the active credit packages in order: price, credit amount, validity in days and whether they can be purchased. Paid packages are monthly; every monthly payment resets the paid balance to the package amount.
Scope required for a scoped key: account:read
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: CreditPackage[], meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
429 Too many requests | ApiError | RATE_LIMITED |
Credit spend
GET /v1/credits/usage
Returns the spend breakdown from the usage accruals (compute and storage) per day or per machine / disk / snapshot: kuruş, minutes and GiB-hours.
Scope required for a scoped key: account:read
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
from | string | No | First Istanbul day (YYYY-MM-DD)query parameter · example: "2026-11-01" |
to | string | No | Last Istanbul day, inclusive (YYYY-MM-DD)query parameter · example: "2026-11-29" |
groupBy | "day" | "machine" | No | query parameter · default: "day" |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: CreditUsage, meta } | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
429 Too many requests | ApiError | RATE_LIMITED |
Scheduled jobs
Scheduled jobs of a machine
GET /v1/sandboxes/{id}/schedules
Returns the scheduled jobs of the machine: name, cron, command, next run, last status, disable reason and trigger URL.
Scope required for a scoped key: machines:read
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: Schedule[], meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SANDBOX_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Add a scheduled job
POST /v1/sandboxes/{id}/schedules
Defines a command that runs on the machine by a cron expression (Europe/Istanbul, shortest interval 15 minutes). The command is written to a script file and run with sh; secrets arrive as for exec. At most 5 jobs per organization; closed during the first 7 days of a new organization. Owners and admins only; an API key needs the schedules:write scope.
Scope required for a scoped key: schedules:write
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Request body (JSON, CreateScheduleDto)
| Field | Type | Required | Description |
|---|---|---|---|
command | string | Yes | Shell commands, written to a script file and run with `sh` in the workspace; secrets are injected as for `exec`length: 0–2000 · example: "cd /workspace/app && npm run backup" |
cron | string | Yes | 5-field cron (minute hour day month weekday), read in Europe/Istanbul; shortest interval 15 minuteslength: 0–120 · example: "0 3 * * *" |
name | string | Yes | length: 0–80 · example: "Nightly backup" |
timeoutMinutes | number | No | Exec timeout of one run in minutes (at most 60)default: 30 · value: 1–60 |
Responses
| Status | Body | Error codes |
|---|---|---|
201 Created | { data: Schedule, meta } | — |
400 Invalid request | ApiError | VALIDATIONSCHEDULE_CRON_INVALID |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERFORBIDDEN_ROLESESSION_REQUIREDINSUFFICIENT_SCOPESCHEDULE_NEW_ORGANIZATION |
404 Not found | ApiError | SANDBOX_NOT_FOUND |
409 Conflict | ApiError | SCHEDULE_LIMIT |
429 Too many requests | ApiError | RATE_LIMITED |
Get a scheduled job
GET /v1/schedules/{id}
Returns one scheduled job.
Scope required for a scoped key: machines:read
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: Schedule, meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SCHEDULE_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Change a scheduled job
PATCH /v1/schedules/{id}
Changes name, cron, command, timeout or enabled. enabled: true clears the failure counter and the disable reason.
Scope required for a scoped key: schedules:write
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Request body (JSON, UpdateScheduleDto)
| Field | Type | Required | Description |
|---|---|---|---|
command | string | No | length: 0–2000 |
cron | string | No | length: 0–120 · example: "0 3 * * *" |
enabled | boolean | No | |
name | string | No | length: 0–80 |
timeoutMinutes | number | No | value: 1–60 |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: Schedule, meta } | — |
400 Invalid request | ApiError | VALIDATIONSCHEDULE_CRON_INVALID |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERFORBIDDEN_ROLESESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SCHEDULE_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Delete a scheduled job
DELETE /v1/schedules/{id}
Deletes the job; a run in progress finishes with its own result, no new one starts.
Scope required for a scoped key: schedules:write
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
204 No content | — | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERFORBIDDEN_ROLESESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SCHEDULE_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Run the job now
POST /v1/schedules/{id}/run
Starts the job at once (also when disabled). The run record returns immediately; follow the result in the run history. When a previous run is still going the record is skipped.
Scope required for a scoped key: schedules:write
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
201 Created | { data: ScheduleRun, meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERFORBIDDEN_ROLESESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SCHEDULE_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Run history
GET /v1/schedules/{id}/runs
Returns the last 50 runs of the job, newest first: status, exit code, duration and the last 4 KB of output (known secret values are replaced by ***).
Scope required for a scoped key: machines:read
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: ScheduleRun[], meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SCHEDULE_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Create or rotate the trigger token
POST /v1/schedules/{id}/trigger-token
Creates the token for POST /v1/triggers/{id}. The raw token is in this answer only, only its hash is stored; rotating invalidates the previous one at once.
Scope required for a scoped key: schedules:write
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
201 Created | { data: TriggerToken, meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERFORBIDDEN_ROLESESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | SCHEDULE_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Persistent disk
Show the persistent disk
GET /v1/workspace
Returns the size of your persistent /workspace disk, a pending grow, the sizes your plan allows (20, 50, 100 GB) and the monthly price per GB above 20 GB (kurus; 0 = free). Without a disk, exists is false.
Scope required for a scoped key: machines:read
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: WorkspaceSizeSchema, meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
429 Too many requests | ApiError | RATE_LIMITED |
Make the persistent disk larger
PUT /v1/workspace/size
Sets the persistent disk to 20, 50 or 100 GB; it only grows and the data is kept. Without a disk, it is created with this size and your first machine uses it. Otherwise the new size is applied at the next cold boot of the disk (a new machine after the current one is deleted, or a restart of the machine); pause and resume keep the size. Sending the current size cancels a pending grow.
Scope required for a scoped key: machines:manage
Request body (JSON, UpdateWorkspaceSizeDto)
| Field | Type | Required | Description |
|---|---|---|---|
sizeGib | 20 | 50 | 100 | Yes | New size of your persistent /workspace disk in GB (GiB). Grow only; the plan decides the largest size (free: 20). Without a disk yet, it is created with this size and your first machine boots with itexample: 50 |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: WorkspaceSizeSchema, meta } | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
402 Package limit | ApiError | CREDIT_INSUFFICIENTWORKSPACE_SIZE_NOT_ALLOWED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
409 Conflict | ApiError | WORKSPACE_SHRINK_REFUSEDWORKSPACE_GROW_UNAVAILABLE |
429 Too many requests | ApiError | RATE_LIMITED |
Agents
List comparisons
GET /v1/agent-run-groups
Returns the organization’s agent comparisons newest first, paginated, each with a summary of its runs. An API key needs the agent_runs:read scope.
Scope required for a scoped key: agent_runs:read
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
page | number | No | query parameter · default: 1 · value: 1–… |
limit | number | No | query parameter · default: 20 · value: 1–50 |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: AgentRunGroup[], meta, pagination: Pagination } | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | AGENT_RUNS_DISABLED |
429 Too many requests | ApiError | RATE_LIMITED |
Compare agents
POST /v1/agent-run-groups
Runs the same repository and task with 2 to 4 different agents: one run and one machine per agent. The machine limit, balance and spend budget are checked for the whole group first; if they do not cover it nothing starts and nothing is queued (the beta package allows 2 machines at a time). Answers 202 with the queued group at once. An API key needs the agent_runs:write scope.
Scope required for a scoped key: agent_runs:write
Request body (JSON, CreateAgentRunGroupDto)
| Field | Type | Required | Description |
|---|---|---|---|
agents | "claude-code" | "codex" | "gemini-cli" | "aider" | "opencode"[] | Yes | The agents to compare: one run (one fresh machine) per agent, same repository and task. Unique; every machine counts against the plan machine limit at the same time (no queueing)items: 2–4 · example: ["claude-code","codex"] |
branch | string | No | Branch to clone; the default branch when omittedlength: 0–200 · example: "main" |
destroyOnFinish | boolean | No | Delete the machine when the run ends (default: pause it)default: false |
name | string | No | length: 0–100 · example: "Date parsing fix" |
repoUrl | string | Yes | Public repository over https on github.com, gitlab.com or bitbucket.org; no user name, password, port or query (400 REPO_URL_INVALID). Private repositories come with the GitHub integration.length: 0–300 · example: "https://github.com/acme/web" |
secrets | string[] | No | NAMES of the organization secrets the agent needs (its API key). Values never travel in this API. A secret of scope "selected" is linked to this run's machine only; secrets of scope "all" are in every machine of the organization anyway. Use a separate, limited key: the agent (and any code in the repository) can read it.items: 0–10 · example: ["ANTHROPIC_API_KEY"] |
size | "small" | "medium" | "large" | No | default: "small" |
task | string | Yes | What the agent should do. Written to a file in the machine, never put on a command line.length: 0–8000 · example: "Fix the failing date parsing test and explain the cause in a comment." |
timeoutMinutes | number | No | Limit of the agent step (clone and agent) in minutes; the run ends timed_out when it is exceededdefault: 30 · value: 1–60 |
Responses
| Status | Body | Error codes |
|---|---|---|
202 Accepted (asynchronous) | { data: AgentRunGroup, meta } | — |
400 Invalid request | ApiError | VALIDATIONREPO_URL_INVALIDAGENT_RUN_SECRET_NOT_FOUND |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
402 Package limit | ApiError | PLAN_LIMIT_MACHINESPLAN_LIMIT_SIZECREDIT_INSUFFICIENTBUDGET_EXCEEDED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | AGENT_RUNS_DISABLED |
409 Conflict | ApiError | AGENT_RUN_LIMIT |
429 Too many requests | ApiError | RATE_LIMITED |
Get a comparison
GET /v1/agent-run-groups/{id}
Returns the runs of a comparison side by side: agent, status, duration, estimated cost, exit code, changed files and diff summary.
Scope required for a scoped key: agent_runs:read
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: AgentRunGroup, meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | AGENT_RUNS_DISABLEDAGENT_RUN_GROUP_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Cancel a comparison
POST /v1/agent-run-groups/{id}/cancel
Cancels every unfinished run of the group; finished runs stay as they are. Answers 409 when all of them have ended.
Scope required for a scoped key: agent_runs:write
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
202 Accepted (asynchronous) | { data: AgentRunGroup, meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | AGENT_RUNS_DISABLEDAGENT_RUN_GROUP_NOT_FOUND |
409 Conflict | ApiError | AGENT_RUN_NOT_CANCELLABLE |
429 Too many requests | ApiError | RATE_LIMITED |
List agent runs
GET /v1/agent-runs
Returns the organization’s agent runs, newest first and paginated; filter by status and agent. An API key needs the agent_runs:read scope.
Scope required for a scoped key: agent_runs:read
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
page | number | No | query parameter · default: 1 · value: 1–… |
limit | number | No | query parameter · default: 20 · value: 1–50 |
status | "queued" | "provisioning" | "installing" | "cloning" | "running" | "succeeded" | "failed" | "timed_out" | "cancelled" | No | query parameter |
agent | "claude-code" | "codex" | "gemini-cli" | "aider" | "opencode" | No | query parameter |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: AgentRun[], meta, pagination: Pagination } | — |
400 Invalid request | ApiError | VALIDATION |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | AGENT_RUNS_DISABLED |
429 Too many requests | ApiError | RATE_LIMITED |
Run an agent
POST /v1/agent-runs
Starts the AI agent you chose on a clean machine: it clones a public repository, does the task headless and leaves the result (exit code, changed files, change summary). Answers 202 with the queued run at once. The agent’s key is given by secret name only; the value never travels through this API. An API key needs the agent_runs:write scope.
Scope required for a scoped key: agent_runs:write
Request body (JSON, CreateAgentRunDto)
| Field | Type | Required | Description |
|---|---|---|---|
agent | "claude-code" | "codex" | "gemini-cli" | "aider" | "opencode" | Yes | example: "claude-code" |
branch | string | No | Branch to clone; the default branch when omittedlength: 0–200 · example: "main" |
destroyOnFinish | boolean | No | Delete the machine when the run ends (default: pause it)default: false |
repoUrl | string | Yes | Public repository over https on github.com, gitlab.com or bitbucket.org; no user name, password, port or query (400 REPO_URL_INVALID). Private repositories come with the GitHub integration.length: 0–300 · example: "https://github.com/acme/web" |
secrets | string[] | No | NAMES of the organization secrets the agent needs (its API key). Values never travel in this API. A secret of scope "selected" is linked to this run's machine only; secrets of scope "all" are in every machine of the organization anyway. Use a separate, limited key: the agent (and any code in the repository) can read it.items: 0–10 · example: ["ANTHROPIC_API_KEY"] |
size | "small" | "medium" | "large" | No | default: "small" |
task | string | Yes | What the agent should do. Written to a file in the machine, never put on a command line.length: 0–8000 · example: "Fix the failing date parsing test and explain the cause in a comment." |
timeoutMinutes | number | No | Limit of the agent step (clone and agent) in minutes; the run ends timed_out when it is exceededdefault: 30 · value: 1–60 |
Responses
| Status | Body | Error codes |
|---|---|---|
202 Accepted (asynchronous) | { data: AgentRun, meta } | — |
400 Invalid request | ApiError | VALIDATIONREPO_URL_INVALIDAGENT_RUN_SECRET_NOT_FOUND |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
402 Package limit | ApiError | PLAN_LIMIT_SIZECREDIT_INSUFFICIENTBUDGET_EXCEEDED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | AGENT_RUNS_DISABLED |
409 Conflict | ApiError | AGENT_RUN_LIMIT |
429 Too many requests | ApiError | RATE_LIMITED |
Get an agent run
GET /v1/agent-runs/{id}
Returns a run’s status, its result (exit code, changed file count, change summary), the failure reason and, for a finished run, the last part of its output.
Scope required for a scoped key: agent_runs:read
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | { data: AgentRun, meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | AGENT_RUNS_DISABLEDAGENT_RUN_NOT_FOUND |
429 Too many requests | ApiError | RATE_LIMITED |
Cancel an agent run
POST /v1/agent-runs/{id}/cancel
Cancels an unfinished run: the agent’s command is stopped and the machine is paused (deleted with destroyOnFinish). A queued run is cancelled at once; a started one within seconds. A finished run answers 409.
Scope required for a scoped key: agent_runs:write
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
202 Accepted (asynchronous) | { data: AgentRun, meta } | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | AGENT_RUNS_DISABLEDAGENT_RUN_NOT_FOUND |
409 Conflict | ApiError | AGENT_RUN_NOT_CANCELLABLE |
429 Too many requests | ApiError | RATE_LIMITED |
Follow an agent’s output
GET /v1/agent-runs/{id}/output
Streams the run’s command output as Server-Sent Events (stdout, stderr, exit). Known secret values are masked as ***. A finished run answers its stored tail; 409 while the command has not started.
Scope required for a scoped key: agent_runs:read
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | path parameter · pattern: ^[A-Za-z0-9_-]{1,64}$ |
Responses
| Status | Body | Error codes |
|---|---|---|
200 Success | text/event-stream | — |
401 Not authenticated | ApiError | SESSION_INVALIDINVALID_API_KEYACCOUNT_SUSPENDEDACCOUNT_INACTIVEACCOUNT_DELETION_PENDINGUNAUTHENTICATED |
403 Forbidden | ApiError | EMAIL_NOT_VERIFIEDNOT_A_MEMBERSESSION_REQUIREDINSUFFICIENT_SCOPE |
404 Not found | ApiError | AGENT_RUNS_DISABLEDAGENT_RUN_NOT_FOUND |
409 Conflict | ApiError | INVALID_STATE |
429 Too many requests | ApiError | RATE_LIMITED |