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

# Authentication

> Send your API key as a bearer token on every request.

Every route takes the same API key. Send it in the `Authorization` header:

```bash theme={null}
curl https://one-api.ai/v1/tasks \
  -H "Authorization: Bearer $ONE_API_TOKEN"
```

The `x-api-key` header is accepted as well, for clients that use that convention:

```bash theme={null}
curl https://one-api.ai/v1/tasks -H "x-api-key: $ONE_API_TOKEN"
```

A missing, wrong or revoked key returns HTTP 401:

```json theme={null}
{ "error": { "code": "unauthorized", "message": "Unauthorized" } }
```

## Getting a key

one-api.ai is in early access. Keys are issued on request through the [contact page](https://one-api.ai/contact). A key belongs to one account and spends that account's credits.

## Keeping a key safe

* Keep the key on your server or in your terminal environment. Do not ship it in a browser or mobile app.
* Tasks are private to the account that created them. Another account asking for your task id gets a 404.
* If a key leaks, ask for it to be revoked. A revoked key stops working at once.

## Rate limits

| Limit | Value |
| - | - |
| Requests per IP address | 120 per minute |
| Requests per API key | 60 per minute |
| Unfinished tasks per account | 5 at a time |

A request over a limit returns HTTP 429 with a `Retry-After` header in seconds.


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