OpenAI TPM Limits: How Tokens Per Minute Work and How to Avoid Rate Caps
An OpenAI TPM (Tokens Per Minute) limit is a rate limit that caps the total number of input and output tokens an organization can process through a specific model within a rolling 60-second window. Pushing raw document collections directly into prompt payloads exhausts per-minute token buckets rapidly, generating HTTP 429 errors. Structuring workloads with chunked scheduling, exponential backoff, and selective MCP retrieval decouples document size from inference rate caps.
How OpenAI TPM Limits Meter and Throttle Token Consumption
A developer sending a 20-page technical specification into an OpenAI prompt on an entry-level account consumes 15,000 tokens in a single request, taking half of an initial 30,000 TPM allocation before generation finishes. When automated agents or parallel workers dispatch even two such requests within sixty seconds, the API rejects subsequent traffic with an HTTP 429 rate limit error.
An OpenAI TPM (Tokens Per Minute) limit is a rate limit that caps the total number of input and output tokens an organization can process through a specific model within a rolling 60-second window.
Understanding OpenAI tokens per minute (TPM) is essential for engineering teams designing multi-step agent pipelines or document processing services. To preserve backend computing capacity and maintain equitable availability across developer organizations, OpenAI enforces rate limits across distinct operational dimensions:
- Tokens Per Minute (TPM): Caps the aggregate volume of prompt input tokens and completion output tokens processed by a specific model within a moving 60-second window.
- Requests Per Minute (RPM): Restricts the total number of individual HTTP API calls made to an endpoint within sixty seconds, regardless of whether a request contains ten tokens or ten thousand tokens.
- Requests Per Day (RPD) and Tokens Per Day (TPD): Establish cumulative daily boundaries over a continuous 24-hour cycle to guard against accidental recursive execution loops and unbounded bill accumulation.
- Images Per Minute (IPM) and Audio Concurrency: Restrict generation throughput on specialized multimodal, image, and real-time audio endpoints.
These rate boundaries apply at the organization level and project level, not to individual API keys or client IP addresses. Generating multiple API keys within an existing project draws from the same underlying token bucket.
The Rolling 60-Second Sliding Window
A frequent operational misconception is that OpenAI rate limits reset on fixed calendar minute marks, such as at the top of the clock minute. The API instead calculates consumption using a continuous sliding window algorithm. Every token submitted as an input prompt and every token generated in a completion enters an active accounting window for exactly sixty seconds.
When an application dispatches a payload of 20,000 tokens against a 30,000 TPM budget, the available headroom falls immediately to 10,000 tokens. If a concurrent agent task dispatches a second request requiring 12,000 tokens thirty seconds later, the API rejects the second call with an HTTP 429 rate_limit_exceeded response. The rejected request cannot execute until the initial 20,000-token payload completely crosses the 60-second threshold and decays from the moving window.
The rolling window behaves as a leaky bucket. Capacity replenishes continuously at a rate proportional to historical call completion timestamps rather than releasing all capacity in an abrupt minute-boundary refresh.
Upfront Token Reservation and Output Budgeting
The OpenAI gateway does not wait for a model to finish writing text before deciding whether a request fits inside your TPM allocation. The gateway calculates an upfront token reservation before routing the HTTP connection to an inference worker.
This reservation combines two values: the counted input tokens in your prompt payload, plus the maximum anticipated output tokens defined by your request parameters. When you specify max_tokens or max_completion_tokens: 4096, the rate limiter immediately reserves all 4,096 output tokens against your available TPM balance for the duration of the generation stream.
If your prompt contains 8,000 input tokens and your request specifies a max_tokens ceiling of 4,096, the gateway subtracts 12,096 tokens from your minute budget at millisecond zero. If the model finishes after generating only 350 tokens, the gateway credits the unused 3,746 reserved tokens back to your active TPM bucket once the stream terminates.
Leaving max_tokens unconfigured on models with large output ceilings causes the API to reserve the model default output capacity, which can reach 16,384 tokens on GPT-4o. Setting an explicit, conservative output ceiling on every API call prevents artificial TPM starvation.
Related guides
- Google Gemini Token Limits: 1M Context Windows, 65K Output Caps, and API QuotasGoogle Gemini enforces an input token limit of 1,048,576 tokens and an output ceiling of 65,536 tokens on current...
- Token Limit Exceeded: Resolving Prompt Length, Output, and TPM Rate ErrorsA token limit exceeded error occurs when an LLM request crosses context capacity, single-turn output generation...
- Gemini Message Limits in 2026: Quotas, Cooldowns, and WorkaroundsA Gemini message limit restricts how many prompts or API requests you can submit within a rolling window. Learn the...
- Google Gemini Daily Limit: Free vs Advanced Quotas & API Reset TimesThe Gemini daily limit governs request velocity and compute allowances across Google consumer apps and developer APIs....
- How to Configure Rclone with OneDrive for Business and SharePointRclone OneDrive for Business connects rclone to Microsoft 365 SharePoint and OneDrive tenants via Microsoft Entra ID...
- Grok Limits: Rate Caps, File Sizes, and Context Window ConstraintsGrok limits encompass the query frequency caps, context length windows, and file attachment thresholds enforced by xAI...
More on this subject: AI Agents: General Guides (190 guides)
How Account Tiers Determine Flagship Model TPM Ceilings
OpenAI determines organization rate ceilings through a tiered entitlement framework based on verified payment history and lifetime credit expenditure. New organizations start with entry-level quotas designed for testing and small development tasks. As an organization deposits funds and maintains successful billing cycles, the platform raises model quotas through progressive account tiers.
The table below outlines default rate limits across account plan tiers and qualifying credit purchases for flagship models:
Tier 1 accounts have a 30,000 TPM ceiling for GPT-4o, while Tier 5 accounts can access 10,000,000 TPM. Quotas differ between model architectures. High-efficiency models such as GPT-4o mini provide substantially larger token allocations at every tier, allowing high-frequency workloads to process millions of tokens per minute without hitting throughput caps.
Model-Specific Quotas and Shared Family Pools
Rate limits do not apply globally across your entire account as a single shared pool. Instead, OpenAI assigns distinct TPM and RPM allocations to individual model families. Consuming your entire allocation on GPT-4o does not reduce your available headroom on text-embedding models or audio transcription models.
However, certain model checkpoints within the same architectural generation share a collective pool. For example, pointing parallel worker processes at specific snapshot dates of a model family frequently draws down the identical token counter assigned to the alias pointer. Inspecting your organization limits dashboard in the OpenAI console reveals which model deployments share unified allocations.
High-capacity models supporting long context windows also enforce separate rate ceilings for requests that exceed defined context thresholds. When a prompt exceeds 32,000 or 64,000 input tokens, the gateway may route the call to dedicated long-context execution pools that enforce lower RPM limits to prevent memory bus saturation across GPU clusters.
Organization Allocations Versus Project-Level Caps
Enterprise accounts frequently organize workloads into distinct projects to isolate billing, access controls, and logging across teams. An organization receives an aggregate TPM quota from OpenAI, which administrators can divide or restrict across individual projects.
If an organization possesses an 800,000 TPM ceiling on GPT-4o, an administrator can assign a 100,000 TPM cap to a staging project and reserve 700,000 TPM for production services. A script running inside the staging environment that exceeds 100,000 tokens within sixty seconds receives an HTTP 429 error, even when the broader organization has 700,000 tokens of unused capacity.
With a 10K TPM limit, the same bug is capped at 14.4 million tokens per day and surfaces as HTTP 429 errors instead of a large invoice line. Establishing tight project-level token ceilings in non-production environments protects organizations from runaway automated agent loops while keeping production services isolated from test pipeline traffic spikes.
How to Diagnose and Resolve HTTP 429 Rate Limit Errors
When an API call exceeds an operational boundary or hits an active OpenAI TPM rate limit, the OpenAI server returns an HTTP 429 Too Many Requests response code. Diagnosing the exact root cause requires parsing the JSON error payload returned in the response body rather than assuming token volume caused the failure.
The API returns several distinct error codes under HTTP 429:
rate_limit_exceeded: The most common throttling event, triggered when your request crosses an active TPM, RPM, or RPD threshold. The accompanying error message specifies which counter was breached.insufficient_quota: Indicates that your account has exhausted its prepaid balance or reached its monthly credit spending limit. Retrying this error will not succeed until an administrator replenishes credits.slow_down: A transient protection response returned when your traffic pattern spikes too abruptly, even if your total tokens remain below published minute ceilings.
The Python SDK retries HTTP 429 responses up to two times by default when it can safely resend the request body. When managing custom network stacks or automated agent loops, client applications must inspect response headers and implement explicit backoff mechanics.
Inspecting Rate Limit Response Headers
Every response returned by the OpenAI API includes real-time telemetry headers that reveal current bucket consumption and remaining capacity. Tracking these headers in client middleware allows applications to pace outbound requests before a rejection occurs.
Key rate limit telemetry headers include:
When the API returns an HTTP 429 status code accompanied by a retry-after header, clients must pause execution for that exact duration before attempting a retry.
Implementing Exponential Backoff and Client-Side Token Buckets
Production applications must handle transient rate limit rejections gracefully. The standard pattern for managing HTTP 429 responses combines truncated exponential backoff with randomized jitter to prevent thundering herd conditions across distributed workers.
The following Python implementation demonstrates an asynchronous token-bucket rate limiter that meters request dispatch and executes exponential backoff when encountering rate limit rejections:
import asyncio
import random
import time
from openai import AsyncOpenAI, RateLimitError
class TokenBucketLimiter:
def __init__(self, tpm_limit: int, safety_margin: float = 0.9):
self.capacity = tpm_limit * safety_margin
self.tokens = self.capacity
self.fill_rate = self.capacity / 60.0
self.last_update = time.monotonic()
self.lock = asyncio.Lock()
#
async def acquire(self, estimated_tokens: int):
async with self.lock:
while True:
now = time.monotonic()
elapsed = now - self.last_update
self.tokens = min(self.capacity, self.tokens + elapsed * self.fill_rate)
self.last_update = now
if self.tokens >= estimated_tokens:
self.tokens -= estimated_tokens
return
sleep_time = (estimated_tokens - self.tokens) / self.fill_rate
await asyncio.sleep(max(0.1, sleep_time))
async def dispatch_with_backoff(client: AsyncOpenAI, limiter: TokenBucketLimiter, prompt: str, max_tokens: int = 1000):
estimated_cost = len(prompt) // 4 + max_tokens
max_retries = 5
base_delay = 1.0
for attempt in range(max_retries):
await limiter.acquire(estimated_cost)
try:
response = await client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": prompt}],
max_tokens=max_tokens
)
return response
except RateLimitError as exc:
if attempt == max_retries - 1:
raise exc
retry_after = getattr(exc, "retry_after", None)
if retry_after:
wait_duration = float(retry_after)
else:
wait_duration = base_delay * (2 ** attempt) + random.uniform(0.1, 0.5)
await asyncio.sleep(wait_duration)
This pattern smooths outbound traffic spikes on the client side, keeping token throughput aligned with your account capacity before requests ever hit the OpenAI edge proxy.
Eliminate Prompt Token Bottlenecks with MCP Workspaces
Store and index your file collection in Fast.io. Connect your AI agents through the remote MCP server to retrieve relevant context on demand without exhausting OpenAI TPM limits. Monthly plans start with a 14-day free trial, which requires a credit card.
Why Ingesting Raw Documents into Prompts Exhausts Token Limits
When engineering teams encounter OpenAI TPM limits, standard advice focuses on requesting tier increases, adding credit cards, or slowing down processing loops. While rate limits scale across account tiers, pushing full document collections directly into prompt payloads remains an architectural bottleneck.
Consider an enterprise knowledge base containing hundreds of contract agreements, design specifications, or customer case files. An agent tasked with extracting key contract clauses or answering technical questions might attempt to pack three 40-page PDF files into a single prompt. At roughly 750 words per page and 1.3 tokens per word, those three documents represent nearly 120,000 prompt tokens.
Even on a Tier 3 account with an 800,000 TPM ceiling, dispatching seven concurrent agent queries of that magnitude completely exhausts available per-minute capacity. On a Tier 1 or Tier 2 account, a single 120,000-token prompt fails immediately because the payload exceeds the total minute allowance of the model.
Passing massive file payloads directly into inference context windows creates brittle pipelines and rapid quota exhaustion. Frontier model context windows accept large inputs, but every additional page increases latency, inflates inference expenditure, and consumes valuable TPM headroom needed by concurrent tasks.
The Token Penalty of Direct Document Ingestion
Direct document ingestion into prompt context carries severe operational liabilities:
- Compounded Latency: Processing 100,000 input tokens introduces multi-second time-to-first-token latency before generation begins, degrading interactive user experiences.
- Linear Cost Accumulation: Paying inference token rates on dozens of pages of irrelevant contextual background for every conversational turn inflates monthly API bills.
- Context Degradation: As context windows fill with peripheral text, attention mechanisms experience quality degradation on specific needle-in-a-haystack detail retrieval.
- Immediate TPM Bottlenecks: A single automated worker task can consume the entire per-minute budget of an organization, blocking critical customer-facing API calls across other applications.
Rather than moving massive document text through inference prompts, production architectures decouple file storage from model reasoning.
Retrieval Grounding with Remote MCP Workspaces
The proven architectural solution to prompt token bloat is retrieval grounding. Instead of attaching full documents to prompt payloads, files reside in an indexed workspace where an AI assistant queries semantic search endpoints to extract only relevant excerpts.
Fast.io provides shared cloud workspaces designed for human and agent collaboration. Files stored in a Fast.io workspace, whether uploaded directly or synced from Google Drive, Dropbox, Box, or OneDrive on a schedule or on demand, are processed through Intelligence Mode. Once Intelligence Mode is enabled, documents are automatically indexed for hybrid search, combining full-text lexical indexing with semantic embeddings without requiring a separate vector database.
AI agents connect to Fast.io using the remote Model Context Protocol (MCP) server over Streamable HTTP:
- General Agents and Claude: Connect at
https://mcp.fast.io/mcp/toolsusing OAuth or API credentials as documented in the Fast.io MCP setup guide. - ChatGPT and Codex: Install the Fastio plugin from the ChatGPT plugin directory, or configure a custom connection at
https://mcp.fast.io/mcp/operations. - Coding Agents (Claude Code, Cursor, Cline): Connect at
https://mcp.fast.io/mcp/code.
When an agent needs information from a 200-page operational manual, it dispatches an MCP search query. The workspace returns three precise text passages totaling 450 tokens. The agent passes those 450 tokens to OpenAI instead of the 150,000 tokens of the entire manual. This reduces the prompt footprint from dozens of pages to a few targeted paragraphs, keeping workloads well below Tier 1 TPM ceilings while delivering grounded citations.
Workspaces feature per-file version history, a detailed activity log of all file changes, and role-based permissions configured per organization, workspace, and share. Monthly plans start with a 14-day free trial, which requires a credit card. Subscription tiers on the Fast.io pricing page include Starter, Business, and Enterprise plans with shared workspaces, Intelligence Mode indexing, and remote MCP connectivity.
Steps to Prevent Production Token Ceiling Bottlenecks
Scaling AI pipelines without hitting rate limits requires defensive engineering practices across prompt construction, model selection, and execution modes. Applying the following architectural strategies minimizes token consumption and prevents unexpected service interruptions:
- Tune Output Parameters Consistently: Never leave
max_tokensormax_completion_tokensunset. Specify explicit output budgets matched to expected response lengths so the API gateway does not hold excessive reserved capacity in your rolling token bucket. - Implement Prompt Compaction: Strip verbose markdown formatting, repetitive instructions, and redundant examples from system prompts. Compact JSON schemas using concise type declarations instead of sprawling description blocks.
- Route Workloads Across Model Tiers: Reserve flagship models like GPT-4o for complex reasoning, multi-step planning, and final synthesis. Route classification, summarization, entity extraction, and routing logic to GPT-4o mini, which provides substantially higher TPM ceilings at lower unit costs.
- Apply Prompt Caching: OpenAI automatically caches prompt prefixes that exceed 1,024 tokens on supported models. Structure prompt templates with static instructions and tool definitions at the beginning, appending dynamic user inputs at the end to maximize cache hits.
- Offload Asynchronous Workloads to Batch API: Non-interactive workloads such as nightly document evaluations, bulk catalog tagging, and offline evaluations should execute through the OpenAI Batch API. Batch requests operate under separate queue allowances that do not draw down real-time synchronous TPM budgets, while delivering substantial cost savings.
Prompt Compression and Output Parameter Tuning
System prompt overhead compounds across every API call dispatched by an agent fleet. An agent executing 500 tool calls an hour with a 2,000-token system prompt spends 1,000,000 tokens per hour solely on static instructions.
Reviewing system instructions to eliminate decorative prose, redundant phrasing, and repetitive few-shot examples often trims prompt size by half without impacting model adherence. When returning structured data, define concise JSON schemas that omit unnecessary key descriptions.
Pairing prompt compression with explicit max_tokens boundaries prevents gateway capacity reservation spikes. If an extraction task produces a 50-token JSON response, setting max_tokens: 150 ensures the gateway reserves only 150 tokens during inference, preserving bucket headroom for concurrent pipeline tasks.
Hybrid Routing and Offline Batch Offloading
Production systems rarely need flagship frontier models for every step in a multi-stage workflow. Establishing a hybrid routing pattern distributes token load across multiple distinct rate limit allocations.
For example, a customer support intake pipeline can deploy a three-stage routing architecture:
Incoming Customer Request
│
▼
[ Stage 1: GPT-4o mini ] ──► Intent Classification & Entity Extraction (2,000,000 TPM pool)
│
▼
[ Stage 2: Fast.io MCP ] ──► Retrieve Precise Knowledge Excerpts (0 OpenAI tokens)
│
▼
[ Stage 3: GPT-4o ] ──► Synthesize Final Customer Response (30,000 TPM pool)
In this pipeline, the high-throughput classification step runs against GPT-4o mini's expansive token ceiling. Knowledge retrieval occurs inside the Fast.io workspace over MCP, consuming zero OpenAI prompt tokens. Only the final response synthesis consumes tokens from the more restrictive GPT-4o allocation.
For background data processing that does not require synchronous sub-second user responses, dispatch requests through the OpenAI Batch API. Batch jobs run within a 24-hour SLA under dedicated queue allowances, freeing your synchronous TPM capacity entirely for real-time customer traffic.
Sources
References used to verify factual claims in this guide.
-
With a 10K TPM limit, the same bug is capped at 14.4 million tokens per day and surfaces as HTTP 429 errors instead of a large invoice line.
-
The Python SDK retries HTTP 429 responses up to two times by default when it can safely resend the request body.
Frequently Asked Questions
What is an OpenAI TPM limit?
An OpenAI TPM (Tokens Per Minute) limit is a rate limit that caps the total number of input and output tokens an organization can process through a specific model within a rolling 60-second window. It prevents infrastructure overload and enforces fair resource sharing across API consumers.
How is OpenAI TPM calculated across requests?
OpenAI calculates TPM using a continuous 60-second sliding window that meters both input prompt tokens and output completion tokens. When a request begins, the gateway reserves prompt tokens plus the maximum potential output tokens defined by max_tokens, reconciling actual usage once generation finishes.
How do you avoid reaching TPM limits in the OpenAI API?
You avoid TPM limits by setting explicit max_tokens ceilings, compressing system prompts, routing simple tasks to high-throughput models like GPT-4o mini, implementing client-side token bucket limiters with exponential backoff, and using external retrieval like Fast.io MCP search instead of passing large raw files into prompt contexts.
Does creating multiple API keys increase an organization's TPM allocation?
No. Rate limits are enforced at the organization and project levels. All API keys generated within an organization or assigned project share the exact same underlying TPM and RPM quotas.
What is the operational difference between TPM and RPM?
RPM (Requests Per Minute) restricts the absolute count of HTTP calls an application can make in sixty seconds, while TPM (Tokens Per Minute) restricts the total volume of text processed across those calls. A single long document request can exhaust TPM while consuming only one request toward your RPM budget.
How does prompt caching impact TPM consumption?
Cached prompt tokens still count toward your organization TPM rate limit when establishing request concurrency, although they benefit from reduced pricing and faster generation latency on supported models.
What should an application do when receiving a tpm limit exceeded openai error?
When receiving an HTTP 429 rate_limit_exceeded error, the client should inspect the retry-after response header, apply exponential backoff with randomized jitter, reduce concurrent request volume, and trim input prompt lengths before retrying the call.
Related Resources
Eliminate Prompt Token Bottlenecks with MCP Workspaces
Store and index your file collection in Fast.io. Connect your AI agents through the remote MCP server to retrieve relevant context on demand without exhausting OpenAI TPM limits. Monthly plans start with a 14-day free trial, which requires a credit card.