Skip to main content
Routeway applies rate limits to ensure fair resource allocation and service stability. Rate limit policies depend on whether you are using free models or Pay-As-You-Go models.

Rate Limit Tiers

1. Free Models (Model IDs ending in :free)

Free models (e.g., deepseek-r1:free) are subject to the following rate limits:
  • 5 Requests Per Minute (RPM)
  • 200 Requests Per Day (RPD)
Once exceeded, requests to free models will return a 429 status code.

2. Pay-As-You-Go Models

For Pay-As-You-Go models (all model IDs without the :free suffix), Routeway does not enforce API-level rate limits.
To protect service availability and prevent abuse, standard rate limits and DDoS protection are active at the network edge.

Rate Limit Response Schema

When you exceed a rate limit, the API returns an HTTP 429 Too Many Requests status code with the following JSON payload:
{
  "error": {
    "message": "API key per-minute rate limit exceeded (60 RPM).",
    "type": "rate_limit_error",
    "param": null,
    "code": "rate_limit_exceeded",
    "status_code": 429,
    "id": "b3fca8a1",
    "docs": "https://docs.routeway.ai",
    "support": "https://discord.gg/RjX2CpdPpd"
  }
}
FieldDescription
messageHuman-readable explanation of which limit was hit.
typeAlways rate_limit_error.
codeMachine-readable error code (rate_limit_exceeded).
status_codeHTTP status code (429).
idUnique trace/request identifier for debugging.
docsLink to this documentation.
supportLink to our Discord support server.

Rate Limit Headers

Rate-limited responses include headers to help you manage retry timing.

All Rate-Limited Responses

HeaderDescription
Retry-AfterSeconds the client must wait before making another request.

Minute-based Limits

HeaderDescription
X-RateLimit-Limit-MinuteTotal requests allowed per minute window.
X-RateLimit-Remaining-MinuteRemaining requests in the current minute window.
X-RateLimit-Reset-MinuteSeconds until the minute window resets.

Day-based Limits

HeaderDescription
X-RateLimit-Limit-DayTotal requests allowed per day.
X-RateLimit-Remaining-DayRemaining requests in the current day.
X-RateLimit-Reset-DaySeconds until the daily window resets (UTC midnight).

Best Practices: Handling 429 Errors

We recommend implementing client-side retry logic using exponential backoff with jitter to handle rate limits gracefully.
async function fetchWithRetry(fn, retries = 5, delay = 1000) {
  try {
    return await fn();
  } catch (error) {
    if (error.status === 429 && retries > 0) {
      // Use Retry-After header if available, otherwise exponential backoff
      const retryAfter = error.headers?.get('Retry-After');
      const waitMs = retryAfter
        ? parseInt(retryAfter, 10) * 1000
        : delay * 2 + Math.random() * 200;

      console.warn(`Rate limited. Retrying in ${Math.round(waitMs)}ms...`);
      await new Promise(resolve => setTimeout(resolve, waitMs));
      return fetchWithRetry(fn, retries - 1, delay * 2);
    }
    throw error;
  }
}