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

# API keys

> Where keys come from, what each kind of key does, and which calls need no key.

Most of what you put on public pages needs no key. You need a key to read or change your own account from a script or server.

## Calls that need no key

* **Page blocks of a listed account.** `GET /public/creators/{slug}/page-blocks/{your video id}`. See [Put metadata on your pages](https://docs.agentcdn.com/guides/page-metadata.md). An unlisted account reads its own blocks with an account API key. See [Listed and unlisted accounts](https://docs.agentcdn.com/concepts/accounts.md).
* **Public ARV records and catalogs.** The `/public/...` routes in the [public API](https://docs.agentcdn.com/api-reference/overview.md#public-api).
* **The public MCP servers.** `https://mcp.agentcdn.com/c/{slug}/mcp` for one library, and `https://mcp.agentcdn.com/mcp` for the network. See [Connect an MCP](https://docs.agentcdn.com/guides/connect-mcp.md).
* **The account MCP in an AI app.** ChatGPT, Claude and other apps connect with a sign-in, not a key.
* **The Ask box.** It works without a key, with lower limits. See [Add Ask to your site](https://docs.agentcdn.com/guides/embed-ask.md).

## Account API keys

Account API keys call the `/v1` account API: your videos, transcripts, answers, reports, settings and imports.

**1. Open the keys card**

Sign in at [app.agentcdn.com](https://app.agentcdn.com). Open **Settings**, then **API and MCP**. The **API keys** card is on that page.

**2. Create a key**

Choose **Create API key**. Give it a name, for example "Weekly report script". Pick the access:

* **Read only.** Reads your library, questions and reports.
* **Can make changes.** Also edits videos, AI access, featured questions, imports and webhooks.

**3. Copy it now**

The full key shows once. Store it in your secret manager. The console keeps only the key's prefix, so you can tell keys apart later.

> [!NOTE]
>
> Your account needs a connected video source before you can create a key. The card says so and links to **Imports**.

Send the key as a bearer token:

```bash theme={null}
curl -s https://api.agentcdn.com/v1/account \
  -H "Authorization: Bearer $AGENTCDN_API_KEY"
```

### Scopes

| Console access | Scope | Allows |
| - | - | - |
| Read only | `account:read` | Every read on `/v1`. |
| Can make changes | `account:read` and `account:write` | Every read, plus changes. |

### Changes run in two calls

Most changes do not run on the first call. The first call returns a preview of what would change and a `confirm_token`. Send the same request again with that `confirm_token` to run it. A few changes that only repeat safe work run in one call. The reference says which.

### Limits and errors

The account API allows up to 120 calls a minute per account. Errors come back as `{ "error": "<code>", "message": "<plain words>" }`.

| Status | `error` | What to do |
| - | - | - |
| 401 | `api_key_required` | Send the key in the `Authorization` header. |
| 401 | `invalid_api_key` | The key is wrong or revoked. Create a new one. |
| 403 | `insufficient_scope` | The key lacks a scope the call needs. Create a key with the right access. |
| 429 | `rate_limited` | Wait for the `Retry-After` time, then retry. |

### Revoke a key

Choose **Revoke** on the key's row. Tools that use it stop working at once.

## Ask keys

Ask keys are a separate kind of key. They raise the Ask limits and count Ask answers to your account. They live in the console on the **Ask page** screen, in the **Ask keys** card. See [Embed Ask on your site](https://docs.agentcdn.com/guides/embed-ask.md#ask-keys).

> [!WARNING]
>
> Never put an account API key in a web page or a client app. Use a browser Ask key there instead.


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