Cloudflare

Cloudflare AI Gateway model examples.

The current Agno Cloudflare adapter uses AI Gateway's /compat/chat/completions endpoint. Cloudflare deprecates this endpoint for single-model calls while keeping it working for existing integrations. Dynamic routes still require it. For new direct model integrations, follow Cloudflare's current REST API guide.

ExampleDescription
BasicRun a Workers AI model through Cloudflare AI Gateway in sync, async, and streaming modes.
Switching ModelsSwitch Cloudflare AI Gateway models by passing a catalog binding to Cloudflare(id=...) or a cloudflare: model string.
Tool UseGive a Cloudflare AI Gateway agent web search with WebSearchTools and stream the tool-calling run.
Structured OutputGenerate JSON with Cloudflare Workers AI and validate it locally as a MovieScript.