In this section: Rate limits

Rate limits

See the Chat API rate limits and the response headers your client can use to handle 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, one account4The account, across every grant it holds
Turns at once, everyone2, up to 4 during a zero-downtime deployThe whole service, shared across callers
Spend in a rolling 24 hoursAn allowance sized well above a person's dayThe account, across every grant it holds

Token refreshes do not reset the count. All personal API keys on an account share one count, so adding a key does not add an allowance. Today the service-wide ceiling of 2 is the one that binds: a second grant or a second key does not add turns at once. The per-account ceiling applies if the service-wide one is raised. Other callers can trigger the shared global limit; all three concurrency refusals say “concurrency limited” and request a two-second wait.

The daily allowance is counted per account, so authorizing a second client does not widen it, and the person's own web chat spends from the same allowance. The allowance caps spending from a compromised credential; normal use stays well below it, and clients that reach it are almost always looping. It is a rolling 24-hour window, so capacity returns as earlier spend ages out of it. The Retry-After on its refusal is an hour. It is a hint: capacity comes back as earlier spend ages out.

GET /v1/models has its own per-minute window, equal in size to the completions window and counted on the same grant. Listing models does not use the budget for turns. It carries no x-ratelimit-* headers, so this page is the only place that ceiling is written down.

Headers on every response

Every /v1/chat/completions response includes these headers on successes, streams, and 429s:

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

These use OpenAI's header names, so OpenAI SDKs can read them without Miles-specific code. The remaining value excludes the current call. The reset value gives the seconds until the oldest request in the 60-second window ages out and frees a slot, or 0s when the window is empty.

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

x-miles-budget-percent-used: 42 x-miles-budget-reset-date: 2026-10-14

percent-used is an integer from 0 to 100, rounded down. reset-date is the Pacific date when the budget period turns over. For accounts without a monthly budget, both headers are omitted. Their absence means no budget applies; a value of 0 means the budget applies. Miles sends none of these headers before identifying the caller, so a 401 includes none. Neither does /v1/models, which has its own window and would otherwise report the wrong one under OpenAI's header names.

Over a ceiling

A 429 response uses the OpenAI error envelope and includes a Retry-After header. Four conditions share this status and require different handling. Read the message to tell them apart:

typeMessage startsWhat to do
rate_limit_exceededrate limited, retry after NsWait Retry-After seconds; the per-minute window is full. On /v1/models this is that endpoint's own window
rate_limit_exceededconcurrency limited, retry after 2sReduce parallelism; another turn on this grant, on another grant of the same account, or on the service, is still running
rate_limit_exceededYou've reached today's usage limitWait Retry-After, which is an hour here. The account's daily spend allowance is full until earlier spend ages out of the rolling 24 hours. This is not the per-minute window and will not clear in a minute, so a client that retries on the usual 429 backoff will keep failing
insufficient_quotaYou've used this month's budget. It resets on …, or a trial-budget message during a Membership trialThis month's budget is spent. Retry-After is the seconds until the reset date. It can be days, so do not retry on the usual 429 schedule

Two of those four are rate_limit_exceeded on a window measured in seconds and one is rate_limit_exceeded on a window measured in hours, so a client that branches on the code alone will retry the daily ceiling far too fast. Branch on Retry-After.

See the errors page for the full code table.