FabricFabric
LLM Providers

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

  1. Open Settings → AI → Connections → Add.
  2. Choose Cloudflare AI Gateway from the provider picker.
  3. Paste the API token.
  4. Paste the gateway URL. If it isn't a https://gateway.ai.cloudflare.com/v1/<account>/<gateway> URL, the form says so before saving.
  5. 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:

FamilyExamplesNotes
ClaudeOpus 5.5, Opus 5, Sonnet 5.5, Sonnet 5, Haiku 4.5, Fable 5.1Anthropic Messages format.
OpenAIGPT-6.1 Sol, GPT-6 Astra / Sol / Luna, GPT-5.6, o3, o4-miniResponses format.
Workers AILlama, Qwen, DeepSeek, GLM, Kimi, gpt-oss and other @cf/… modelsModels 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

SymptomLikely cause
401 / 403 on testThe token can't use this gateway. Check its permissions in the Cloudflare dashboard.
402 with an "insufficient credits" messageUnified 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 worksThe gateway has no key for that provider and unified billing is off.

On this page