Cloudflare AI Gateway
Use this when Cloudflare AI Gateway owns the upstream route and you want the gateway path, account id, and gateway name to remain operator-visible.At A Glance
| Field | Value |
|---|---|
| Built-in kind | cloudflare_ai_gateway |
| Provider group | Gateway And Compatibility Providers |
| Protocol family | openai_chat_completions |
| Feature family | openai_compatible |
| Auth scheme | bearer |
| Credential envs | CLOUDFLARE_API_KEY, CLOUDFLARE_AI_GATEWAY_API_KEY |
| Aliases | cloudflare-ai-gateway, cloudflare_ai, cloudflare-ai, cloudflare |
| Default base URL | https://gateway.ai.cloudflare.com/v1/<account_id>/<gateway_name>/openai/compat |
| Request endpoint | https://gateway.ai.cloudflare.com/v1/<account_id>/<gateway_name>/openai/compat/chat/completions |
| Models endpoint | https://gateway.ai.cloudflare.com/v1/<account_id>/<gateway_name>/openai/compat/models |
Minimal Config
Verify It
list-models is unreliable for this account or region, pin an explicit provider.model or add preferred_models instead of leaving recovery implicit.
Auth And Routing Contract
| Contract | Value |
|---|---|
| Auth optional | no |
| Model probe auth optional | no |
| Default API key env | CLOUDFLARE_API_KEY |
| OAuth env | none |
| Primary request route | https://gateway.ai.cloudflare.com/v1/<account_id>/<gateway_name>/openai/compat/chat/completions |
| Primary model-catalog route | https://gateway.ai.cloudflare.com/v1/<account_id>/<gateway_name>/openai/compat/models |
Operator Notes
- cloudflare_ai_gateway requires tenant-scoped base_url configuration: replace
<account_id>and<gateway_name>inprovider.base_urlwith your real Cloudflare AI Gateway path; current template:https://gateway.ai.cloudflare.com/v1/<account_id>/<gateway_name>/openai/compat.
Related Docs
- Continue to Providers And Models when you still need the broader chooser page.
- Continue to Provider Guides for the full built-in provider matrix.
- Continue to Provider Recipes for representative rollout recipes.
- Continue to Configuration Patterns for the shared provider-profile shape.