---
title: REST API · Sandboxes docs
description: Every endpoint in the Sandboxes API, with its request, response and status codes.
url: https://www.quietrobot.ai/docs/sandboxes/api
---

# REST API

Every endpoint in the Sandboxes API, with its request, response and status codes.

> [!NOTE]
> Sandboxes is in early access. It is free to try, some parts are still in testing, and details may change.

**Base URL:** `https://www.quietrobot.ai/app/api/v1`

All requests need `Authorization: Bearer qr_live_…` (see [API keys](https://www.quietrobot.ai/docs/sandboxes/authentication)). Request and response bodies are JSON, except file contents, which are raw bytes. Times are ISO 8601 in UTC. Errors follow [one format](https://www.quietrobot.ai/docs/sandboxes/errors).

Endpoints marked *in testing* are built but not yet in the product.

## Sandboxes

### Create a sandbox

`POST /sandboxes` → `201` with the [sandbox](#the-sandbox-object)

Returns once the sandbox is running. All fields are optional.

```json
{
  "name": "nightly-tests",
  "template": "base",
  "cpuClass": "standard",
  "cpus": 2,
  "memoryMb": 4096,
  "timeoutSec": 1800,
  "region": "us-virginia",
  "egress": { "mode": "allowlist", "allow": ["pypi.org", "files.pythonhosted.org"] },
  "env": { "CI": "1" },
  "metadata": { "run": "1842" }
}
```

| Field | Default | |
|---|---|---|
| `name` | none | Up to 80 characters. |
| `template` | `base` | See [templates](https://www.quietrobot.ai/docs/sandboxes/sizes-and-regions#templates). |
| `cpuClass` | `standard` | `standard` or `performance` (Team plan). *In testing.* |
| `cpus` | 1 (2 for performance) | 1, 2, 4, 8 or 16, up to your plan's limit. |
| `memoryMb` | 1024 (4096 for performance) | Multiple of 256, in the [range for the class](https://www.quietrobot.ai/docs/sandboxes/sizes-and-regions#vcpus-and-memory). |
| `timeoutSec` | 600 | 10 to 86,400, up to your plan's limit. |
| `region` | we pick | A [region code](https://www.quietrobot.ai/docs/sandboxes/sizes-and-regions#regions). |
| `egress.mode` | `deny` | `deny`, `allowlist` or `open` (Team plan). |
| `egress.allow` | your org's default list | Rules for `allowlist`: domains, IP addresses or CIDR ranges, with an optional port. Up to 200. See [Outbound network](https://www.quietrobot.ai/docs/sandboxes/network#allow-and-block-rules). |
| `egress.deny` | none | Rules that are always blocked, in `allowlist` and `open` mode. *In testing.* |
| `egress.maxMode` | what the rules need | The widest mode the sandbox can be switched to later. *In testing.* |
| `env` | none | Variables set for every command. Names starting with `QR_` are ignored. |
| `metadata` | none | String labels of your own. |
| `snapshotId` | none | Start with a [snapshot's](https://www.quietrobot.ai/docs/sandboxes/snapshots) files. *In testing.* |
| `reservationId` | none | Run on a [reserved machine](https://www.quietrobot.ai/docs/sandboxes/sizes-and-regions#reserved-machines). *In testing.* |
| `pool` | `true` | `false` boots a fresh VM instead of taking a pre-started one. *In testing.* |
| `secrets` | none | Names of [secrets](https://www.quietrobot.ai/docs/sandboxes/secrets) the sandbox may use without holding them. Needs `allowlist` or `open`. *In testing.* |
| `identity.hosts` | none | Hosts the sandbox may prove itself to with `QR_IDENTITY_TOKEN`. *In testing.* |
| `autoPauseSec` | none | [Pause when idle](https://www.quietrobot.ai/docs/sandboxes/pause-and-resume#pause-when-idle) after this many seconds (60 to 86,400). *In testing.* |

### List sandboxes

`GET /sandboxes?status=running&limit=100` → `{ "sandboxes": [ … ] }`

Newest first. `status` is optional. `limit` defaults to 100, up to 500.

### Get a sandbox

`GET /sandboxes/{id}` → the sandbox

### Change the deadline

`POST /sandboxes/{id}/timeout` with `{ "timeoutSec": 1800 }` → the sandbox

Sets the deadline to now plus `timeoutSec`. The sandbox must be running.

### Change network rules

`PUT /sandboxes/{id}/egress` with any of `{ "mode", "allow", "deny" }` → the sandbox. *In testing.*

Fields you leave out stay as they are. A paused sandbox wakes first. `409 egress_too_wide` when the rules need more than the sandbox's `maxMode`. See [Outbound network](https://www.quietrobot.ai/docs/sandboxes/network#change-rules-while-a-sandbox-runs).

### Pause and resume

`POST /sandboxes/{id}/pause` → the sandbox, `status: "paused"`. *In testing.*

`POST /sandboxes/{id}/resume` → the sandbox, `status: "running"`. *In testing.*

See [Pause and resume](https://www.quietrobot.ai/docs/sandboxes/pause-and-resume).

### See the image

`GET /sandboxes/{id}/image` → `{ "name", "fingerprint", "packages": { "python3": "3.11.2-1+b1", … } }`. *In testing.*

### Destroy a sandbox

`DELETE /sandboxes/{id}` → the sandbox, `status: "stopped"`

### The sandbox object

```json
{
  "id": "sbx_7f3a9c2e1b4d6a",
  "name": "nightly-tests",
  "status": "running",
  "template": "base",
  "image": { "name": "base", "fingerprint": "…" },
  "region": "us-virginia",
  "cpuClass": "standard",
  "cpus": 2,
  "memoryMb": 4096,
  "egress": { "mode": "allowlist", "allow": ["pypi.org", "files.pythonhosted.org"] },
  "metadata": { "run": "1842" },
  "reservationId": null,
  "pausedAt": null,
  "fromSnapshotId": null,
  "warmStart": true,
  "error": null,
  "createdAt": "2026-11-29T17:40:02.118Z",
  "startedAt": "2026-11-29T17:40:02.904Z",
  "deadlineAt": "2026-11-29T18:10:02.904Z",
  "endedAt": null
}
```

| Field | |
|---|---|
| `status` | `starting`, `running`, `paused`, `stopped` or `error`. See [Lifecycle](https://www.quietrobot.ai/docs/sandboxes/lifecycle). |
| `startedAt` | When it was handed to you. Billing starts here. |
| `deadlineAt` | When it stops by itself. While paused, when it will be destroyed if not resumed. |
| `warmStart` | `true` when it came from a pre-started VM rather than booting one. |
| `error` | A plain explanation when `status` is `error`. |

## Commands

### Run a command

`POST /sandboxes/{id}/exec` → `200` with the [execution](#the-execution-object), or `202` when held for approval

```json
{ "cmd": "python3 main.py", "cwd": "/home/sandbox", "env": { "MODE": "test" }, "timeoutMs": 60000 }
```

Only `cmd` is required. See [Commands and files](https://www.quietrobot.ai/docs/sandboxes/commands-and-files#run-a-command).

### Get, list

`GET /executions/{id}` → the execution

`GET /sandboxes/{id}/executions?status=pending_approval` → `{ "executions": [ … ] }`, newest first

### Approve or deny

`POST /executions/{id}/approve` and `POST /executions/{id}/deny`, with an optional `{ "note": "…" }` → the execution

Dashboard sessions only. An API key gets `403 forbidden`. Approving runs the command and returns once it finishes.

### The execution object

```json
{
  "id": "exe_2b9d4f6a8c1e3b",
  "sandboxId": "sbx_7f3a9c2e1b4d6a",
  "status": "completed",
  "cmd": "python3 main.py",
  "cwd": null,
  "envKeys": ["MODE"],
  "exitCode": 0,
  "stdout": "hello from a quiet robot\n",
  "stderr": "",
  "durationMs": 41,
  "timedOut": false,
  "requestedBy": { "kind": "api_key", "id": "key_…", "label": "key ci-agent (qr_live_3f…)" },
  "approval": null,
  "createdAt": "2026-11-29T17:41:12.270Z",
  "finishedAt": "2026-11-29T17:41:12.311Z"
}
```

| Field | |
|---|---|
| `status` | `pending_approval`, `running`, `completed`, `denied` or `failed`. `completed` means it ran; check `exitCode`. |
| `stdout`, `stderr` | Up to 64 KB each. |
| `timedOut` | `true` if it was stopped at `timeoutMs`. |
| `envKeys` | The names of the variables sent. Values are never returned. |
| `approval` | When a rule held it: `{ reason, decidedBy, decidedAt, note }`. Otherwise `null`. |

## Files

| Request | Body | Response |
|---|---|---|
| `PUT /sandboxes/{id}/files?path=…` | Raw bytes | `{ "path", "bytes" }` |
| `GET /sandboxes/{id}/files?path=…` | | Raw bytes |
| `DELETE /sandboxes/{id}/files?path=…` | | `{ "path" }` |
| `GET /sandboxes/{id}/files/list?path=…` | | `{ "path", "entries": [{ "name", "path", "type", "size", "modified" }] }` |

The sandbox must be running. Relative paths are inside `/home/sandbox`.

## Snapshots *(in testing)*

| Request | Response |
|---|---|
| `POST /sandboxes/{id}/snapshots` with optional `{ "name" }` | `201` with the snapshot |
| `GET /sandboxes/{id}/snapshots` | `{ "snapshots": [ … ] }` taken from this sandbox |
| `GET /snapshots` | `{ "snapshots": [ … ] }` for your organization |
| `GET /snapshots/{id}` | The snapshot |
| `DELETE /snapshots/{id}` | The deleted snapshot |

A snapshot is `{ "id", "name", "status", "sizeBytes", "sourceSandboxId", "createdAt" }`, with `status` `creating` or `ready`.

## Audit log

`GET /audit?limit=100&before=1042&action=exec.run` → `{ "events": [ … ] }`

`GET /sandboxes/{id}/audit?limit=100&before=1042` → `{ "events": [ … ] }`

Newest first. `limit` up to 1,000. See [Audit log](https://www.quietrobot.ai/docs/sandboxes/audit) for the event list.

## Usage

`GET /usage` (this month) or `GET /usage?days=30` → your plan, vCPU-hours, GB-hours, outbound GB, compute and outbound charges, included usage, overage, reserved machines and a day-by-day breakdown.

## Reserved machines *(in testing)*

`GET /reservations` → `{ "reservations": [{ "id", "size", "name", "cpus", "memoryMb", "region", "term", "priceMonthly", "status", "inUseBy", "createdAt", "cancelledAt" }] }`

Reserved machines are added by Quiet Robot. There's no API to buy one.

## Secrets

See [Keys, identity and outbound check](https://www.quietrobot.ai/docs/sandboxes/secrets). *In testing.*

| Call | |
|---|---|
| `GET /secrets` | Names, hosts and last use. Values never come back. |
| `POST /secrets` | Add a secret, or replace one with the same name. Body: `name`, `value`, `hosts`. |
| `DELETE /secrets/:name` | Delete it. Its stand-ins stop working at once. |
| `GET /outbound-check` | Your outbound check's address. Set it on the dashboard's Policy page. |
| `GET /identity/jwks.json` | The public key for sandbox identity tokens. No API key needed. |
