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

# Authentication

> Get API access and authenticate with an API key.

## Get access

During the preview, API keys work for workspaces that have purchased credits at least once.

1. Sign in at [anythingmd.com](https://anythingmd.com).
2. Buy any credit pack under **Settings → Billing**.
3. Open **Settings → API Keys** and create a key.

The secret (`amd_live_...`) is shown once. Store it in a secret manager; it cannot be shown again. Access turns on within about a minute of the first purchase.

## Send the key

Send the key as a bearer token on every request:

```
Authorization: Bearer amd_live_...
```

Never put API keys in browser or mobile code. Call the API from your server.

## Scopes

Each key carries the scopes chosen when it was created:

| Scope | Allows |
| - | - |
| `documents:read` | Job status, outputs, quotes and receipts |
| `documents:write` | Uploads and new jobs |
| `documents:delete` | Canceling jobs |

A key without the required scope gets `403` with `code: insufficient_scope`.

## Access errors

| Status | Code | Meaning |
| - | - | - |
| 401 | `unauthenticated` | The key is missing, invalid, expired or revoked |
| 403 | `api_access_requires_purchase` | The workspace has not purchased credits yet |
| 403 | `insufficient_scope` | The key lacks the scope this endpoint needs |
