Getting Started
Dashboard
For Developers
One Cloudflare API token for Lab chat. Install the Cloudflare AI Gateway marketplace addon, then open API Integration → Cloudflare AI Gateway.
Requires: Marketplace addon cloudflare-ai-gateway installed under extensions/CloudflareAiGateway/.
The addon registers an OpenAI-compatible provider:
| Base URL | https://api.cloudflare.com/client/v4/accounts/{account_id}/ai/v1 |
| Auth | Authorization: Bearer (Cloudflare API token) |
| Chat | POST /chat/completions |
| Account ID | Dashboard field, or CLOUDFLARE_ACCOUNT_ID |
| Env fallback for the token | CLOUDFLARE_API_TOKEN |
The token needs Account → Workers AI → Read. A token with only AI Gateway permission returns 401. Third-party models bill through Cloudflare Unified Billing. Krikkit credits use the addon’s per-million prices, not the Cloudflare balance.
Leave the gateway header unset to use the account’s default gateway. Set CLOUDFLARE_AI_GATEWAY_ID when requests should hit a named gateway (cf-aig-gateway-id).
Model ids use Cloudflare’s author/model form (anthropic/claude-sonnet-5, openai/gpt-6-astra, xai/grok-4.6). Usage on the chat response is standard prompt_tokens and completion_tokens.