Skip to main content

Limits by Plan

PlanRequests/Minute
Free20
Starter60
Pro200
ScaleCustom

Headers

Rate limit info is returned in response headers:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1704470400

Handling Rate Limits

Check Headers

const response = await fetch('https://api.boostgpt.co/v1/bots', {
  headers: { 'Authorization': `Bearer ${apiKey}` }
});

const remaining = response.headers.get('X-RateLimit-Remaining');
console.log(`Requests remaining: ${remaining}`);

Exponential Backoff

async function makeRequestWithRetry(url, options, maxRetries = 3) {
  for (let i = 0; i < maxRetries; i++) {
    const response = await fetch(url, options);

    if (response.status === 429) {
      const wait = Math.pow(2, i) * 1000;
      await new Promise(resolve => setTimeout(resolve, wait));
      continue;
    }

    return response;
  }
  throw new Error('Max retries exceeded');
}

Next Steps