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

# Rate limits

> How request rate is bounded, and how to back off.

Requests are rate-limited per API key. When you exceed the limit the API responds
`429 rate_limited` with headers telling you the policy and when to retry:

```http theme={null}
HTTP/1.1 429 Too Many Requests
Retry-After: 2
RateLimit-Policy: 600;w=60
```

* `Retry-After` is the number of seconds to wait before retrying.
* `RateLimit-Policy` describes the budget (here, 600 requests per 60-second window).

## Backing off

Respect `Retry-After`, and add jitter when you retry so many clients do not retry in
lockstep. A simple, safe strategy:

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

def call_with_backoff(request, max_attempts=5):
    for attempt in range(max_attempts):
        resp = request()
        if resp.status_code != 429:
            return resp
        wait = int(resp.headers.get("Retry-After", "1"))
        time.sleep(wait + random.uniform(0, 0.5))
    return resp
```

Separately, revealing the codes of a single order is bounded on its own with
`reveal_rate_limited`, to prevent enumeration; poll the order rather than hammering
the codes endpoint.
