> Fetch https://askmiles.ai/llms.txt first: it indexes every public Miles capability. This file is the markdown twin of https://askmiles.ai/docs/chat-api/rate-limits.

# Rate limits

Requests per minute and turns at once, counted per grant, with the headers every response carries so a client can plan around them.

## The ceilings

| Ceiling | Value | Counted per |
|---|---|---|
| Requests per minute | 30 | Grant: one OAuth token family, or all of an account's personal keys together |
| Turns at once | 2 | The same grant |
| Turns at once, everyone | 6, briefly 12 during a deploy | The whole service, shared across callers |

Refreshing a token does not reset its count. Every personal API key on one account shares a single count, so a second key is not a second allowance. The global ceiling is shared, so someone else's traffic can trip it; that refusal says `concurrency limited` and asks for a two-second wait.

## Headers on every response

Every `/v1/chat/completions` response carries these, on successes, streams and 429s alike:

```text
x-ratelimit-limit-requests: 30
x-ratelimit-remaining-requests: 27
x-ratelimit-reset-requests: 41s
```

They are spelled the way OpenAI spells them, so an OpenAI SDK reads them with no Miles-specific code. `remaining` excludes the call being answered. `reset` is seconds until the window opens again.

An account whose monthly counter governs it also gets two more:

```text
x-miles-quota-limit-month: 200
x-miles-quota-remaining-month: 143
```

They are absent, not zero, on an account with no monthly limit: absent means the counter does not apply, and zero would mean the opposite. Nothing is emitted before the caller is identified, so a 401 and `/v1/models` carry none of these.

## Over a ceiling

A 429 in the OpenAI error envelope with a `Retry-After` header. Two different conditions share the status and need different handling:

| `type` | Message starts | What to do |
|---|---|---|
| `rate_limit_exceeded` | `rate limited, retry after Ns` | Wait `Retry-After` seconds; the per-minute window is full |
| `rate_limit_exceeded` | `concurrency limited, retry after 2s` | Reduce parallelism; another turn on this grant, or on the service, is still running |
| `insufficient_quota` | `usage limit reached` | The month's allowance is spent; it does not reset with time in the minute |

The full table of codes is on the [errors page](https://askmiles.ai/docs/chat-api/errors).
