Rate Limits

Query your organization's per-model rate limit configuration and real-time usage.

Overview

RouterHub enforces rate limits at the organization × model level. Each organization can have independent RPM (Requests Per Minute) and TPM (Tokens Per Minute) limits configured for each model.

Use the GET /v1/quotas endpoint to retrieve your current limits and real-time usage for all configured models.

  • RPM — Maximum number of API requests allowed per 60-second sliding window.
  • TPM — Maximum number of tokens (input + output) allowed per 60-second sliding window.

Get Rate Limits

GET /v1/quotas

Returns a list of all model-level rate limits configured for the organization that owns the API key, along with current usage within the 60-second sliding window.

Authentication

Requires a valid API key via Authorization: Bearer header. The organization is determined automatically from the key.

Example Request

curl https://api.routerhub.ai/v1/quotas \
  -H "Authorization: Bearer $ROUTERHUB_API_KEY"

Example Response

{
  "object": "list",
  "data": [
    {
      "model": "anthropic/claude-opus-4.6",
      "rpm_limit": 60,
      "tpm_limit": 100000,
      "current_rpm": 12,
      "current_tpm": 34500,
      "remains_rpm": 48,
      "remains_tpm": 65500
    },
    {
      "model": "openai/gpt-5.6",
      "rpm_limit": 30,
      "tpm_limit": null,
      "current_rpm": 5,
      "current_tpm": 0,
      "remains_rpm": 25,
      "remains_tpm": null
    }
  ]
}

Response Fields

Field Type Description
object string Always "list".
data array Array of quota entries, one per configured model. Sorted alphabetically by model name.

Quota Entry Object

Field Type Description
model string The model identifier (e.g. "anthropic/claude-opus-4.6").
rpm_limit integer | null Maximum requests per minute. null means this dimension is uncapped.
tpm_limit integer | null Maximum tokens per minute. null means this dimension is uncapped.
current_rpm integer Number of requests made in the current 60-second window.
current_tpm integer Number of tokens consumed in the current 60-second window.
remains_rpm integer | null Remaining requests allowed (rpm_limit - current_rpm, minimum 0). null when uncapped.
remains_tpm integer | null Remaining tokens allowed (tpm_limit - current_tpm, minimum 0). null when uncapped.

Behavior

Sliding Window

Rate limits use a 60-second sliding window. Usage counts decay continuously — once a request ages past 60 seconds, it no longer counts toward the limit.

Null vs Zero

  • null for rpm_limit or tpm_limit means that dimension has no limit configured (uncapped). You can make unlimited requests/tokens on that dimension.
  • Only models with at least one dimension configured (RPM or TPM > 0) appear in the response.

Enforcement

When you exceed a configured limit, subsequent requests to that model will receive an HTTP 429 Too Many Requests response until the window slides past your usage peak:

{
  "error": {
    "message": "rate limit exceeded",
    "type": "rate_limit_error",
    "param": null,
    "code": null
  }
}

Empty Response

If your organization has no model-level rate limits configured, the endpoint returns an empty list:

{
  "object": "list",
  "data": []
}

Code Examples

Python

import requests

resp = requests.get(
    "https://api.routerhub.ai/v1/quotas",
    headers={"Authorization": f"Bearer {api_key}"}
)
quotas = resp.json()

for entry in quotas["data"]:
    print(f"{entry['model']}: RPM {entry['current_rpm']}/{entry['rpm_limit']}, "
          f"TPM {entry['current_tpm']}/{entry['tpm_limit']}")

JavaScript (Node.js)

const resp = await fetch("https://api.routerhub.ai/v1/quotas", {
  headers: { Authorization: `Bearer ${apiKey}` }
});
const { data } = await resp.json();

data.forEach(entry => {
  console.log(`${entry.model}: RPM ${entry.current_rpm}/${entry.rpm_limit}`);
});