Cloudflare AI Gateway Multi-Provider Routing & Price Sorting
Cloudflare's December 2 AI Gateway multi-provider routing enables cross-cloud fallback, price-based sorting, and header controls ahead of the Dec 9 default rollout.

Q. Can you automatically route Claude or Gemini requests across multiple cloud providers from a single API endpoint? Yes. With Multi-Provider Routing in Cloudflare AI Gateway (announced December 2, 2026), a request for a model can be routed to any provider that serves it—such as Anthropic or Google Vertex AI—and automatically fall back if one provider fails. Starting December 9, 2026, it is enabled by default for newly created gateways.
⚠️ Accuracy guardrail: This article only covers facts directly verified from the official Cloudflare Changelog (December 2, 2026) and the Cloudflare AI Gateway Multi-provider routing documentation as of December 3, 2026. Real-time per-provider token pricing tables in the Model Catalog, internal health-check thresholds or timeouts during failover, and regional latency differences were not specified in the documentation and remain unverified.
30-second summary
- What changed: Cloudflare AI Gateway now supports multi-provider routing, letting a single model request use any provider that hosts that model (announced December 2, 2026).
- Default rollout date: Gateways created on or after December 9, 2026 have it on by default; existing gateways keep it off until enabled in Settings or via API (
multiprovider_enabled: true). - Newly supported providers & models: Groq (
openai/gpt-oss-20b,alibaba/qwen3.8-27b), Google Vertex AI (Anthropic Claude), Google AI Studio (Google Gemini), and Fireworks (moonshotai/kimi-k3,deepseek-ai/deepseek-v4.1-flash-1017). - Per-request control: Use
cf-aig-allowed-providers,cf-aig-provider-order, andcf-aig-provider-sort: priceheaders (oroptions.extraHeaderson/ai/run) to restrict, prioritize, or sort by price.
1. What is multi-provider routing — ending single-provider lock-in
Multi-provider routing groups multiple hosting providers under one model identifier to handle both failover and cost optimization. Previously, calling a model usually sent traffic only to its primary provider—the company that built it, such as Anthropic for anthropic/claude-opus-5.5. If that provider hit an outage or rate limit, the gateway could not shift traffic to another cloud.
When enabled on a gateway, every provider serving that model enters the routing pool. If one provider fails or becomes unhealthy, AI Gateway automatically routes the request to another available provider.

Official Cloudflare AI Gateway documentation for Multi-provider routing (verified December 3, 2026).
2. Default on December 9 — existing gateways and exceptions
Gateways created on or after December 9, 2026 start with multi-provider routing turned on automatically. Gateways created before that date keep it off to preserve existing behavior until you explicitly enable it.
In the Cloudflare dashboard, go to AI > AI Gateway, open your gateway's Settings, turn on Multi-Provider Routing, and save. If you manage gateways via API, send a PUT update request with the following JSON body:
{
"multiprovider_enabled": true
}
There are two exceptions. Even when the gateway-wide setting is off, a request that explicitly sets cf-aig-allowed-providers can use the providers named in that header. In addition, Model aliases can always use every provider of their models regardless of whether the gateway setting is on or off.
3. Newly opened provider combinations and supported models
This release expands cross-provider access across Anthropic, Google, and open-weight models. The December 2 Changelog lists the following additions for gateways with multi-provider routing enabled:
| Provider | Supported models (examples) | Practical use case |
|---|---|---|
| Google Vertex AI | Anthropic Claude models | Using GCP credits or enterprise quotas |
| Google AI Studio | Google Gemini models | Fast prototyping and direct integration |
| Groq | openai/gpt-oss-20b, alibaba/qwen3.8-27b |
Low-latency inference separation |
| Fireworks | moonshotai/kimi-k3, deepseek-ai/deepseek-v4.1-flash-1017 |
Alternate hosting for open-weight models |
To look up the exact provider slugs (IDs) for any model, check the Model Catalog inside the Cloudflare dashboard.
4. Controlling priority and price sorting with three headers
You can restrict providers, set preference order, and sort by token price using three HTTP request headers without rewriting application logic. Each header serves a distinct rule:
| Header | Example value | Behavior and caveats |
|---|---|---|
cf-aig-allowed-providers |
groq,fireworks |
Uses only listed providers. Returns 400 if none serve the model |
cf-aig-provider-order |
google-vertex-ai |
Tries listed providers first (preference). Can fall back to unlisted providers |
cf-aig-provider-sort |
price |
Orders remaining providers not in cf-aig-provider-order by lowest input/output token price |

Summary of the three multi-provider routing control headers and edge rules (based on Cloudflare docs).
For example, anthropic/claude-haiku-5.5 is served by both Anthropic and Google Vertex AI. On an enabled gateway, adding cf-aig-provider-order tries Vertex AI first and falls back to Anthropic if needed:
curl "https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/messages" \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--header "cf-aig-provider-order: google-vertex-ai" \
--data '{
"model": "anthropic/claude-haiku-5.5",
"messages": [{ "role": "user", "content": "Reply with a short greeting." }],
"max_tokens": 128
}'
Keep one caveat in mind: cf-aig-provider-order is a preference, not a filter. It does not remove unlisted providers from the pool, nor does it grant access to non-primary providers when multi-provider routing is off—use cf-aig-allowed-providers for strict restriction.
If your client SDK cannot attach custom HTTP headers, Cloudflare also supports passing them inside options.extraHeaders in the request body of the /ai/run endpoint:
{
"model": "anthropic/claude-haiku-5.5",
"input": {
"messages": [{ "role": "user", "content": "Reply with a short greeting." }],
"max_tokens": 128
},
"options": {
"extraHeaders": {
"cf-aig-provider-order": "google-vertex-ai"
}
}
}
5. Operational check — inspecting logs instead of the response body
The API response body does not state which provider served the request. To verify routing behavior or reconcile billing, take the cf-aig-log-id response header and look up the provider field in your AI Gateway logs.

Backend workflow reviewing provider priority and gateway logs behind a single endpoint (AI-generated image).
For teams already keeping serverless code lean with Cloudflare Workers Temporal API support or running Claude Managed Agents on Amazon Bedrock alongside direct APIs, centralizing routing in front of those providers becomes much simpler.
Toris's take
For solo developers and small SaaS teams, the best way to adopt this is around cost predictability and zero-downtime fallback:
- When you have cloud credits: Put that cloud first via
cf-aig-provider-order: google-vertex-ai, letting traffic fall back to the primary provider if quotas run out or errors spike. - For batch jobs and background summarization: Enable
cf-aig-provider-sort: priceso remaining providers are automatically tried from lowest input/output token price upward. - For strict data-residency endpoints: Always lock traffic with
cf-aig-allowed-providersso requests never silently fail over to an unapproved provider.
Sources
Advertisement