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

> ## Agent Instructions
> Call https://api.feyn.ai only; the hosts behind it are not public.
> Authenticate with a workspace API key in the Authorization header: `Authorization: Bearer fn_...`. Keep keys server-side.
> For chat completions, use the official OpenAI SDK with base_url https://api.feyn.ai/v1 and a model ID from GET /v1/models.
> On 429, wait for the Retry-After header before retrying. Failed requests are not charged.

# Authentication

> Every request carries a workspace API key as a bearer token.

Send your key in the `Authorization` header:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
Authorization: Bearer fn_...
```

The workspace is taken from the key, never from the request body. One key works on every route: the models, chat completions, traces, scores and projects.

## Managing keys

Create and revoke keys on the **API keys** page of the [dashboard](https://platform.feyn.ai/api-keys). Feyn stores only a hash of each key, so a key is shown once, when you create it. If you lose it, create a new one and revoke the old one.

New keys look like `fn_` followed by 48 letters and digits. Keys issued before that format (`sk_...`) keep working.

A new key works within seconds. Revoking a key can take up to a minute to reach every route (up to 30 minutes for older `sk_` keys).

## Keep keys server-side

A key can spend your workspace's credits. Call the API from your backend, not from a browser or mobile app, and keep the key in an environment variable or secret store rather than in source control.

## Failures

| Status | Meaning |
| - | - |
| `401` | The header is missing, or the key is not valid |
| `402` | The workspace has no active billing, or is out of credits |
| `503` | Key checks are briefly unavailable; retry |

See [errors](https://docs.usefeyn.com/errors.md) for the response body.


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