Cloudflare Workers AI
A hosted service with its own key and prices. This page lists the addresses it answers, the facts its documentation states, and the setup of each harness.
Addresses and facts
- OpenAI Chat Completions:
https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/ai/v1models.dev, read
- Authentication
- Authorization: Bearer, with the key in
CLOUDFLARE_ACCOUNT_IDmodels.dev, read - Structured output
- Unknown
- Tool calling
- 18 of 27 listed models The share of this provider's models that models.dev records with tool calling. models.dev, read
- Rate limits
- Unknown
- Prices
- Unknown
- Data retention
- Unknown
- Documentation
- Read the page models.dev, read
- Output limits Baltor recorded
- Unknown
Harness setup
Replace @cf/aisingapore/gemma-sea-lion-v4-27b-it with the model you want.
OpenCode
Put this in opencode.json in your project folder:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"cloudflare-workers-ai": {
"npm": "@ai-sdk/openai-compatible",
"name": "Cloudflare Workers AI",
"options": {
"baseURL": "https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/ai/v1",
"apiKey": "{env:CLOUDFLARE_ACCOUNT_ID}"
},
"models": {
"@cf/aisingapore/gemma-sea-lion-v4-27b-it": {
"name": "@cf/aisingapore/gemma-sea-lion-v4-27b-it"
}
}
}
}
}- OpenCode reads any OpenAI-compatible address through the @ai-sdk/openai-compatible package, and an address that speaks the Responses API through @ai-sdk/openai.
From OpenCode documentation, read .
Pi
Put this in ~/.pi/agent/models.json:
{
"providers": {
"cloudflare-workers-ai": {
"baseUrl": "https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/ai/v1",
"api": "openai-completions",
"apiKey": "$CLOUDFLARE_ACCOUNT_ID",
"models": [
{
"id": "@cf/aisingapore/gemma-sea-lion-v4-27b-it"
}
]
}
}
}- The apiKey field can name an environment variable as $NAME.
From Pi documentation, read .
Codex
Codex speaks only the Responses API, and Cloudflare Workers AI documents no Responses address. A gateway that offers one can sit in between.
- Codex speaks the Responses API only: responses is the one supported wire API of a custom provider. Ollama and LM Studio are built in and start with --oss.
From Codex documentation, read .
Claude Code
Claude Code sends Anthropic Messages requests, and Cloudflare Workers AI documents no such address. A gateway that translates to that API can sit in between.
- Claude Code sends Anthropic Messages requests to ANTHROPIC_BASE_URL. Anthropic says it does not support routing Claude Code to models other than Claude through any gateway, so some features may not work with another model.
From Claude Code documentation, read .
Models it lists
Prices in US dollars per million tokens, input and output, as models.dev, read records them.
| Model | Input | Output | Context | As of |
|---|---|---|---|---|
Gemma Sea Lion V4 27B It @cf/aisingapore/gemma-sea-lion-v4-27b-it | 0.351 USD | 0.555 USD | 128,000 | older than 30 days |
Deepseek R1 Distill Qwen 32B @cf/deepseek-ai/deepseek-r1-distill-qwen-32b | 0.497 USD | 4.88 USD | 80,000 | older than 30 days |
DeepSeek V4 Flash 0731 @cf/deepseek-ai/deepseek-v4-flash-0731 | 0.440 USD | 1.32 USD | 1,310,720 | older than 30 days |
DeepSeek V4 Pro 0813 @cf/deepseek-ai/deepseek-v4-pro-0813 | 1.32 USD | 3.96 USD | 1,048,576 | older than 30 days |
Gemma 4 26B A4B IT @cf/google/gemma-4-26b-a4b-it | 0.100 USD | 0.300 USD | 256,000 | older than 30 days |
Granite 4.0 H Micro @cf/ibm-granite/granite-4.0-h-micro | 0.017 USD | 0.112 USD | 131,000 | older than 30 days |
Llama 3.1 8B Instruct fp8 @cf/meta/llama-3.1-8b-instruct-fp8 | 0.152 USD | 0.287 USD | 32,000 | older than 30 days |
Llama 3.2 11B Vision Instruct @cf/meta/llama-3.2-11b-vision-instruct | 0.049 USD | 0.676 USD | 128,000 | older than 30 days |
Llama 3.2 1B Instruct @cf/meta/llama-3.2-1b-instruct | 0.027 USD | 0.201 USD | 60,000 | older than 30 days |
Llama 3.2 3B Instruct @cf/meta/llama-3.2-3b-instruct | 0.051 USD | 0.335 USD | 80,000 | older than 30 days |
Llama 3.3 70B Instruct fp8 Fast @cf/meta/llama-3.3-70b-instruct-fp8-fast | 0.293 USD | 2.25 USD | 24,000 | older than 30 days |
Llama 4 Scout 17B 16E Instruct @cf/meta/llama-4-scout-17b-16e-instruct | 0.270 USD | 0.850 USD | 131,000 | older than 30 days |
Llama Guard 3 8B @cf/meta/llama-guard-3-8b | 0.484 USD | 0.030 USD | 131,072 | older than 30 days |
Mistral Small 3.1 24B Instruct @cf/mistralai/mistral-small-3.1-24b-instruct | 0.351 USD | 0.555 USD | 128,000 | older than 30 days |
Kimi K2.6 @cf/moonshotai/kimi-k2.6 | 0.950 USD | 4.00 USD | 262,144 | older than 30 days |
Kimi K2.7 Code @cf/moonshotai/kimi-k2.7-code | 0.950 USD | 4.00 USD | 262,144 | older than 30 days |
Nemotron 3 Super 120B @cf/nvidia/nemotron-3-120b-a12b | 0.500 USD | 1.50 USD | 256,000 | older than 30 days |
GPT OSS 120B @cf/openai/gpt-oss-120b | 0.350 USD | 0.750 USD | 128,000 | older than 30 days |
GPT OSS 20B @cf/openai/gpt-oss-20b | 0.200 USD | 0.300 USD | 128,000 | older than 30 days |
Qwen2.5 Coder 32B Instruct @cf/qwen/qwen2.5-coder-32b-instruct | 0.660 USD | 1.00 USD | 32,768 | older than 30 days |
Qwen3 30B A3b fp8 @cf/qwen/qwen3-30b-a3b-fp8 | 0.051 USD | 0.335 USD | 32,768 | older than 30 days |
Qwen3.8 27B @cf/qwen/qwen3.8-27b | 0.450 USD | 3.20 USD | 262,144 | older than 30 days |
Qwq 32B @cf/qwen/qwq-32b | 0.660 USD | 1.00 USD | 24,000 | older than 30 days |
GLM-4.7-Flash @cf/zai-org/glm-4.7-flash | 0.060 USD | 0.400 USD | 131,072 | older than 30 days |
Glm 5.2 @cf/zai-org/glm-5.2 | 1.40 USD | 4.40 USD | 262,144 | older than 30 days |
Glm 5.3 @cf/zai-org/glm-5.3 | 1.40 USD | 4.40 USD | 1,310,720 | older than 30 days |
Glm 5.3 Flash @cf/zai-org/glm-5.3-flash | 0.150 USD | 0.500 USD | 1,310,720 |
Sources of this page
- models.dev/api.json, read
Paid links
No link in this directory is a paid link or an ad, and no listing is paid for. The order and the contents of every list come from the sources named on this page.