Rate Limits
Understanding API rate limits and how to handle them in your application.
Overview
Rate limits help ensure fair usage and protect the API from abuse. Limits vary based on your application's environment and the specific endpoint.
Limits by Environment
| Environment | Rate Limit | Window |
|---|---|---|
| Sandbox | 30 requests | per minute |
| Production | 800 requests | per minute |
Need higher limits? Contact us at developers@velora.tv to discuss your requirements.
Rate Limit Headers
Every API response includes headers to help you track your rate limit status:
| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests allowed per window |
X-RateLimit-Remaining | Requests remaining in current window |
X-RateLimit-Reset | Unix timestamp when the limit resets |
Example Response Headers
HTTP/1.1 200 OK X-RateLimit-Limit: 800 X-RateLimit-Remaining: 742 X-RateLimit-Reset: 1737213600
Handling Rate Limits
When you exceed the rate limit, you'll receive a 429 Too Many Requests response:
HTTP/1.1 429 Too Many Requests
Content-Type: application/json
Retry-After: 45
X-RateLimit-Limit: 800
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1737213600
{
"error": "rate_limit_exceeded",
"message": "Too many requests. Please retry after 45 seconds.",
"retry_after": 45
}Retry Logic Example
async function makeRequestWithRetry(url, options, maxRetries = 3) {
for (let attempt = 0; attempt < maxRetries; attempt++) {
const response = await fetch(url, options);
if (response.status === 429) {
const retryAfter = parseInt(
response.headers.get('Retry-After') || '60',
10
);
console.log(`Rate limited. Retrying after ${retryAfter}s...`);
await sleep(retryAfter * 1000);
continue;
}
return response;
}
throw new Error('Max retries exceeded');
}
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}Best Practices
- ✓Monitor rate limit headers
Check X-RateLimit-Remaining before making burst requests
- ✓Implement exponential backoff
Use increasing delays between retries: 1s, 2s, 4s, 8s...
- ✓Cache responses
Reduce API calls by caching data that doesn't change frequently
- ✓Use webhooks for real-time data
Instead of polling, subscribe to webhooks for event notifications
- ✓Batch requests when possible
Some endpoints support fetching multiple resources at once
Endpoint-Specific Limits
Some endpoints have additional limits to protect specific resources:
| Endpoint | Limit | Notes |
|---|---|---|
| POST /api/developer/oauth/token | 10/min | Token generation |
| POST /api/integrations/oauth/chat/:channelId/messages | 30/min | Chat messages (OAuth) |
| POST /api/developer/apps | 5/hour | App creation |