Skip to main content
Rate limiting helps you control costs and prevent abuse by limiting the number of requests that can be made in a given time period.

Configuring Rate Limits

Set rate limits in your project settings:
  1. Go to your project Settings
  2. Navigate to GatewayRate Limiting
  3. Configure your limits

Limit Types

Requests Per Minute (RPM)

Limit the total number of requests per minute:

Tokens Per Minute (TPM)

Limit the total tokens (input + output) per minute:

Daily Request Limit

Limit total requests per day:

Rate Limit Headers

When rate limiting is enabled, responses include headers:

Handling Rate Limits

When a rate limit is exceeded, the gateway returns a 429 Too Many Requests response:

Implementing Retries

Per-User Rate Limits

You can apply rate limits per user by including user metadata:
Then configure per-user limits in the dashboard.

Rate Limit Alerts

Set up alerts to notify you when approaching limits:
  1. Go to SettingsAlerts
  2. Add a rate limit alert
  3. Choose threshold (e.g., 80% of limit)
  4. Select notification channel (email, Slack, webhook)