Rate Limits
The Optimaite API enforces rate limits to ensure fair usage and platform stability. All API keys are subject to the same limits.
Current Limits
| Plan | Requests per minute | Requests per day | Burst limit |
|---|---|---|---|
| Standard | 60 | 10,000 | 10 requests/second |
| Professional | 200 | 50,000 | 30 requests/second |
| Enterprise | Custom | Custom | Custom |
Rate Limit Headers
Every API response includes headers that indicate your current rate limit status:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1719360000
| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests allowed per minute |
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp when the rate limit window resets |
Handling Rate Limits
When you exceed the rate limit, the API returns a 429 Too Many Requests response:
{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Retry after 30 seconds.",
"retry_after": 30
}
}
Best Practices
- Monitor headers: Check
X-RateLimit-Remainingbefore making batch requests - Exponential backoff: On 429, wait and retry with increasing delays
- Batch operations: Use bulk endpoints where available instead of individual requests
- Cache responses: Cache frequently accessed data to reduce API calls
- Webhooks: Use webhooks for event-driven updates instead of polling
Example: Exponential Backoff
import time
import requests
def api_request(url, max_retries=5):
for attempt in range(max_retries):
response = requests.get(url, headers={"Authorization": f"Bearer {API_KEY}"})
if response.status_code == 429:
retry_after = response.json()["error"]["retry_after"]
wait = max(retry_after, 2 ** attempt)
time.sleep(wait)
continue
return response
raise Exception("Max retries exceeded")
Next Steps
- Authentication -- Set up API keys
- Cases API -- Start making requests
Was this helpful?