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

# Authentication

> Authenticate with the Kliio API using Bearer tokens

## API keys

The Kliio API uses Bearer token authentication. Every request must include your API key in the `Authorization` header.

```bash theme={null}
Authorization: Bearer YOUR_API_KEY
```

## Generating an API key

1. Log in to your [Kliio dashboard](https://kliio.app)
2. Navigate to **Settings → API**
3. Click **Generate API Key**
4. Copy and store the key securely — it is shown only once

<Warning>
  Never expose your API key in client-side code or public repositories. Treat it like a password.
</Warning>

## Making an authenticated request

```bash theme={null}
curl https://kliio.app/api/v1/me \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## Error responses

If your API key is missing or invalid, the API returns a `401` response:

```json theme={null}
{
  "error": "Unauthorized: Invalid or revoked API key"
}
```

| Scenario                       | Response                                         |
| ------------------------------ | ------------------------------------------------ |
| Missing `Authorization` header | `401 Unauthorized: Missing Authorization header` |
| Invalid or revoked key         | `401 Unauthorized: Invalid or revoked API key`   |

## Revoking a key

You can revoke any API key at any time from **Settings → API** in the dashboard. Revoked keys immediately stop working.
