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

# Authentication

> Authenticate your requests to the Deepdub API

## API keys

All Deepdub API requests require authentication via an API key passed in the `x-api-key` header.

```bash theme={null}
curl -X POST https://restapi.deepdub.ai/api/v1/tts \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{ ... }'
```

### Key format

API keys follow the format `dd-{random_characters}{checksum}`, where:

* The key always starts with the `dd-` prefix
* The last 8 characters are a checksum for validation

### Obtaining an API key

Contact [support@deepdub.ai](mailto:support@deepdub.ai) or visit your Deepdub dashboard to generate an API key.

### Security best practices

<Warning>
  Never expose your API key in client-side code or public repositories. Always store keys in environment variables or a secrets manager.
</Warning>

* Store API keys in a secrets manager (e.g., AWS Secrets Manager, HashiCorp Vault, GCP Secret Manager)
* Rotate keys periodically
* Use different keys for development and production environments

## Rate limits

API requests are subject to rate limiting based on your subscription plan:

| Limit type                       | Default |
| -------------------------------- | ------- |
| Concurrent requests per customer | 5       |
| Concurrent requests per IP       | 3       |

Rate limit errors return a `429` status code or a WebSocket error with `errorType: "RateLimit"`.

## Credits

TTS generation consumes credits based on the duration of generated audio. If your account runs out of credits, requests will return an `InsufficientCredits` error.

Check your credit balance in the Deepdub dashboard, or contact support to upgrade your plan.

## Regions

Deepdub operates in two regions:

| Region       | Base URL                               |
| ------------ | -------------------------------------- |
| US (default) | `https://restapi.deepdub.ai/api/v1`    |
| EU           | `https://eu-restapi.deepdub.ai/api/v1` |

<Warning>
  The EU region is **not available** with the free trial API key. To access the EU region, [contact us](mailto:support@deepdub.ai) for a production API key.
</Warning>
