Rate Limits
Rate limits protect the API from abuse and ensure fair access for all users. Limits are applied per API key and vary by account tier.
Limits by Tier
| Tier | RPM (Requests/min) | TPM (Tokens/min) | Concurrent Requests |
|---|---|---|---|
| Free | 10 | 40,000 | 2 |
| Standard | 60 | 200,000 | 10 |
| Pro | 200 | 1,000,000 | 30 |
| Enterprise | Custom | Custom | Custom |
RPM = Requests Per Minute, TPM = Tokens Per Minute. Both limits apply independently — you may hit either one first.
Rate Limit Headers
Every API response includes headers indicating your current usage:
| Header | Description |
|---|---|
x-ratelimit-limit-requests | Max requests per minute |
x-ratelimit-limit-tokens | Max tokens per minute |
x-ratelimit-remaining-requests | Remaining requests in current window |
x-ratelimit-remaining-tokens | Remaining tokens in current window |
x-ratelimit-reset-requests | Seconds until request limit resets |
x-ratelimit-reset-tokens | Seconds until token limit resets |
Handling Rate Limits
429 Response
When you exceed a rate limit, the API returns a 429 Too Many Requests response:
{
"error": {
"message": "Rate limit exceeded",
"type": "rate_limit_error",
"code": "rate_limit_exceeded"
}
}Retry Strategy
Implement exponential backoff when receiving 429 errors:
import time
def api_call_with_retry(client, max_retries=5, **kwargs):
for attempt in range(max_retries):
try:
return client.chat.completions.create(**kwargs)
except Exception as e:
if "rate_limit" in str(e) and attempt < max_retries - 1:
wait_time = (2 ** attempt) + 1
time.sleep(wait_time)
else:
raiseBest Practices
- Monitor headers — Track
x-ratelimit-remaining-*to anticipate limits - Batch requests — Reduce the number of API calls by batching where possible
- Cache responses — Avoid duplicate requests for the same content
- Upgrade tier — Contact sales for higher limits
- Use streaming — Streaming responses consume tokens gradually, reducing burst TPM
Model-Specific Limits
Some high-demand models may have lower effective rate limits during peak usage. Check the response headers for real-time limits.
Upgrading
To increase your rate limits, contact support@linkwo.com to upgrade to a higher tier. Enterprise customers can request custom limits.
Related
- API Endpoints — Available endpoints
- Error Codes — Error handling reference