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

# Authentication

> Authenticate API requests using Bearer tokens.

# Authentication

All API requests must include a valid API key in the `Authorization` header.

## Getting an API Key

1. Log in to [Callem Studio](https://studio.callem.ai)
2. Navigate to **Settings > API Keys**
3. Click **Create API Key**
4. Copy the key immediately — it will only be shown once

See the [API Keys guide](/settings/api-keys) for detailed instructions.

## Using the API Key

Include the key in the `Authorization` header as a Bearer token:

```bash theme={null}
curl -X GET https://api.callem.ai/v1/calls \
  -H "Authorization: Bearer ck_live_your_api_key_here"
```

<CodeGroup>
  ```javascript Node.js theme={null}
  const response = await fetch('https://api.callem.ai/v1/calls', {
    headers: {
      'Authorization': 'Bearer ck_live_your_api_key_here',
      'Content-Type': 'application/json',
    },
  });

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.callem.ai/v1/calls',
      headers={
          'Authorization': 'Bearer ck_live_your_api_key_here',
          'Content-Type': 'application/json',
      }
  )

  data = response.json()
  ```
</CodeGroup>

## Key Format

API keys start with `ck_live_` followed by 60 random hexadecimal characters:

```
ck_live_a1b2c3d4e5f6...
```

## Security

* The full API key is **never stored** on our servers — only a SHA-256 hash
* The key is shown **once** at creation time
* Keys can be restricted by **IP address** (single IPs, CIDR ranges, or `*` for all)
* Keys can have an optional **expiration date**
* Each key is scoped to a **single project**

## Common Errors

| Error                                         | Cause                                     | Fix                                                      |
| --------------------------------------------- | ----------------------------------------- | -------------------------------------------------------- |
| `401 Missing or invalid Authorization header` | No `Authorization` header or wrong format | Add `Authorization: Bearer ck_live_...`                  |
| `401 Invalid API key format`                  | Key doesn't start with `ck_live_`         | Check the key format                                     |
| `401 Invalid API key`                         | Key not found (revoked or wrong)          | Create a new key in Settings                             |
| `401 API key has expired`                     | Key passed its expiration date            | Create a new key                                         |
| `403 IP address not allowed`                  | Your IP isn't in the allowed list         | Update the key's IP restrictions or use a whitelisted IP |
