Cloudflare AI Gateway rate limits
Cloudflare AI Gateway rate limits control how many requests reach your provider — protecting budgets when agent loops or buggy clients spike traffic.
Hub: Tokenminning with Cloudflare AI Gateway.
This page answers cloudflare ai gateway rate limit and cloudflare ai gateway throttle.
Configure rate limits
In Cloudflare dashboard → AI Gateway → your gateway → Rate limiting:
| Limit | Example | Use |
|---|---|---|
| Requests per minute | 100 RPM | Production API |
| Requests per second | 5 RPS | CI eval scripts |
| Per-IP limit | 30 RPM | Public endpoints |
See Rate limiting docs .
Per-route patterns
| Route | Rate limit | Model default |
|---|---|---|
/ci-eval | 10 RPM | gpt-4o-mini |
/dev-agent | 60 RPM | gpt-4o-mini |
/prod-chat | 500 RPM | gpt-4o with monitoring |
Separate gateway instances or routes for CI vs production — analytics attributes spend per route.
Agent loop protection
Rate limits return errors before the provider call. Combine with maxSteps in your agent framework:
if (!response.ok && response.status === 429) {
throw new Error("Rate limit — stop agent loop");
}Spending guardrails
- Rate-limit CI routes aggressively (5–10 RPM)
- Alert on Analytics when request volume spikes 4× week-over-week
- Pair rate limits with cheap model defaults
- Use caching to reduce provider calls within the rate limit window
Troubleshooting
429 in production — limit too low. Raise cap or split features across routes.
Limits not enforcing — verify requests route through the gateway URL, not direct to the provider.
Related
Last updated on