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

# Authentication

> Authenticate your API requests

## Overview

Destined Voice API uses Bearer token authentication. Include your API key in the `Authorization` header of every request.

## Getting Your API Key

1. Sign up at [destined.ai](https://destined.ai)
2. Navigate to **Settings** > **API Keys**
3. Click **Create API Key**
4. Copy and store your key securely

<Warning>
  Keep your API key secret. Never commit it to version control or expose it in client-side code.
</Warning>

## Using the API Key

### With the SDK

```typescript theme={null}
import { SDK } from "@destined-ai/voice";

const client = new SDK({
  bearerToken: process.env.DESTINED_API_KEY,
});
```

### With cURL

```bash theme={null}
curl -X GET "https://api.destined.ai/v1/speakers" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### With fetch

```typescript theme={null}
const response = await fetch("https://api.destined.ai/v1/speakers", {
  headers: {
    "Authorization": `Bearer ${process.env.DESTINED_API_KEY}`,
    "Content-Type": "application/json",
  },
});
```

## Public Endpoints

Some endpoints don't require authentication:

| Endpoint           | Description             |
| ------------------ | ----------------------- |
| `GET /health`      | API health check        |
| `GET /v1/speakers` | List available speakers |

## Error Responses

Authentication errors return a `401 Unauthorized` response:

```json theme={null}
{
  "detail": "Invalid or expired API key"
}
```

Common authentication issues:

| Error                   | Cause                      | Solution                      |
| ----------------------- | -------------------------- | ----------------------------- |
| `401 Unauthorized`      | Missing or invalid API key | Check your API key is correct |
| `403 Forbidden`         | Insufficient permissions   | Contact support               |
| `429 Too Many Requests` | Rate limit exceeded        | Wait and retry                |
