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

# Rate Limits

> Handle Audixa API request and concurrency limits

Audixa limits API traffic by API key and also enforces the concurrent-generation
limit attached to the account plan. Limits can change, so this guide does not
publish a static plan matrix.

Review the active plan in [Billing](https://audixa.ai/app/billing) and the
current [Pricing page](https://audixa.ai/pricing). Enterprise terms, if any,
are the terms agreed for that account.

## Response Headers

Rate-limited endpoints can include standard limit headers such as:

| Header | Description |
| - | - |
| `X-RateLimit-Limit` | Request allowance for the current window |
| `X-RateLimit-Remaining` | Requests remaining in that window |
| `X-RateLimit-Reset` | When the current window resets |
| `Retry-After` | Delay to observe before retrying a `429` response |

Clients should tolerate a missing optional header and should not hard-code a
single allowance for every endpoint.

## Handling `429 Too Many Requests`

Read the response and honor `Retry-After` when present. Otherwise, use bounded
exponential backoff with jitter.

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


def request_with_retry(method, url, *, max_retries=5, **kwargs):
    for attempt in range(max_retries + 1):
        response = requests.request(method, url, **kwargs)
        if response.status_code != 429:
            return response
        if attempt == max_retries:
            response.raise_for_status()

        header_delay = response.headers.get("Retry-After")
        delay = float(header_delay) if header_delay else min(2 ** attempt, 30)
        time.sleep(delay + random.random())

    raise RuntimeError("Retry loop exited unexpectedly")
```

```javascript JavaScript theme={null}
async function requestWithRetry(url, options, maxRetries = 5) {
  for (let attempt = 0; attempt <= maxRetries; attempt += 1) {
    const response = await fetch(url, options);
    if (response.status !== 429) return response;
    if (attempt === maxRetries) throw new Error(await response.text());

    const headerDelay = Number(response.headers.get('Retry-After'));
    const seconds = Number.isFinite(headerDelay)
      ? headerDelay
      : Math.min(2 ** attempt, 30) + Math.random();
    await new Promise((resolve) => setTimeout(resolve, seconds * 1000));
  }
}
```

## Concurrency Errors

A request can be below its HTTP request allowance and still exceed the plan's
concurrent-generation limit. When this happens, wait for an existing generation
to reach `COMPLETED` or `FAILED` before submitting another one.

## Best Practices

> [card] Back Off
>
> Honor `Retry-After`, cap retries, and add jitter to avoid synchronized retries.

> [card] Poll Deliberately
>
> Add a delay between status requests and stop at `COMPLETED` or `FAILED`.

> [card] Limit Local Concurrency
>
> Queue work in your application instead of submitting an unbounded burst.

> [card] Reuse Completed Results
>
> Store the returned audio URL or your own permitted copy instead of regenerating identical input.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.