In this section: 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

CeilingValueCounted per
Requests per minute30Grant: one OAuth token family, or all of an account's personal keys together
Turns at once2The same grant
Turns at once, everyone6, briefly 12 during a deployThe 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:

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:

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:

typeMessage startsWhat to do
rate_limit_exceededrate limited, retry after NsWait Retry-After seconds; the per-minute window is full
rate_limit_exceededconcurrency limited, retry after 2sReduce parallelism; another turn on this grant, or on the service, is still running
insufficient_quotausage limit reachedThe month's allowance is spent; it does not reset with time in the minute

The full table of codes is on the errors page.