> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# API reference

> The REST API behind the SDKs and the CLI.

Base URL: `https://api.compute.anonalabs.com`

Most users never call it directly: the E2B SDK, the Anona extras and the CLI do. Two groups of routes:

| Group | What | Source |
| - | - | - |
| [Sandboxes and templates](/docs/api-reference/sandboxes/create-sandbox-v2.md) | Create, list, get, delete (`kill` in the E2B SDK), pause, resume, connect, timeout, network update, template builds | The E2B OpenAPI spec (SDK 2.61.0), cut to the operations Anona serves |
| [Anona Compute](/docs/api-reference/live-view/mint-a-viewer-token.md) | Viewer tokens, SSH certificates, network policy, credential vault, usage and billing, API keys | Written from the gateway's handlers |

Both files are checked against a running gateway: every operation is called and each answer's status and body are validated against the spec.

## Authentication

Send your API key in the `X-API-Key` header, or as `Authorization: Bearer ac_…`:

```bash api_auth.sh
curl -sS https://api.compute.anonalabs.com/v2/sandboxes -H "X-API-Key: $ANONA_API_KEY"
curl -sS https://api.compute.anonalabs.com/v2/sandboxes -H "Authorization: Bearer $ANONA_API_KEY"
```

The `/v1/api-keys` routes accept only dashboard sessions; manage keys in the dashboard. Changing the team network settings and the credential vault needs an owner or admin session, or an [unrestricted API key](/docs/guides/ci.md#create-a-key-for-ci) (no scopes and no sandbox list). Other API keys can read them, unless they have a sandbox list.

## Errors

Errors have the E2B shape, so the SDKs raise their usual exceptions:

```json
{ "code": 429, "message": "concurrent sandbox limit reached (100): the Pro plan runs at most 100 sandboxes at once - pause or delete one, or upgrade the plan", "error_code": "plan_limit_exceeded", "limit_name": "concurrent_sandboxes", "limit": 100, "current": 100, "plan": "pro", "requestId": "3f2c9a0e7b1d4c55a8e6f0b2d4c6e8a1" }
```

`requestId` is also sent as the `X-Request-Id` header. Quote it when you report a problem. A refusal at a plan limit also says which limit (`limit_name`), the limit, what is in use now (`current`) and your plan; see [limits](/docs/concepts/limits.md).

| Status | Meaning |
| - | - |
| 400 | Invalid request, or a feature not supported (the message says which) |
| 401 | Missing, unknown, revoked or expired API key |
| 402 | The credit is spent (`error_code` `credit_exhausted`) |
| 403 | The key's scopes or your role do not allow this; or the organization is suspended; or a plan limit only you can clear (`error_code` `plan_limit_exceeded`): API keys, templates, template storage, paused sandboxes, a size above your plan's largest, or on Free the month's included vCPU-hours or egress (`limit_name` `included_vcpu_hours` or `included_egress_gb`) |
| 404 | Not found, or not yours (the same answer). On create, `error_code` `template_not_found` |
| 409 | The sandbox is in the wrong state (for example, a request to a paused sandbox's URL). On create, `error_code` `template_not_ready`: the template exists but cannot start a sandbox; retrying does not help until it is rebuilt |
| 413 | The request body, or a template's build context, is too large |
| 429 | A plan limit on what runs at once (`error_code` `plan_limit_exceeded`: sandboxes, vCPU, or sandboxes at the largest size), or a rate limit (`error_code` `rate_limited`, with `Retry-After`): your plan's requests or sandbox creates per minute, the team-wide rates, or failed sign-ins from one address |
| 500 | An internal error. On create, `error_code` `sandbox_create_failed` |
| 501 | Not available on this platform (for example, changing a running sandbox's network policy) |
| 502 | Something behind the API could not be reached: the sandbox itself, or the template or usage service |
| 503 | Not available yet; retry after `Retry-After` seconds. `error_code` says why: `sandbox_engine_starting` (the platform is still starting up), `sandbox_engine_unavailable` (it could not be reached), or `sandbox_capacity_unavailable` (no capacity right now; on a resume, the sandbox stays paused and the same request resumes it once a host has room) |
| 504 | The platform did not answer in time and the outcome is unknown (`Should-Retry: false`). On create, `error_code` `sandbox_create_failed`: list your sandboxes before retrying, or you may start two |
| 507 | Snapshot storage is full (`error_code` `sandbox_snapshot_storage_full`): pause is refused, and retrying does not help |

## Service status

[status.anonalabs.com](https://status.anonalabs.com) shows whether the API, sandboxes, sandbox URLs, the dashboard and these docs are up.

`GET https://api.compute.anonalabs.com/statusz` answers the same question for a script. It needs no API key, answers `200` whenever the API can answer at all, and puts the verdict in the body. The result is cached for 15 seconds.

```json
{
  "status": "operational",
  "version": "b39ca12175eb",
  "checked_at": "2026-11-14T13:48:12Z",
  "components": {
    "api": { "status": "operational" },
    "database": { "status": "operational" },
    "sandbox_engine": { "status": "operational", "state": "asleep", "note": "asleep, starts on next create" },
    "capacity": { "status": "operational" }
  }
}
```

Each `status` is `operational`, `degraded` or `down`, and the top-level `status` is the worst of the components. `sandbox_engine.state` is `awake`, `asleep`, `waking`, `going_to_sleep` or `unknown`. An engine that is asleep is working as designed: the next create starts it, and that create takes longer. A request that gets no answer at all, or a `5xx`, means the API itself is down.

## Sandbox traffic

Commands, files and terminals do not go to the API host. They go to the sandbox's own `envd` at `https://49983-<sandbox id>.sbx.compute.anonalabs.com` (Connect RPC, E2B's `envd` protocol), with the sandbox's access token from the create response. Live view and SSH use `wss://stream.compute.anonalabs.com`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.