When to Use This
You’re running a production integration that:- Makes many requests per minute (near or above your tier limit)
- Uses concurrent workers (background jobs, async handlers)
- Hits endpoint-specific limits (e.g. Mave max 10 concurrent, Focus Groups max 5)
- Needs to avoid 429s proactively instead of only reacting with retries
- Proactive throttling using
X-RateLimit-*headers - Token bucket style rate limiting to smooth request rate
- Concurrency limiting (semaphores) for endpoint-specific caps
- Request queuing when you must process many items without bursting
- Production checklist and metrics to monitor
Rate Limit Recap
Endpoint-specific concurrency limits:
Every response includes:
Pattern 1: Proactive Throttling from Headers
Don’t burst to the limit. After each request, readX-RateLimit-Remaining. If it’s low (e.g. < 10), slow down before you hit 429.
Pattern 2: Token Bucket (Smooth Request Rate)
A token bucket lets you maintain a steady request rate instead of bursting. Refill tokens over time; consume one per request. If no tokens, wait.Pattern 3: Concurrency Limiting (Semaphore)
For endpoints with max concurrent limits (Mave: 10, Focus Groups: 5, Video: 3), use a semaphore so you never exceed that many in-flight requests.Pattern 4: Request Queue for Batch Processing
When you have a list of items to process (e.g. 500 chat requests), push them into a queue and process at a controlled rate. Prevents spikes and respects limits.Pattern 5: Exponential Backoff on 429 (Reactive)
When you do get a 429, respectRetry-After and use exponential backoff. Combine with jitter to avoid thundering herd.
Production Checklist
Know your tier
Know your tier
Confirm your rate limit (60/120/240/600 rpm). Design throttling for 80–90% of that to leave headroom.
Respect endpoint concurrency
Respect endpoint concurrency
Mave (10), Focus Groups (5), Video (3). Use semaphores or equivalent.
Log rate limit headers
Log rate limit headers
Log
X-RateLimit-Remaining and X-RateLimit-Reset periodically. Alert when remaining < 5 frequently.Batch when possible
Batch when possible
Single chat with full conversation history instead of many single-message calls.
Test under load
Test under load
Run load tests at 90% of your limit. Verify you get headers and throttle correctly.
Metrics to Monitor
See Also
Rate Limits Guide
Tiers, headers, and basic handling
Error Handling Patterns
Retry logic and backoff
Credits
Credit usage (separate from rate limits)
Contact Sales
Higher limits for Enterprise