Cloudflare AI Gateway
Route Claude, GPT and Workers AI models through your own Cloudflare AI Gateway from Fabric Agents, with the gateway's logging, caching and rate limits.
The Cloudflare AI Gateway preset sends a connection's requests through a gateway in your own Cloudflare account. Every request shows up in the gateway's logs and gets whatever caching, rate limiting and spend controls you configured there. It is a Pi SDK provider, set up with an API key like the other presets.
What you need
- A gateway created in the Cloudflare dashboard under AI → AI Gateway.
- A Cloudflare API token that is allowed to call that gateway.
- The gateway's URL, in the form
https://gateway.ai.cloudflare.com/v1/<account-id>/<gateway-id>.
Fabric Agents reads your account ID and gateway ID from the URL, so you don't enter them separately. Anything after the gateway ID (a provider suffix such as /anthropic) is ignored.
Connect in Fabric Agents
- Open Settings → AI → Connections → Add.
- Choose Cloudflare AI Gateway from the provider picker.
- Paste the API token.
- Paste the gateway URL. If it isn't a
https://gateway.ai.cloudflare.com/v1/<account>/<gateway>URL, the form says so before saving. - Click Test connection, then save.
Changing the gateway URL on an existing connection takes effect in running sessions without a restart.
Models
The gateway preset lists three families, each sent to the gateway in its native format:
| Family | Examples | Notes |
|---|---|---|
| Claude | Opus 5.5, Opus 5, Sonnet 5.5, Sonnet 5, Haiku 4.5, Fable 5.1 | Anthropic Messages format. |
| OpenAI | GPT-6.1 Sol, GPT-6 Astra / Sol / Luna, GPT-5.6, o3, o4-mini | Responses format. |
| Workers AI | Llama, Qwen, DeepSeek, GLM, Kimi, gpt-oss and other @cf/… models | Models hosted on Cloudflare's own network. |
Which of these work depends on how your gateway is set up: Claude and OpenAI models need either provider keys stored on the gateway or Cloudflare's unified billing enabled for it. Workers AI models are billed to your Cloudflare account.
Troubleshooting
| Symptom | Likely cause |
|---|---|
401 / 403 on test | The token can't use this gateway. Check its permissions in the Cloudflare dashboard. |
402 with an "insufficient credits" message | Unified billing is on but the gateway's credit balance is empty. Top it up under AI Gateway → Credits. |
| Claude or GPT models fail while Workers AI works | The gateway has no key for that provider and unified billing is off. |
Related
Databricks Mosaic AI
Connect Databricks Mosaic AI Model Serving endpoints to Fabric Agents using a workspace host and bearer token. Serving endpoints are discovered automatically, with optional AI Gateway route overrides.
Decision Models
A small, fast model that makes typed judgments for Fabric — yes/no, pick one, score — in a fraction of a second. It powers Guarded mode, adaptive thinking, the decide tool and more.