> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anonalabs.com/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 (E2B)](https://docs.anonalabs.com/compute/api-reference/sandboxes/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](https://docs.anonalabs.com/compute/api-reference/anona/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 e2b_…`:

```bash api_auth.sh theme={null}
curl -sS https://api.compute.anonalabs.com/v2/sandboxes -H "X-API-Key: $E2B_API_KEY"
curl -sS https://api.compute.anonalabs.com/v2/sandboxes -H "Authorization: Bearer $E2B_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 (API keys can read them).

## Errors

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

```json theme={null}
{ "code": 429, "message": "concurrent sandbox limit reached (100)", "error_code": "sandbox_quota_exceeded" }
```

| Status | Meaning |
| - | - |
| 400 | Invalid request, or a feature not supported (the message says which) |
| 401 | Missing, unknown, revoked or expired API key |
| 403 | The key's scopes or your role do not allow this; or the organization is suspended |
| 404 | Not found, or not yours (the same answer) |
| 409 | The sandbox is in the wrong state (for example, a request to a paused sandbox's URL) |
| 429 | A plan limit (`error_code` `sandbox_quota_exceeded`) |
| 503 | No capacity yet, for example during a cold start; retry after `Retry-After` seconds |

## 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.