
Model API providers enforce several limits at once — requests per minute and per day, tokens per minute and per day, plus image and audio equivalents — and an application that trips any single axis receives HTTP 429 responses. Treating those errors as a transient nuisance leads most teams to naive retry loops, which synchronize across instances and convert throttling into outages. This guide presents the engineering practices that keep LLM-backed services inside vendor quotas: capturing rate-limit telemetry from response headers, refining exponential backoff with jitter and server-provided delays, throttling outbound traffic before it is rejected, and eliminating requests with layered caching. It then covers burst-tolerant architecture — admission queues, per-tenant fairness, gateway fallbacks, and rate-limit-aware routing. The audience is backend engineers operating production services against OpenAI, Anthropic, and comparable model APIs, and vendor-specific thresholds are flagged where they change over time.

A 429 Too Many Requests response is not a generic “try again later” indicator; it reveals which quota axis the provider has exhausted. Understanding that axis determines whether the fix is to send fewer calls, reduce token usage, or request higher capacity.
OpenAI enforces five concurrent limits on every organization‑ or project‑scoped key:
| Axis | Typical unit | Effect when hit |
|---|---|---|
| Requests per minute (RPM) | calls | Stops any new calls until the minute window resets |
| Requests per day (RPD) | calls | Halts traffic for the rest of the day |
| Tokens per minute (TPM) | input + output tokens | Blocks further token consumption even if request count is low |
| Tokens per day (TPD) | tokens | Same as TPM but on a 24‑hour horizon |
| Images per minute (IPM) | generated images | Relevant for DALL·E‑style endpoints |
Because each axis is evaluated independently, a workload that sends 20 requests each carrying 100 tokens will hit a 20 RPM limit long before the 150 k TPM ceiling is reached. The same principle applies to image or audio endpoints, which have separate per‑minute caps.
Every OpenAI response includes telemetry headers that identify the binding axis and the reset time — for example, Retry-After, x‑ratelimit‑limit‑requests, x‑ratelimit‑remaining-tokens, x‑ratelimit‑reset‑requests, and x‑ratelimit‑reset‑tokens [OpenAI docs]. Capture these headers on every call, not only on failures, to build an accurate per‑axis consumption view. The limits are scoped per organization and per project, and many model families share a single TPM bucket; a burst on GPT‑4 can therefore starve GPT‑3.5 requests.
Anthropic does not use discrete reset windows. Its API behaves like a continuously refilled token bucket: capacity replenishes second‑by‑second, so waiting until the top of the hour offers no benefit [Anthropic token bucket explanation]. The correct response to a 429 from Anthropic is to throttle the send rate (e.g., reduce calls per second) and optionally apply jittered retries, rather than a fixed sleep.
Both providers expose tier‑specific caps (e.g., spend‑based tiers ranging from $5 to $1 000 monthly, with daily caps from $100 to $200 000). These thresholds evolve as pricing pages are updated, so verify current values before hard‑coding limits.
Only after this observability foundation is in place should you introduce throttling, back‑off, or caching strategies, because the telemetry tells you exactly which quota you need to protect.

When an LLM provider returns HTTP 429, the safest recovery path is a rate‑limit aware retry loop rather than a blind sleep‑and‑retry. A production‑ready implementation typically follows these steps:
Classify the failure
Base schedule: exponential backoff with full jitter
[0, current_backoff]. This prevents synchronized retries across instances, a common cause of retry storms.Respect Retry‑After when present
OpenAI includes a Retry‑After header that specifies the minimum seconds to wait before a new request — sample value 56 s【{"id":0,"source":"https://developers.openai.com/api/docs/guides/rate-limits"}】. This header overrides any locally computed backoff, ensuring the client does not violate the provider’s reset window.
Dynamic adjustment
Rather than a static exponential curve, incorporate the provider’s reset timestamps (x‑ratelimit‑reset-requests, x‑ratelimit‑reset‑tokens). By scaling the next backoff to the observed reset interval, the client can converge faster when the quota refreshes and back off longer during prolonged throttling【{"id":1,"source":"https://developers.openai.com/api/docs/guides/rate-limits"}】.
Durable scheduling
Idempotent request handling
Because the same logical operation may be executed twice, design the downstream call to be safe under duplication (e.g., use idempotency keys, upserts, or deterministic outputs).
Observability and budgeted retry accounting
Treat the retry layer as a budgeted scheduler: log attempt number, scheduled vs. actual execution time, response code, and any Retry‑After value. This audit trail makes it easy to spot “retry storms” and to enforce service‑level budgets.
Cap the overall retry deadline
Even when individual backoffs are short, a cumulative deadline (e.g., 30 s to 2 min) prevents indefinite waiting and enables downstream fallback paths (circuit breaker, cached response, or graceful degradation).
By combining jittered exponential backoff, strict Retry‑After precedence, dynamic window awareness, durable scheduling, and full observability, services stay inside vendor quotas and avoid turning a momentary throttling event into a production outage.
References
Retry‑After (56 s minimum)【{"id":0,"source":"https://developers.openai.com/api/docs/guides/rate-limits"}】
When a request reaches the provider only to be rejected with HTTP 429, the latency and load on the system are already wasted. A proactive client‑side limiter prevents those calls from being issued in the first place.
Both designs can be implemented as a thin middleware layer that sits in front of every vendor SDK call. The limiter should be configured below the published limits, leaving headroom for occasional spikes and for the inevitable drift between the local counter and the provider’s counter [OpenAI rate limits].
A TPM quota is consumed by input + output tokens, not merely by request count. Before dispatching a request, estimate its total token cost:
estimated_cost = prompt_tokens + expected_completion_tokens
Reserve that amount from the bucket; if insufficient tokens remain, defer the request until the bucket refills. Counting only requests will still hit the provider’s token ceiling, especially for long completions [OpenAI rate limits].
If each replica keeps its own in‑memory counter, the sum of their local allowances can exceed the global quota. Move the limiter’s state to a central store—commonly a Redis hash or a dedicated admission service. All instances query and update the same token count, guaranteeing that the aggregate traffic stays within the vendor’s limits [Mastering OpenAI API Rate Limits – client‑side throttling].
Provider responses provide an implicit signal that the current rate is too high. Implement a feedback loop that:
Retry‑After header.Such adaptive behaviour converges to a safe operating point without manual tuning [Mastering OpenAI API Rate Limits – adaptive throttling].
Rather than scattering independent limiters across every service, route all outbound model calls through a gateway or queuing layer that owns the quota accounting. This central point simplifies auditing, enables consistent back‑off policies, and eliminates race conditions that arise from distributed counters.
By integrating a shared, token‑aware limiter and an adaptive feedback loop, production services can stay comfortably inside OpenAI, Anthropic, or similar vendor quotas, turning “rate‑limit errors” from a reactive surprise into a predictable, controllable metric.

Caching works on a “first‑hit‑wins” chain: a request is checked against the semantic cache first, then against the provider‑side prefix cache, and only if both miss does it reach the full inference endpoint. Each layer removes cost and token consumption, so the overall quota impact shrinks dramatically.
Operational tips
cache_control marker. Cached writes cost 1.25× the normal rate, but reads are billed at 0.1× (a 90 % discount) and can be kept for 5 minutes or 1 hour via TTL options【https://platform.claude.com/cookbook/cost-optimization-cost-optimization】.Prompt structuring
Placing the immutable portion at the top maximises prefix‑cache hits and the associated discount.
Concurrent users often ask identical questions. By collapsing identical in‑flight requests to a single model call, you avoid duplicate token spend and reduce the chance of simultaneous 429 bursts.
By layering zero‑cost semantic caching, discounted provider prefix caching, and careful request deduplication, production LLM services can slash token usage, stay comfortably within vendor quotas, and eliminate many 429 throttling incidents.

When a service receives a sudden surge of requests, the line between graceful degradation and a full‑blown outage is whether the excess work is queued for later processing or sent to the model provider and rejected with HTTP 429.
A front‑end queue separates request intake from model execution. It absorbs spikes, offers natural back‑pressure to upstream callers, and lets a worker re‑insert failed tasks for another attempt. The trade‑off is added latency while a request sits in the queue and the need to manage dead‑letter handling for work that never succeeds — a pattern described for LLM orchestration in Inngest’s throttling controls【{"cursor": 0, "id": 0}】.
To prevent a single tenant or user from exhausting the shared vendor quota:
| Control | Purpose | Typical implementation |
|---|---|---|
| Per‑tenant / per‑user token bucket | Guarantees each consumer a minimum share of the quota | Separate RPM/TPM buckets; AWS Bedrock’s “multi‑tenant quota isolation” isolates each consumer’s requests, eliminating noisy‑neighbor effects【{"cursor": 0, "id": 1}】 |
| Priority queuing | Gives premium tiers a higher chance of immediate service | Weighted round‑robin or priority queues; Inngest supports built‑in priority tiers for premium users【{"cursor": 0, "id": 0}】 |
| Bounded concurrency | Caps the number of in‑flight calls per endpoint, per tenant, and globally | Global ceiling (e.g., 100 concurrent calls) plus per‑tenant limits (e.g., 10 concurrent per tenant) as recommended for webhook delivery systems【{"cursor": 0, "id": 2}】 |
A common 429 defense is adaptive concurrency: when a provider returns a throttling response, the scheduler halves the current in‑flight count for a cooling window, then gradually ramps up as success signals return. After a configurable number of consecutive 429s, a circuit breaker trips, stops immediate retries, and pushes new attempts into the queue. The “Resilient LLM inference patterns” guide demonstrates similar concurrency reduction and fallback routing to keep throughput high while respecting limits【{"cursor": 0, "id": 3}】.
Treat the queuing layer as a scheduler that enforces explicit caps, fairness policies, and visible state (queue depth, age, per‑tenant backlog). This makes overload conditions observable and allows operators to tune limits without changing application code.
queue_age_seconds metrics so clients can see expected wait times.By combining a resilient queue, per‑tenant fairness, adaptive concurrency, and clear load‑shedding policies, services can survive traffic bursts while staying safely within OpenAI, Anthropic, or similar model API quotas.

An LLM gateway acts as a single façade for all downstream model providers. By intercepting responses, it can hide the 429 (rate‑limit), 503 (service‑unavailable), or context‑length errors from callers and automatically retry with a pre‑configured secondary provider. This eliminates the need for application‑level retry loops that otherwise synchronize across instances and amplify throttling – the client receives one successful response without knowing a failover occurred【LiteLLM AI Gateway (LLM Proxy) Guide】(https://effloow.com/articles/litellm-ai-gateway-llm-proxy-guide-2026).
A concrete demo using Amazon Bedrock together with LiteLLM configured a primary model limited to 3 RPM and a fallback model allowed 25 RPM. Ten concurrent requests were issued; the first three were served by the primary, the remaining seven were automatically routed to the fallback, yielding 100 % success without any explicit retry code in the application【Resilient LLM inference patterns with Amazon Bedrock and LLM gateway】(https://aws.amazon.com/blogs/machine-learning/implementing-resilience-patterns-with-amazon-bedrock-and-llm-gateway/).
The same setup can enforce per‑tenant isolation. By assigning each consumer its own RPM bucket, a low‑quota tenant (3 RPM) faced two rejections while higher‑quota tenants (10 RPM) completed all five requests, preventing noisy‑neighbor starvation【Resilient LLM inference patterns with Amazon Bedrock and LLM gateway】.
A gateway‑level router can make routing decisions before a request reaches any provider:
LiteLLM’s model_list syntax supports this pattern out‑of‑the‑box; each entry can specify a primary and fallback provider, along with per‑key token limits and virtual budgets that isolate runaway loops【LiteLLM: Open‑Source LLM Gateway and Unified API】(https://www.seaflux.tech/blogs/explore-litellm-effortless-ai-projects/).
routing_rules, budget_scope) and supported providers evolve between gateway releases; keep the schema version locked in deployment manifests.By combining automatic provider fallbacks with token‑aware routing, production services can stay within vendor quotas, avoid “throttling storms,” and deliver uninterrupted LLM responses to end‑users.

When a service repeatedly hits HTTP 429 responses, retry loops only shift the bottleneck downstream and can amplify outage risk. The first step is to make the throttling visible to both engineers and operators.
Every 429 response should be emitted with a structured event that captures:
Retry-After header if present).x‑ratelimit-* fields that expose the current quota state (e.g., x‑ratelimit‑remaining‑requests, x‑ratelimit‑remaining‑tokens, and their reset timers)【1†https://developers.openai.com/api/docs/guides/rate-limits】. Storing these values with each failure lets you spot whether the limit is request‑bounded, token‑bounded, or both.Define an alert on the 429 rate per minute (or per rolling window) rather than on a raw count. A sustained rate above a few percent of total traffic typically indicates a capacity shortfall that cannot be solved by more retries. Early alerts give the ops team time to engage capacity‑planning processes before user‑visible latency spikes appear.
The x‑ratelimit‑remaining‑* headers reveal the “binding” axis:
| Header | Meaning |
|---|---|
x‑ratelimit‑remaining‑requests | How many calls remain before the RPM ceiling is hit |
x‑ratelimit‑remaining‑tokens | Tokens left before the TPM ceiling is hit |
x‑ratelimit‑reset‑requests / x‑ratelimit‑reset‑tokens | Time until the respective counter resets |
If the remaining‑request value drops quickly while the token counter stays high, the service is burst‑limited; the opposite pattern signals sustained token demand. This distinction guides whether you need burst smoothing (e.g., queueing) or throughput expansion (e.g., batching).
For latency‑tolerant workloads, off‑loading work to OpenAI’s Batch API frees interactive RPM/TPM for user‑facing calls. The batch queue limit is measured in total pending input tokens per model; tokens leave the queue as jobs finish, instantly releasing capacity【2†https://developers.openai.com/api/docs/guides/rate-limits】. Batch pricing is discounted relative to real‑time calls, but exact rates differ by model version and must be verified in the vendor’s pricing table.
A persistent 429 signal is a capacity‑planning indicator, not a bug to fix with more retries. Teams can:
Be aware that hard spend caps permanently block all API traffic once reached; OpenAI warns against enabling them in production environments【1†https://developers.openai.com/api/docs/guides/rate-limits】.
Bottom line: instrument every throttling event, surface the limiting metric, and treat a rising 429 rate as a signal to cache, batch, or procure additional quota—retry loops alone will not solve the underlying capacity shortage.