Rate Limiting
The Betflow B2B API enforces rate limits to ensure fair usage and platform stability. Limits are applied per client across three time windows.
Rate Limit Windows
| Window | Default Limit |
|---|---|
| Per minute | 60 requests |
| Per hour | 1,000 requests |
| Per day | 10,000 requests |
Your actual limits may differ based on your account tier and configuration. Contact the Betflow team to check or adjust your limits.
How It Works
- Rate limits are tracked per client (identified by your API key or JWT
client_id). - Each time window uses a sliding counter — the window resets after the time period elapses from your first request in that window.
- If any window limit is exceeded, the API returns
429 Too Many Requests.
Rate Limit Response
When you exceed a rate limit, you'll receive:
HTTP/1.1 429 Too Many Requests
Content-Type: application/json
{
"error": "rate limit exceeded"
}
Handling Rate Limits
When you receive a 429 response:
- Back off — wait before retrying. A simple strategy is to wait until the current minute window resets.
- Implement exponential backoff — for automated systems, use exponential backoff with jitter to avoid thundering herd issues.
- Reduce request frequency — if you're consistently hitting limits, consider caching responses, batching requests, or requesting a limit increase.
Example: Exponential Backoff (JavaScript)
async function fetchWithRetry(url, options, maxRetries = 3) {
for (let attempt = 0; attempt <= maxRetries; attempt++) {
const response = await fetch(url, options);
if (response.status === 429 && attempt < maxRetries) {
const delay = Math.pow(2, attempt) * 1000 + Math.random() * 1000;
await new Promise(resolve => setTimeout(resolve, delay));
continue;
}
return response;
}
}
Account Tiers
Rate limits can be configured at the tenant level (shared across all your clients) or at the client level (specific to individual API keys).
| Tier | Typical Limits |
|---|---|
free | System defaults (60/min, 1,000/hr, 10,000/day) |
pro | Higher limits based on agreement |
enterprise | Custom limits based on agreement |
Contact the Betflow team to discuss your rate limit requirements.