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

# Authentication & API Keys

> Secure your API requests with Bearer token authentication

TokenKit uses API keys to authenticate requests. All requests must include a valid Bearer token in the `Authorization` header.

## Getting your API key

1. Sign in to the [Platform](https://www.tokenkit.co/platform/api-keys)
2. Navigate to **API Keys**
3. Click **Create API Key**
4. Copy the generated key (starts with `sk_live_v1...`)

<Warning>
  Your API key carries all privileges for your account. Never share it publicly or commit it to version control. If a key is compromised, delete it immediately from the dashboard.
</Warning>

## Making authenticated requests

Include your API key in the `Authorization` header with the `Bearer` scheme:

```bash theme={null}
curl https://api.tokenkit.co/v1/endpoint \
  -H "Authorization: Bearer sk_live_v1_your_key_here"
```

## Authentication errors

### Missing or invalid token

If your API key is missing or invalid, you'll receive a `401 Unauthorized` response:

```json theme={null}
{
  "data": null,
  "errors": [
    {
      "code": "UNAUTHORIZED",
      "message": "Invalid or missing Bearer token"
    }
  ]
}
```

**Common causes:**

* Forgot to include the `Authorization` header
* Typo in the API key
* Using a revoked or deleted key
* Missing `Bearer` prefix

## Managing API keys

All API key management happens through the **platform**. You can create and delete keys at any time.

Go to the [platform](https://www.tokenkit.co/platform/api-keys) to:

* **Create new API keys** - Generate additional keys for different projects or environments
* **View existing keys** - See all your active API keys
* **Delete keys** - Permanently revoke keys that are no longer needed

<Card title="Customer Platform" icon="square-terminal" href="https://www.tokenkit.co/platform/api-keys">
  Manage your API keys and monitor authentication activity
</Card>
