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

# Authentication

> Send your API key as a bearer token.

Every request needs an API key in the `Authorization` header:

```http theme={null}
Authorization: Bearer fr_...
```

OpenAI SDKs send the header for you when you pass the key as `api_key` (Python) or `apiKey` (TypeScript).

## Managing keys

Create and revoke keys on the [API keys](https://fastrun.si/dashboard/keys) page of the dashboard.

* A key starts with `fr_` and is shown only once, when you create it. fastrun stores only a hash of it, so a lost key
  cannot be recovered; create a new one and revoke the old one.
* You can have up to 20 active keys. Use one per app or environment so you can see their usage separately and revoke
  one without touching the others.
* Keys are checked on every request, so a revoked key stops working right away.
* Keys of a new account start working once the account has been approved.

> [!WARNING]
>
> Keep keys on the server. Don't put them in browser or mobile app code, where anyone can read them.

## When a key is refused

A missing, unknown or revoked key, or a key of an account that is not approved yet, gets `401`:

```json theme={null}
{
  "error": {
    "message": "invalid or missing API key",
    "type": "authentication_error",
    "code": 401
  }
}
```

If fastrun cannot check keys for a moment, it answers `503` with `Retry-After: 1` rather than letting the request
through. Retry it; see [Errors and retries](https://docs.fastrun.si/guides/errors.md).


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