LLM API rate limits are a capacity-planning problem as much as an error-handling problem. This guide provides a reusable method for estimating request and token demand, identifying the quota behind an HTTP 429 response, and designing queues, retries, and batch jobs that remain reliable as an AI workflow grows.
Overview
A 429 response means the service is temporarily refusing a request because a limit has been reached or a quota-related condition applies. The limit may concern request volume, token volume, simultaneous work, or a separate batch-processing allowance. Treating every 429 as the same problem often produces ineffective fixes, such as adding longer delays to a workload that is actually exceeding its token budget.
For production AI development, start by separating four capacity dimensions:
- Requests per minute (RPM): the number of API calls allowed during a time window.
- Tokens per minute (TPM): the input and, depending on the provider’s accounting rules, output tokens consumed during a time window.
- Concurrent requests: the number of in-flight requests permitted at one time.
- Batch quotas: separate limits or eligibility rules for asynchronous bulk-processing jobs.
These dimensions interact. A workload can remain below its request limit while exceeding its token limit, or use modest token volume while creating too many simultaneous connections. Before increasing traffic, document the limits assigned to the relevant account, project, model, region, and endpoint. Quotas can vary by provider and account configuration, so use the provider’s current documentation and dashboard rather than relying on an old value.
| Limit type | What it controls | Planning question | Typical response |
|---|---|---|---|
| RPM | Call frequency | How many calls will arrive in the busiest minute? | Throttle, queue, or combine work where appropriate |
| TPM | Token throughput | How many input and output tokens will the workload consume? | Reduce context, cap output, schedule work, or request more capacity |
| Concurrency | In-flight operations | How many requests can be active without creating saturation? | Use a bounded worker pool and backpressure |
| Batch quota | Bulk or asynchronous jobs | Does this endpoint support the required batch size, duration, and file limits? | Partition jobs and follow the provider’s batch rules |
Template structure
Use the following spreadsheet-ready structure before launching a new feature or bulk-processing run. Each row can represent a model, endpoint, tenant, or workload class.
Workload,Peak calls/min,Avg input tokens,Avg output tokens,Token overhead,Target utilization,Required RPM,Required TPM,Worker limit,Provider RPM,Provider TPM,Provider concurrency,Headroom status
Populate the columns as follows:
- Peak calls/min: use the expected busy-period rate, not the daily average.
- Avg input and output tokens: measure representative traffic where possible. Include retrieved passages, tool results, system instructions, and generated output.
- Token overhead: reserve space for formatting, metadata, retries, and estimation error. Keep the assumption visible rather than hiding it in a formula.
- Target utilization: choose a deliberate operating margin below the documented limit. The appropriate margin depends on traffic variability, latency requirements, and how costly throttling is.
- Required RPM: calculate peak calls per minute, then account for any expected retry traffic.
- Required TPM: calculate
peak calls/min × (input tokens + output tokens + overhead). - Worker limit: set the maximum number of in-flight requests allowed by your application, independently of the provider limit.
A simple capacity check is: required RPM ≤ provider RPM × target utilization and required TPM ≤ provider TPM × target utilization. Also verify that the worker limit does not exceed the documented concurrency allowance. If any check fails, do not solve the problem by simply increasing concurrency; that can turn a controlled queue into a burst of 429 responses.
Keep a second sheet for assumptions: traffic window, tokenizer or estimation method, maximum output setting, retry policy, batch schedule, and the date each provider value was verified. This makes the plan auditable when the workload or account configuration changes.
How to customize
Customize the template around workload behavior rather than only model selection. Interactive chat, retrieval-augmented generation, document extraction, evaluations, and offline enrichment have different capacity profiles.
For interactive traffic, plan for bursts and latency. Put a bounded queue in front of the provider and return a clear, recoverable response when the queue is full. For batch work, schedule jobs away from known interactive peaks, partition large inputs, and make every job resumable. A failed partition should not require reprocessing the entire dataset.
For RAG and tool-using workflows, calculate token demand after retrieval and tool results are added. A prompt that appears small at the application layer can become large after context assembly. Likewise, one user action may create several model calls. Record the workflow’s call graph so capacity planning reflects actual calls rather than only visible user requests.
Retry policy should be centralized. Use exponential backoff with randomized jitter, a maximum attempt count, and a total time limit. Honor an explicit retry or reset hint when the provider supplies one, but do not assume that every provider uses the same header names or semantics. Capture response status, relevant headers, request identifier, model or endpoint, and a redacted workload label for diagnosis. Avoid logging sensitive prompts merely to investigate throttling.
Retries must also be safe. Use idempotency controls where supported, store job state, and distinguish a request that was rejected before processing from one whose result is uncertain. Reliable tool-calling patterns and schema checks are useful here; see the guide to reliable LLM tool calling for related workflow design.
Examples
Interactive support assistant
Suppose a support assistant receives 40 calls per minute during a busy period. Each call includes a long retrieved context and can generate a substantial answer. The request rate may fit the RPM allowance while the combined input and output tokens exceed TPM. The first interventions should be to measure the assembled prompt, limit irrelevant retrieval, cap output appropriately, and queue bursts. Increasing workers would not address the token bottleneck.
Nightly document enrichment
A nightly job may generate thousands of independent extraction tasks. Instead of launching all tasks concurrently, divide them into resumable partitions, place them on a durable queue, and use a worker pool with a measured limit. Record completed item identifiers so a 429, timeout, or deployment restart does not duplicate successful work. If batch processing is available, confirm its current file, duration, token, and scheduling rules before adopting it; batch limits are not necessarily identical to synchronous API limits.
Diagnosing a repeated 429
First determine whether the error is caused by RPM, TPM, concurrency, a temporary service condition, or an account-level quota. Compare request timestamps and token usage against the provider’s response headers and dashboard. If requests arrive in spikes, add queue backpressure. If retries multiply traffic, reduce retry concurrency and apply jitter. If the workload is consistently above its allowance, redesign the workload or follow the documented quota-increase process rather than treating retries as capacity.
For a broader reliability workflow, connect these records to AI workflow observability, and use contract tests for LLM APIs to verify error handling when SDKs or provider behavior changes.
When to update
Revisit the capacity plan before traffic increases, model changes, new tenants, prompt expansion, retrieval changes, or bulk-processing campaigns. Update it after a provider changes quotas, header behavior, batch rules, model availability, account tier, endpoint configuration, or billing configuration. These details are provider-specific and should be checked against official documentation at the time of deployment.
Review operational evidence on a regular schedule: peak RPM, peak TPM, concurrency, queue depth, retry rate, 429 rate, latency, and completed work per hour. A plan that looks safe on daily averages may fail during a five-minute burst. Keep the last verified date beside every provider limit and record why each change was made.
Before the next release, run this checklist:
- Measure peak calls and token usage for each workload class.
- Check RPM, TPM, concurrency, and batch limits in current provider documentation.
- Apply a visible utilization margin and include expected retry traffic.
- Enforce bounded concurrency and queue backpressure in the client.
- Implement jittered exponential backoff with safe retry limits.
- Log response metadata and redacted identifiers for diagnosis.
- Test partial failure, duplicate delivery, timeouts, and resumable jobs.
- Document the quota-increase or workload-scheduling procedure for operators.
Capacity planning is most useful when it is maintained as part of the AI workflow, not created once for a launch review. Keep the spreadsheet, dashboards, retry policy, and deployment assumptions together so the team can explain a 429 quickly and choose a measured response.