Skip to main content
Cloudflare AI Gateway exposes an OpenAI-compatible unified API, so you reach multiple vendors through a single endpoint by setting the model id to a vendor/model route. The default vendor is Workers AI, which needs only a Cloudflare token and account id. The Cloudflare class defaults to @cf/meta/llama-3.3-70b-instruct-fp8-fast. Agno rewrites any @cf/... id to workers-ai/@cf/... for the gateway.

Authentication

Cloudflare needs an API token and your account id. The AI Gateway id is optional and falls back to default.

Example

Use Cloudflare with your Agent:
View more examples here.

Parameters

Cloudflare extends the OpenAI-compatible interface and supports most parameters from the OpenAI model. Use use_json_mode=True for structured output when a model does not support native structured outputs.

Model selection

Pick the route by setting id:
Workers AI serves Google’s open-weight Gemma models, not the standard Gemini API. Invented ids such as @cf/.../gemini-... return HTTP 400. For Gemini, use a google/... route with BYOK credentials. Vendor routes also need a model id from the Cloudflare docs.