Skip to content
atom®technologiesBook a call
Production AI

Before enabling automatic model fallback, budget and test the fallback model's rate limit and spend ceiling

Cloudflare's paid-model fallback ceilings are 20 requests per minute under standard billing or 50 with prepaid credits, against a 300 default for Text Generation. Budget peak traffic against the ceiling under your real billing mode, load test at and above it, and set a fail-closed condition first.

A packed auditorium during a technology keynote

The direct answer

The fallback model's ceiling may sit far below your primary's, so the question is settled by a budget and a load test, not by the fallback configuration itself. Cloudflare's Workers AI Limits documentation lists a default Text Generation limit of 300 requests per minute, but paid models get per-account, per-model limits of 20 requests per minute under standard billing or 50 with prepaid AI Gateway credits.

Before enabling automatic fallback, write a capacity budget against the ceiling under your actual billing mode, load test at and above that ceiling, and set a fail-closed condition with a spend cap.

What automatic fallback actually does

Cloudflare's AI Gateway Fallbacks documentation states that you can specify model or provider fallbacks with the Universal endpoint to handle request failures, and that Cloudflare can trigger the fallback provider in response to request errors or predetermined request timeouts. The documentation also states that the response header cf-aig-step indicates which step successfully processed the request: step 0 means the primary model was used, step 1 means the request fell back to the second model, and each additional fallback increments the step number. You can add as many fallbacks as you need by adding another object in the array.

Two consequences follow, and both are inferences from the mechanism rather than statements in the documentation. First, fallback triggers on errors and timeouts, which is exactly the traffic pattern of a primary outage or a burst of failures, so the fallback path inherits your worst traffic, not your average traffic. Second, the cf-aig-step header is the measurement instrument for the test this article proposes: log it on every response and you can see, per request, when the fallback engaged and how often.

The ceilings that decide the answer

Cloudflare's Workers AI Limits documentation lists default rate limits by task type: Text Generation is 300 requests per minute unless the model requires the Workers Paid plan, Text Embeddings is 3000, Summarization is 1500, and Automatic Speech Recognition is 720. The same page states that models requiring the Workers Paid plan do not receive the default limit. Instead, per-account, per-model limits apply: 20 requests per minute under standard Workers AI billing, and 50 requests per minute when paid with prepaid AI Gateway credits with the gateway's billing setting set to Unified billing. The documentation notes these limits are designed for typical agentic and coding workloads, and that beta models may have lower rate limits.

This is the failure mode. A primary path sized near the default 300 requests per minute can fail over to a paid fallback model whose ceiling is 20 or 50. The inference, drawn from the Limits and Fallbacks documentation together: during a primary outage, the fallback model's per-account, per-model limit becomes the effective ceiling for the feature. As a proposed diligence step, have your load test record the exact response the feature receives when that ceiling is crossed, so the fail-closed condition you define matches observed behavior rather than an assumption.

The billing mode changes the ceiling, so test under the right one

The difference between 20 and 50 requests per minute is arithmetic from the two documented limits, not a separate finding: the same fallback model has a ceiling two and a half times higher under prepaid credits than under standard billing, purely because of how the account pays. Cloudflare's Limits documentation states the elevated limit requires loading prepaid AI Gateway credits and setting the gateway's Workers AI billing setting to Unified billing. The Pricing documentation adds that requests to frontier models using prepaid credits receive higher rate limits.

Proposed diligence step: before the load test, write down which billing mode the fallback model will actually run under in production, and test under that mode. A test run under prepaid credits that validates 50 requests per minute tells you nothing if production runs standard billing at 20. This is a proposed step, not a finding; no supplied source reports your account's configuration.

The spend side: Neurons and the daily reset

Cloudflare's Workers AI Pricing documentation states that Workers AI is priced at 0.011 dollars per 1,000 Neurons, with a free allocation of 10,000 Neurons per day, and that on the Workers Paid plan you are charged for any usage above that allocation. The documentation also states that all limits reset daily at 00:00 UTC, and that Neurons measure the GPU compute needed to perform a request. Per-model rates vary widely: the documentation lists 2457 neurons per million input tokens and 18252 neurons per million output tokens for one 1B-parameter model, versus 26668 neurons per million input tokens and 204805 neurons per million output tokens for a 70B model.

The Pricing documentation states that if you exceed any one of the limits it lists, further operations fail with an error. That statement covers the limits on that page, including the daily Neuron allocation. As a proposed step, have the load test capture what the per-model rate limit returns when the fallback ceiling is crossed, and wire the spend cap to the Neuron math: run the budget with your own token mix, because the per-model Neuron rates above suggest a larger fallback model can cost substantially more per request than a small primary, but the actual multiplier depends on your input and output lengths, which no supplied source knows.

The proposed capacity budget and load test

These are proposed diligence steps, not findings from any source. Write a fallback capacity budget with four numbers: peak requests per minute the feature routes to the primary; expected retry amplification, since retries that trigger fallback multiply calls; the fallback model's per-account, per-model ceiling under the production billing mode; and the Neuron cost of the fallback model at peak, computed from the Pricing documentation's per-model rates and your token mix. Then load test at the documented ceiling and above it, logging cf-aig-step on every response, and verify the feature fails closed with a defined user-visible state rather than retrying into the ceiling or spending without a cap. Set a spend cap for the fallback path before the test, not after.

When fallback can repeat a side effect

Capacity testing alone does not settle safety if the fallback path can repeat a side-effecting action. The AWS Builders' Library article on idempotent APIs states that retrying a service call as mitigation for a transient fault rests on a simplifying assumption that an operation can be retried without side effects, and describes idempotent API operations as the way to make sure the result of the call happens only once even if the call is made multiple times. The article gives a concrete failure: a retry of an instance-launch call could create two resources instead of one.

The inference for an AI feature: if your request triggers a side effect, such as writing a record, sending a message, or charging a payment, and fallback re-issues the request after a timeout, the fallback can duplicate that action. In that case the team needs an idempotency key or a hold-for-review rule on the side effect before automatic fallback is enabled. This applies only when the fallback path can repeat a side-effecting action, not to every AI call.

Who owns each step, and what would change the recommendation

Proposed ownership: the engineering leader who owns the release gate owns the capacity budget and the fail-closed condition; whoever owns the AI Gateway configuration owns recording the billing mode; the on-call owner owns the cf-aig-step logging and the spend-cap alert. The recommendation changes under specific conditions: if the fallback model does not require the Workers Paid plan, the default task-type limit of 300 requests per minute applies instead of the 20 or 50 paid-model ceilings; if the account runs prepaid credits with Unified billing, the ceiling is 50 rather than 20; and if the fallback path cannot repeat a side effect, the idempotency work drops out. All Cloudflare figures above come from vendor documentation for Cloudflare's products, describing those products rather than proving general model behavior, and the pages are undated live documentation, so re-check the Limits and Pricing pages before you rely on the numbers in a release review.