AI Gateway now uses the AI REST API on api.cloudflare.com. You can call any model — whether from OpenAI, Anthropic, Google, or hosted on Workers AI — through one unified API, using the same endpoints and authentication regardless of provider. Four endpoints are available:
POST /ai/run— universal endpoint for all models and modalitiesPOST /ai/v1/chat/completions— OpenAI SDK compatiblePOST /ai/v1/responses— OpenAI Responses API compatiblePOST /ai/v1/messages— Anthropic SDK compatible
curl -X POST "https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/chat/completions" \ --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ --header "Content-Type: application/json" \ --data '{ "model": "openai/gpt-5.5", "messages": [{"role": "user", "content": "What is Cloudflare?"}] }'All AI Gateway features — logging, caching, rate limiting, and guardrails — are applied automatically. Third-party models are billed through Unified Billing, so you do not need to manage separate provider API keys.
Third-party model requests are routed through your account’s default gateway, which is created automatically on first use. To route requests through a specific gateway, add the cf-aig-gateway-id header.
If you are already calling Workers AI models through the existing REST API, that path (/ai/run/@cf/{model}) continues to work. To call Workers AI models through AI Gateway, use the @cf/ model prefix (for example, @cf/moonshotai/kimi-k2.6) and include the cf-aig-gateway-id header to specify which gateway to route through.
For more details and examples, refer to the REST API documentation.
Source: Cloudflare
Latest Posts
- (Updated) Introducing Surveys Agent and Copilot Chat in Microsoft Forms [MC1229954]
![(Updated) Introducing Surveys Agent and Copilot Chat in Microsoft Forms [MC1229954] 2 pexels edward jenner 4253062](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==)
- (Updated) Microsoft Teams: New chat sections for muted and meeting chats [MC1269864]
![(Updated) Microsoft Teams: New chat sections for muted and meeting chats [MC1269864] 3 pexels pixabay 208421](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==)
- Microsoft Entra ID single sign-on for the Starburst connector in Power BI (Preview)

- Dataverse – Chat and reason over Dataverse business data in Microsoft 365 Copilot (preview) [MC1395644]
![Dataverse - Chat and reason over Dataverse business data in Microsoft 365 Copilot (preview) [MC1395644] 5 socks 1322489 1920](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==)

![(Updated) Introducing Surveys Agent and Copilot Chat in Microsoft Forms [MC1229954] 2 pexels edward jenner 4253062](https://mwpro.co.uk/wp-content/uploads/2024/08/pexels-edward-jenner-4253062-150x150.webp)
![(Updated) Microsoft Teams: New chat sections for muted and meeting chats [MC1269864] 3 pexels pixabay 208421](https://mwpro.co.uk/wp-content/uploads/2025/06/pexels-pixabay-208421-150x150.webp)

![Dataverse - Chat and reason over Dataverse business data in Microsoft 365 Copilot (preview) [MC1395644] 5 socks 1322489 1920](https://mwpro.co.uk/wp-content/uploads/2025/06/socks-1322489_1920-150x150.webp)
