Skip to Content

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:

LimitExampleUse
Requests per minute100 RPMProduction API
Requests per second5 RPSCI eval scripts
Per-IP limit30 RPMPublic endpoints

See Rate limiting docs .

Per-route patterns

RouteRate limitModel default
/ci-eval10 RPMgpt-4o-mini
/dev-agent60 RPMgpt-4o-mini
/prod-chat500 RPMgpt-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.

Last updated on