Understand RPM, TPM, and RPD limits across all major AI providers. Build resilient systems that never hit a wall.
| Limit Type | Stands For | What It Controls |
|---|---|---|
| RPM | Requests Per Minute | How many API calls you can make in 60 seconds |
| TPM | Tokens Per Minute | How many tokens (input + output) you can process in 60 seconds |
| RPD | Requests Per Day | Total API calls allowed in a 24-hour window |
| Model | RPM | TPM | Notes |
|---|---|---|---|
| GPT-4o | 500 | 2,000,000 | Higher for enterprise tiers |
| DeepSeek V4 | 1,000 | 5,000,000 | Very generous limits |
| Kimi K3 | 500 | 2,000,000 | 200K context may hit TPM faster |
| GLM-5 | 500 | 2,000,000 | Consistent with OpenAI tier |
| Qwen-Plus | 500 | 2,000,000 | Scales with commitment |
| Doubao Pro | 1,000 | 4,000,000 | Higher for batch processing |
| Claude 3.5 | 400 | 2,000,000 | Stricter RPM, generous TPM |
* Limits vary by pricing tier and may change. Always check the provider's latest documentation.
When you hit a rate limit, the API returns HTTP 429 with a Retry-After header telling you how many seconds to wait.
HTTP/1.1 429 Too Many Requests
Retry-After: 12
Content-Type: application/json
{
"error": {
"type": "rate_limit_exceeded",
"message": "Rate limit exceeded. Please retry after 12 seconds."
}
}
Some providers also include headers showing your current usage:
x-ratelimit-limit-requests: 500 x-ratelimit-remaining-requests: 12 x-ratelimit-limit-tokens: 2000000 x-ratelimit-remaining-tokens: 450000
The industry-standard retry pattern. On 429, wait progressively longer between retries, plus random jitter to avoid thundering herd.
import random, time def call_with_retry(func, max_retries=5): for attempt in range(max_retries): try: return func() except RateLimitError as e: if attempt == max_retries - 1: raise # Exponential backoff: 1s, 2s, 4s, 8s, 16s + random jitter delay = (2 ** attempt) + random.uniform(0, 1) time.sleep(delay)
Always read the rate limit headers on every response. Track remaining quota and proactively slow down before hitting limits.
Implement a client-side token bucket that mirrors the API's limits. This prevents 429s entirely by pacing requests before they leave your application.
Not all requests are equal. Queue user-facing chat requests above background batch jobs. When approaching limits, defer non-critical work.
If you have 50 independent prompts, batching them into fewer requests with multiple messages saves RPM. But watch TPM — batched requests use more tokens per call.
For high-volume applications, distribute load across multiple API keys or use a gateway (like TokenEase) that automatically load-balances across provider endpoints.
A hung request consumes your RPM slot. Set 30-60 second timeouts and retry with backoff rather than waiting indefinitely.
TokenEase handles rate limiting automatically:
TokenEase handles retries, load balancing, and fallback automatically. One API key. Unlimited scale.
Get Free API Key