infrastructure
Rate Limits
Understand API rate limits by account tier and how to handle them.
Rate limits protect the API from abuse and ensure fair access for all users. Limits are applied per API key.
Where limits come from
Rate limits are configured per API key, not by a fixed plan. When a key is issued we include its RPM (requests per minute), TPM (tokens per minute) and concurrency ceiling; the values depend on your actual usage and how you are connected.
To adjust them, write to support@linkwo.com with your current QPS and peak pattern — there is no plan to switch.
RPM and TPM are independent — 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