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

# Authentication

> Create and use Cherry Shot API keys.

Every request (except `/v1/health`) is authenticated with an API key.

## Get a key

In the Cherry Shot dashboard, go to **Profile → API** and create a key. The full key
(`cs_` followed by 64 hex characters) is shown **once, at creation** — store it in a
secret manager. Only a hash is kept on our side, so we can't show it to you again.

<Warning>
  Treat your key like a password. It can spend your account's credits. If a key leaks,
  revoke it from the dashboard and create a new one.
</Warning>

## Send it with each request

Pass the key in either header:

<CodeGroup>
  ```bash Authorization theme={null}
  curl https://ybhqmgyprapjxomdxifs.supabase.co/functions/v1/api/v1/credits \
    -H "Authorization: Bearer cs_your_key"
  ```

  ```bash x-api-key theme={null}
  curl https://ybhqmgyprapjxomdxifs.supabase.co/functions/v1/api/v1/credits \
    -H "x-api-key: cs_your_key"
  ```
</CodeGroup>

## Agency (white-label) keys

If your account belongs to an agency workspace, keys you create are **agency keys**
automatically: they bill the agency's shared credit pool and can be pinned to one of your
client brands at creation (Profile → API → "Client brand"), which attributes everything
generated with that key to that client in your [usage reports](/guides/agencies). Agency
keys stop working if the member who created them leaves the agency.

## Limits

* **Rate limit:** 60 requests per minute per key. Exceeding it returns `429 rate_limited`.
* **Keys per account:** up to 10 active keys. Revoke unused ones to create more.

## Errors

| Status | `code`         | Meaning                            |
| ------ | -------------- | ---------------------------------- |
| 401    | `unauthorized` | Missing, invalid, or revoked key.  |
| 429    | `rate_limited` | Over 60 requests/min for this key. |

See [Errors](/guides/errors) for the full list and the error envelope.
