Cloudflare Workers AI Pricing: Neurons Explained, the Free Tier, Every Model Price, API Key Setup and Worked Examples
Cloudflare Workers AI lets you run open AI models (Llama, Gemma, Qwen, Mistral, gpt-oss, DeepSeek, Kimi, GLM, FLUX image models, Whisper speech recognition and more) on Cloudflare's GPUs, from a Worker, a REST call or any OpenAI-compatible SDK. You pay in Neurons, Cloudflare's unit of GPU work: $0.011 per 1,000 Neurons, and every account, free or paid, gets 10,000 Neurons a day free (worth $0.11 a day, about $3.30 a month), reset at 00:00 UTC. Each model's price is also listed per million tokens: the popular Llama 3.1 8B (fp8-fast) costs $0.045 per million input tokens and $0.384 per million output tokens, so the free allowance alone covers roughly 280,000 output tokens a day, a small website chatbot or a few hundred transcribed minutes. On the free Workers plan you stop at 10,000 Neurons with error 3036; on Workers Paid ($5 a month) you keep going at $0.011 per 1,000. Below: what a Neuron is, the price of every popular model, how far the free tier goes, six worked examples, code for Workers, REST and the OpenAI SDK, rate limits, error codes, and Workers AI vs Amazon Bedrock, OpenAI and running models yourself.
Jake's shop website ran behind Cloudflare, which Ethan had set up years ago for the free SSL certificate. Now Jake wanted a small chat box on the site that could answer "Are you open Sunday?" and "How much is a screen repair?" without him typing the same reply forty times a week. He had read that AI chatbots cost "pennies per thousand tokens" and had no idea what a token was. "Is there a version of this that just costs nothing until it's busy?" he asked. Ethan opened the Cloudflare dashboard and clicked AI, then Workers AI.
New to AI models and their pricing? The cards below explain LLMs, Cloudflare's own Clef model, Gemini's free tier, Bedrock's token pricing and running models on your own PC.
What is Cloudflare Workers AI?
Workers AI is Cloudflare's serverless AI inference service. Cloudflare runs GPUs in its data centers around the world, hosts a catalog of open models on them, and you call those models with a single line of code or an HTTP request. There is no GPU to rent, no model to download and no server to keep running: you pay only for the work each request does.
- Text generation: Llama 3.1, 3.2, 3.3 and 4 Scout, Gemma 3 and 4, Qwen3 and Qwen3.8, Mistral Small, gpt-oss 20B and 120B, DeepSeek V4 Flash and Pro, Kimi K2.5 to K2.7, GLM 4.7 to 5.3, Nemotron 3, IBM Granite and more.
- Embeddings for search and retrieval-augmented generation (RAG): BGE small, base, large and M3, Qwen3 Embedding.
- Images: FLUX.1 schnell, FLUX.2 dev and klein, Leonardo Lucid Origin and Phoenix.
- Speech: Whisper and Whisper large v3 turbo for transcription, Deepgram Nova 3 and Flux for real-time speech-to-text, MeloTTS and Deepgram Aura for text-to-speech.
- Other tasks: translation, classification, reranking, image classification and Cloudflare's own Clef decision models.
Workers AI sits next to Cloudflare's other developer products: Workers (serverless code), AI Gateway (caching, logging and rate limiting for any AI provider), Vectorize (a vector database for your embeddings) and AI Search (managed RAG). You can use Workers AI alone through its REST API, even if your app runs somewhere else entirely.
Workers vs Workers AI. Cloudflare Workers is Cloudflare's serverless platform for running your own JavaScript, TypeScript, Python or WebAssembly code in its data centers, close to your users, without servers. The free Workers plan includes 100,000 requests a day; Workers Paid is $5 a month with 10 million requests included. Workers AI is the AI part: the models your Worker (or any other app) calls. You can use Workers without AI, and Workers AI without writing a Worker, but they are designed to work together: a Worker handles your web request, calls a model through a binding, and returns the answer, all inside Cloudflare's network.
Jake: "So it's like renting a slice of somebody's very expensive computer for a second at a time?"
Ethan: "A fraction of a second, and the first slices every day are free."
How a Workers AI request runs. When your Worker calls env.AI.run(), or your server calls the REST API, Cloudflare routes the request to a data center with free GPU capacity for that model, which is usually near your user, runs the model, and returns the result (all at once, or streamed token by token). The model is already loaded on Cloudflare's GPUs, so there is no cold start for you to wait through, and no capacity for you to reserve. Cloudflare counts the Neurons the request used, subtracts them from today's free allowance, and bills anything beyond it on Workers Paid. If the model is briefly overloaded, you get error 3040 and can retry or fall back to another model.
What is a Neuron?
A Neuron is Cloudflare's measure of the GPU compute a request uses. Big models need more GPU work per token than small ones, so they burn more Neurons per token. Because "Neurons" are hard to picture, Cloudflare also publishes each model's price in the familiar form, dollars per million tokens, and the two always agree: 1,000 Neurons cost $0.011, so a model listed at 34,868 Neurons per million output tokens costs 34.868 x $0.011 = $0.384 per million output tokens.
A token is a chunk of text, roughly three quarters of an English word, so 1 million tokens is about 750,000 words. Your bill for a chat request counts both the input tokens (your system prompt, the conversation so far and the question) and the output tokens (the answer), and output tokens usually cost several times more. Our plain-English guide to what an LLM is explains tokens if they are new to you.
To estimate any request: (input tokens / 1,000,000 x input price) + (output tokens / 1,000,000 x output price). Images are priced per 512 x 512 tile and per step, audio per minute, and text-to-speech per 1,000 characters.
Workers AI pricing: every popular model
Prices per million tokens, with the Neurons each million uses, in October 2026:
| Model | Input $/M tokens | Output $/M tokens | Neurons per M (in / out) |
|---|---|---|---|
| IBM Granite 4.0 H Micro | $0.017 | $0.112 | 1,542 / 10,158 |
| Llama 3.2 1B Instruct | $0.027 | $0.201 | 2,457 / 18,252 |
| Llama 3.1 8B Instruct (fp8-fast) | $0.045 | $0.384 | 4,119 / 34,868 |
| Qwen3 30B A3B (fp8) | $0.051 | $0.335 | 4,625 / 30,475 |
| GLM 4.7 Flash | $0.060 | $0.400 | 5,500 / 36,400 |
| Gemma 4 26B A4B | $0.100 | $0.300 | 9,091 / 27,273 |
| gpt-oss-20b | $0.200 | $0.300 | 18,182 / 27,273 |
| Llama 4 Scout 17B 16E | $0.270 | $0.850 | 24,545 / 77,273 |
| Llama 3.3 70B Instruct (fp8-fast) | $0.293 | $2.253 | 26,668 / 204,805 |
| DeepSeek V4.1 Flash (1017) | $0.300 (cached $0.006) | $1.200 | 27,273 / 109,091 |
| gpt-oss-120b | $0.350 | $0.750 | 31,818 / 68,182 |
| Mistral Small 3.1 24B | $0.351 | $0.555 | 31,876 / 50,488 |
| Qwen3.8 27B | $0.450 | $3.200 | 40,909 / 290,909 |
| Nemotron 3 120B A12B | $0.500 | $1.500 | 45,455 / 136,364 |
| Kimi K2.6 (Workers Paid only) | $0.950 (cached $0.16) | $4.000 | 86,364 / 363,636 |
| DeepSeek V4 Pro (Workers Paid only) | $1.320 (cached $0.044) | $3.960 | 120,000 / 360,000 |
| GLM 5.3 (Workers Paid only) | $1.400 (cached $0.26) | $4.400 | 127,273 / 400,000 |
Older and alternative builds of the same models can cost very differently. The plain llama-3.1-8b-instruct is $0.282 / $0.827 per million, more than double the fp8-fast build's output price and six times its input price, and the old llama-2-7b-chat-fp16 is $0.556 / $6.667. When two versions of a model are listed, check which one you are calling.
Other model types:
- Embeddings: BGE M3 and Qwen3 Embedding 0.6B $0.012 per million tokens, BGE small $0.020, BGE base $0.067, BGE large $0.204.
- Images: FLUX.1 schnell $0.0000528 per 512 x 512 tile plus $0.0001056 per step; FLUX.2 klein 9B $0.015 for the first megapixel and $0.002 for each additional one; Leonardo Phoenix 1.0 $0.00583 per tile plus $0.00011 per step.
- Speech to text: Whisper and Whisper large v3 turbo $0.0005 per audio minute; Deepgram Nova 3 $0.0052 per minute ($0.0092 over WebSocket).
- Text to speech: MeloTTS $0.0002 per audio minute; Deepgram Aura 1 $0.015 and Aura 2 $0.030 per 1,000 characters.
- Cloudflare's decision models: Clef-flash $0.038, Clef-omni $0.15 and Clef $0.24 per million input tokens, covered in our Clef guide.
The Workers AI free tier: how far 10,000 Neurons go
Every Cloudflare account gets 10,000 Neurons a day at no charge, on the free Workers plan and on Workers Paid, and the counter resets at 00:00 UTC (early evening in the US, the start of the business day in Asia). Unused Neurons do not carry over. Here is roughly what one day's allowance buys if you spend it all on one thing:
| Use | Free each day (about) |
|---|---|
| Llama 3.1 8B fp8-fast, output tokens | 287,000 tokens (about 215,000 words) |
| Llama 3.1 8B fp8-fast, input tokens only | 2.4 million tokens |
| gpt-oss-20b or Gemma 4 26B, output tokens | 367,000 tokens |
| Llama 3.3 70B fp8-fast, output tokens | 49,000 tokens |
| BGE M3 embeddings | 9.3 million tokens |
| Whisper transcription | 243 audio minutes (about 4 hours) |
| FLUX.1 schnell, 1024 x 1024 images at 4 steps | 173 images |
| Clef-flash decisions (input tokens) | 2.9 million tokens |
Real apps mix input and output, so treat these as ceilings. In practice, the free tier comfortably covers a hobby project, a prototype or a small business chatbot with a few hundred conversations a day on a small model. It does not cover a 70B model serving many users, or the paid-only models (Kimi K2.6 and K2.7, GLM 5.2 and 5.3, and the DeepSeek V4 models), which need Workers Paid or prepaid AI Gateway credits even for your first request.
Workers Free vs Workers Paid
- Workers Free: the 10,000 daily Neurons and nothing beyond them. When you run out, every request fails with error 3036 (Account limited, HTTP 429) until 00:00 UTC. Some models are not available at all. Good for learning and prototypes.
- Workers Paid ($5 a month): the same 10,000 free Neurons a day, then $0.011 per 1,000 Neurons with no daily cap, access to every model, and the higher limits of the Workers platform for the rest of your app. The $5 covers your Workers platform usage; your Workers AI overage is billed on top.
- AI Gateway unified billing: you can also prepay credits through AI Gateway and use them for Workers AI's paid models, which also raises the rate limit on those models from 20 to 50 requests a minute.
You see your usage in the dashboard under AI, Workers AI, which charts Neurons used per day and per model. Set a spending alert on your account before you put a paid app in front of the public.
Worked examples: what Workers AI really costs
Example 1: Jake's website chatbot. About 200 chats a day on Llama 3.1 8B fp8-fast. Each chat sends about 600 input tokens (a short system prompt with the shop's hours and prices, plus the conversation) and gets 150 output tokens back.
- Input: 200 x 600 = 120,000 tokens = 0.12 million x 4,119 = 494 Neurons
- Output: 200 x 150 = 30,000 tokens = 0.03 million x 34,868 = 1,046 Neurons
- Total: 1,540 Neurons a day, well inside the free 10,000. Cost: $0.
Ethan: "Your chatbot uses about a sixth of the free allowance. You could have six of them."
Jake: "One is plenty. I just don't want to answer the Sunday question again."
Example 2: a busier chatbot. 3,000 chats a day with the same sizes, on Workers Paid.
- Input: 1.8 million tokens x $0.045 = $0.081; output: 0.45 million x $0.384 = $0.173. Total $0.254 a day.
- Minus the free 10,000 Neurons ($0.11): $0.144 a day, about $4.32 a month, plus the $5 Workers Paid plan.
Example 3: the same 3,000 chats on a 70B model. Llama 3.3 70B fp8-fast: input 1.8 x $0.293 = $0.527, output 0.45 x $2.253 = $1.014, total $1.541 a day, about $43 a month after the free allowance. The bigger model costs about six times as much per chat; use it only if the 8B model's answers are not good enough.
Example 4: building a search index for RAG. Embedding 50 million tokens of help articles once with BGE M3: 50 x $0.012 = $0.60, or free if you spread it over six days within the daily allowance. Your later queries cost almost nothing to embed.
Example 5: transcribing calls. 1,000 minutes of recorded calls a month with Whisper large v3 turbo: 1,000 x $0.0005 = $0.50, and 243 of those minutes a day are inside the free tier anyway.
Example 6: product images. 1,000 FLUX.1 schnell images a month at 1024 x 1024 (4 tiles) and 4 steps: per image 4 x $0.0000528 + 4 x $0.0001056 = $0.00063, so $0.63 for the month.
How to get a Workers AI API key and your account ID
To call Workers AI from outside a Worker (a script, a server, the OpenAI SDK or a tool like OpenCode), you need two things: your account ID and an API token with Workers AI permission. Cloudflare calls them API tokens rather than API keys, but that is what tools mean when they ask for a "Workers AI API key." Here is how you get both:
- Sign in to the Cloudflare dashboard at dash.cloudflare.com, or create a free account; you need an email address but no credit card for the free plan.
- Find your account ID. Open Workers & Pages: the account ID is shown in the account details on the right side of the overview page. It is also the long string of letters and numbers in the dashboard's address bar right after dash.cloudflare.com/.
- Open Workers AI. Choose AI, then Workers AI, then Use REST API. This page shows your account ID again and has a Create a Workers AI API Token button.
- Create the token. The button opens the token form with the Workers AI permissions already filled in (you can also go to My Profile, API Tokens, Create Token and pick the Workers AI template). Review it, choose Create Token, and copy the token right away, because the full token appears only this one time.
- Store it safely as environment variables, for example
CLOUDFLARE_ACCOUNT_IDandCLOUDFLARE_API_TOKEN, or as secrets in your hosting platform. - Test it with the curl command in the next section. A JSON answer with
"success": truemeans your ID and token work.
If your request returns an authentication error, the usual causes are a token copied with a trailing space, a token created without Workers AI permission, or an account ID from a different Cloudflare account than the one the token belongs to. You can roll (regenerate) or delete a token at any time from the API Tokens page, which immediately stops the old one working.
There is no separate "free API key": the same token works on the free plan within the daily 10,000 Neurons, and on Workers Paid beyond it.
Getting started: your first Worker with Workers AI
If you would rather build inside Cloudflare, a Worker with an AI binding needs no API token at all, because the binding authenticates for you. You need Node.js installed on your computer:
- In a terminal, run
npm create cloudflare@latest -- jakes-chatand choose the Hello World example, a Worker only, and TypeScript or JavaScript. - Open the new folder and add the AI binding to
wrangler.jsonc:"ai": { "binding": "AI" }. - Replace the code in
src/indexwith the Worker example in the next section. - Run
npx wrangler devto test locally. Requests to Workers AI from local development still run on Cloudflare's GPUs and count toward your Neurons and rate limits. - Run
npx wrangler loginonce if asked, thennpx wrangler deploy. Your Worker is live within seconds at an address such asjakes-chat.jakesrepairs.workers.dev, using the workers.dev subdomain you chose for your account. - Call it from your website's chat box with a
fetch()POST that sends the visitor's question as JSON.
You can also create a Worker entirely in the dashboard (Workers & Pages, Create, Start with Hello World), edit the code in the browser, and add the Workers AI binding under the Worker's Settings, Bindings.
The Workers AI Playground
Before you write any code, you can try the models in the Workers AI LLM Playground, a browser chat page where you pick a model, write a system prompt, adjust settings such as max tokens and temperature, and chat with it. Cloudflare's dashboard also lets you run models from the Workers AI section. Use the playground to compare a few models on your real questions (your own FAQ, a customer email, a document to summarize) and to see how long the answers are, because answer length is what drives your output-token cost. Once you like a model, the playground can show you the code to call it, which you paste into your Worker.
How to use Workers AI: Worker, REST API and OpenAI SDK
1. From a Cloudflare Worker, which is the fastest way and adds no network hop: add an AI binding to your Wrangler configuration ("ai": { "binding": "AI" } in wrangler.jsonc, or [ai] binding = "AI" in wrangler.toml), then call the model:
export default {
async fetch(request, env) {
const { question } = await request.json();
const result = await env.AI.run("@cf/meta/llama-3.1-8b-instruct-fp8-fast", {
messages: [
{ role: "system", content: "You answer questions for Jake's Repairs. Open Mon-Sat 9-6. Be brief." },
{ role: "user", content: question },
],
max_tokens: 200,
});
return Response.json({ answer: result.response });
},
};
2. With the REST API from any language or server. Create an API token with Workers AI permission in your Cloudflare dashboard, then:
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run/@cf/meta/llama-3.1-8b-instruct-fp8-fast \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-d '{"messages":[{"role":"user","content":"Are you open on Sunday?"}],"max_tokens":200}'
3. With the OpenAI SDK, if your app already uses it: point the base URL at https://api.cloudflare.com/client/v4/accounts/ACCOUNT_ID/ai/v1. Chat completions and embeddings work for most models, and the Responses API works for the gpt-oss models (without streaming).
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["CLOUDFLARE_API_TOKEN"],
base_url=f"https://api.cloudflare.com/client/v4/accounts/{os.environ['CLOUDFLARE_ACCOUNT_ID']}/ai/v1",
)
reply = client.chat.completions.create(
model="@cf/meta/llama-3.1-8b-instruct-fp8-fast",
messages=[{"role": "user", "content": "How much is an iPhone screen repair?"}],
max_tokens=200,
)
print(reply.choices[0].message.content)
Your account ID is on the right side of the dashboard's Workers overview page. Keep your API token in an environment variable or a Workers secret, out of your page's JavaScript, where anyone could copy it and spend your Neurons; the same rules apply as for the OpenAI API keys most people start with.
Streaming answers. For a chat box, add stream: true to your request. The model then sends its answer as server-sent events, token by token, so your visitor sees text appear within a fraction of a second instead of waiting for the whole reply. Streaming costs exactly the same Neurons; it only changes how fast the first words arrive. In a Worker, return the stream directly as the response body with the text/event-stream content type, and read it in the browser with an EventSource or a fetch reader.
Generating images. Image models return the picture instead of text. In a Worker, a FLUX.1 schnell call looks like this, and returns a base64-encoded image you can send straight back to the browser:
const out = await env.AI.run("@cf/black-forest-labs/flux-1-schnell", {
prompt: "a cozy phone repair shop counter, warm light, product photo",
steps: 4,
});
const bytes = Uint8Array.from(atob(out.image), (c) => c.charCodeAt(0));
return new Response(bytes, { headers: { "Content-Type": "image/jpeg" } });
More steps give you more detail at a higher price per image, because each step is billed; 4 steps is the usual sweet spot for schnell. Save generated images to R2, Cloudflare's object storage, if you want to reuse them instead of paying to generate them again.
Keeping chat history. If your chatbot needs to remember earlier messages or you want to review what visitors ask, store each exchange in D1, Cloudflare's serverless SQL database, from the same Worker. Reviewing a week of real questions is the fastest way to improve your system prompt, and it shows you which questions deserve a cached answer.
In OpenCode and other AI tools. Any tool that accepts a custom OpenAI-compatible provider can use Workers AI: set the base URL to the /ai/v1 address above, the API key to your Cloudflare API token, and the model name to the full model ID, such as @cf/qwen/qwen3-30b-a3b-fp8 or @cf/openai/gpt-oss-120b. In OpenCode, that means a provider entry in your opencode.json using the OpenAI-compatible package with that base URL; our OpenCode guide shows the provider format. For coding agents, pick a model that handles tool calling well, such as gpt-oss-120b, Qwen3 or the paid Kimi K2.7-code, and expect a coding session to use far more tokens than a chatbot, because the tool re-sends your files and history with every step.
Which Workers AI model should you use?
There is no separate list of "free models": every model that does not need Workers Paid can be used within your free daily Neurons. The question is which model gives you good enough answers for the fewest Neurons. A practical starting point by job:
- Website chat, FAQs, short replies: Llama 3.1 8B Instruct fp8-fast or Gemma 4 26B A4B. Cheap, fast, and good at following a system prompt with your facts in it.
- Harder reasoning and longer answers: gpt-oss-120b, Qwen3.8 27B or DeepSeek V4.1 Flash. More expensive per token, noticeably better at multi-step questions.
- Coding: Qwen2.5 Coder 32B on the free plan, or Kimi K2.7-code and GLM 5.3 on Workers Paid for agent-style coding.
- Images in, text out (vision): Llama 3.2 11B Vision Instruct or Llama 4 Scout, for describing photos, reading screenshots or checking product images.
- Classification and routing: Granite 4.0 H Micro, Llama 3.2 1B or Cloudflare's Clef-flash, which cost almost nothing per request.
- Search and RAG: BGE M3 or Qwen3 Embedding 0.6B (both multilingual) for embeddings, stored in Vectorize, with the BGE reranker to sort results.
- Indian languages: IndicTrans2 (English to Indic) for translation, and Gemma or Qwen models for chat in Hindi and other major languages.
- Speech: Whisper large v3 turbo for transcription, Deepgram Nova 3 for live captions, MeloTTS or Deepgram Aura 2 for spoken replies.
- Images out: FLUX.1 schnell for fast, cheap images; FLUX.2 klein or Leonardo models for higher quality.
Qwen3 on Workers AI. The Qwen family is one of the most-used on the platform, and its prices span a wide range. Qwen3 30B A3B (fp8) costs $0.051 per million input and $0.335 per million output tokens, about the same as Llama 3.2 3B, because only 3 billion of its 30 billion parameters are active per token; it is a strong default for multilingual chat and tool calling. Qwen3.8 27B costs $0.45 and $3.20, for noticeably better reasoning. QwQ 32B and Qwen2.5 Coder 32B both cost $0.66 and $1.00, for step-by-step reasoning and code. Qwen3 Embedding 0.6B handles embeddings at $0.012 per million tokens. For most small business uses, Qwen3 30B A3B gives you near mid-size quality at small-model prices.
Is GLM 5.2 free on Workers AI? No. GLM 5.2 and 5.3, Kimi K2.6 and K2.7-code, and the DeepSeek V4 models need Workers Paid or AI Gateway credits from the first request. GLM 4.7 Flash, Qwen3 and the Llama, Gemma and gpt-oss models all work on the free allowance.
Workers AI with AI Gateway, Vectorize and AI Search
Most real apps combine Workers AI with a few other Cloudflare pieces. A typical small support assistant looks like this: your help articles are split into chunks and embedded with BGE M3; the vectors go into Vectorize; when a visitor asks a question, your Worker embeds the question, finds the five closest chunks in Vectorize, and sends them with the question to Llama 3.1 8B, which answers from your own content instead of guessing. AI Search does those steps for you as a managed service if you would rather not wire them yourself. AI Gateway sits in front of the model calls: it caches repeated questions (a cached answer costs no Neurons), rate limits each visitor, retries or falls back to another model when one is busy, and logs every request with its cost, so you can see which questions are expensive.
For Jake's shop, the whole knowledge base was one page of hours, prices and policies, small enough to paste into the system prompt, so Ethan skipped Vectorize entirely. Reach for RAG when your content is too big for a prompt, typically more than a few thousand words.
Workers AI rate limits
Default limits per account, per task type, in requests per minute:
- Text generation: 300 requests per minute, but only 20 per minute per model for the paid-only models (50 with prepaid AI Gateway credits on unified billing).
- Text embeddings: 3,000 (1,500 for BGE large).
- Speech recognition: 720. Translation: 720. Image-to-text: 720. Text-to-image: 720.
- Text classification: 2,000. Summarization: 1,500. Image classification and object detection: 3,000.
Beta models may have lower limits, and requests you run locally with Wrangler in development mode count toward your limits too. A website chatbot rarely comes near 300 a minute; a batch job that fires thousands of requests at once will, so add a small queue or concurrency limit to your code.
Workers AI error codes and fixes
- 3036, Account limited (429): you used today's 10,000 free Neurons on Workers Free. Wait for 00:00 UTC, or upgrade to Workers Paid.
- 3040, Out of capacity (429): the model is temporarily busy. Retry with a short backoff, or switch to another model. It is also returned when you set
rejectIfBusyand the model is busy. - 5035, Model requires Workers Paid plan (403): the model is paid-only (for example Kimi K2.6, GLM 5.3 or DeepSeek V4 Pro). Upgrade, or pick a model available on the free plan.
- 5007, No such model (400) and 3042, Invalid model ID (404): a typo in the model name or a retired model. Copy the exact ID, including the
@cf/prefix, from the models catalog. - 5016, Model agreement (403): some Llama models, such as Llama 3.2 Vision, require you to accept Meta's license once by sending the prompt
agreebefore your first real request. - 3006, Request too large (413): your input exceeds the model's size or context limit. Trim the conversation history or split the document.
- 3007, Timeout (408): the request took too long, usually a long output on a large model. Lower
max_tokensor stream the response. - 5019, Deprecated SDK version (405): update your Cloudflare SDK or Wrangler.
- 3003, Incomplete request (400): a missing body or Content-Type header in your REST call.
Workers AI vs Amazon Bedrock, OpenAI and running models yourself
- Workers AI vs Amazon Bedrock: Bedrock offers the big proprietary models (Anthropic's models, Amazon Nova) and many open ones inside your AWS account, with AWS IAM, VPC endpoints, guardrails, knowledge bases and enterprise contracts. Workers AI offers open models only, with a free daily allowance, global edge locations and very low prices for small models. If your app and data are in AWS and you need frontier-model quality, Bedrock is the natural fit, as our Bedrock pricing guide explains; if you run on Cloudflare or want a cheap small model with a free tier, Workers AI is hard to beat.
- Workers AI vs OpenAI or Google's APIs: those give you their own frontier models (GPT, Gemini) with higher quality on hard tasks, and Google's API has a free tier of its own, covered in our Gemini free tier guide. Workers AI wins on price for simple tasks such as FAQ answers, classification, summaries and embeddings, where an 8B model is good enough.
- Workers AI vs running a model yourself: a local model through Ollama or LM Studio costs nothing per token and keeps your data on your machine, as our local AI series shows, but you need the hardware and you serve one user well, not a website. Renting your own cloud GPU makes sense only at high, steady volume.
- Workers AI vs OpenRouter: OpenRouter is a marketplace that routes your requests to many providers (including frontier models) through one API and one bill. Workers AI is one provider running its own GPUs. Use OpenRouter when you want many vendors behind one key; use Workers AI when you want the free daily allowance, Cloudflare's network and the bindings inside Workers.
- Workers AI vs other open-model hosts (Together, Groq, Fireworks): similar open models and per-token pricing. Workers AI's advantages are the daily free allowance and the tight fit with Workers, AI Gateway and Vectorize; others may have newer models sooner or faster tokens per second.
Ethan: "For your hours and prices, an 8B model is plenty. If you ever want it to write repair estimates from photos, we'll talk about the bigger ones."
How to keep your Workers AI bill low
- Pick the smallest model that answers well. Test your real questions on Llama 3.1 8B fp8-fast, Gemma 4 26B or gpt-oss-20b before you reach for a 70B or 120B model.
- Choose the fp8-fast or AWQ builds where they exist; they cost a fraction of the full-precision versions.
- Set
max_tokenson every request, so a runaway answer cannot cost more than you planned. - Keep your system prompt short and trim old conversation turns; input tokens are cheap, but they are paid on every single message.
- Use prompt caching on the models that support it (DeepSeek, Kimi, GLM): cached input costs a small fraction of the normal input price.
- Put AI Gateway in front to cache identical requests, rate limit abusive users and log what you spend.
- Protect public endpoints with Turnstile or rate limiting rules so bots cannot burn your Neurons.
- Watch the daily chart in the dashboard and set a billing notification in your Cloudflare account.
Frequently asked questions
How much does Cloudflare Workers AI cost?
$0.011 per 1,000 Neurons after a free 10,000 Neurons a day. Per model, that works out to prices such as $0.045 per million input tokens and $0.384 per million output tokens for Llama 3.1 8B fp8-fast, or $0.35 and $0.75 for gpt-oss-120b.
Is Cloudflare Workers AI free?
Partly. Every account gets 10,000 Neurons a day free, on the free and paid Workers plans, reset at 00:00 UTC. On the free plan requests stop when that runs out; on Workers Paid ($5 a month) you continue at $0.011 per 1,000 Neurons.
What is a Neuron in Workers AI?
Cloudflare's unit for the GPU compute a request uses. Larger models use more Neurons per token. 1,000 Neurons cost $0.011, and each model's Neuron rate is also published as a price per million tokens.
How many tokens are 10,000 Neurons?
It depends on the model: about 287,000 output tokens or 2.4 million input tokens on Llama 3.1 8B fp8-fast, about 367,000 output tokens on gpt-oss-20b, and about 49,000 output tokens on Llama 3.3 70B.
When does the Workers AI free tier reset?
Every day at 00:00 UTC. Unused Neurons do not roll over to the next day.
What happens when I run out of free Neurons?
On the Workers Free plan, requests fail with error 3036 (Account limited, HTTP 429) until the reset at 00:00 UTC. On Workers Paid, usage continues and is billed at $0.011 per 1,000 Neurons.
Do I need the Workers Paid plan to use Workers AI?
No, the free plan includes Workers AI with 10,000 Neurons a day. You need Workers Paid to go beyond that, and for the paid-only models such as Kimi K2.6 and K2.7, GLM 5.2 and 5.3, and the DeepSeek V4 models.
What models does Workers AI have?
Open models for text (Llama, Gemma, Qwen, Mistral, gpt-oss, DeepSeek, Kimi, GLM, Nemotron, Granite), embeddings (BGE, Qwen3 Embedding), images (FLUX, Leonardo), speech (Whisper, Deepgram), text-to-speech (MeloTTS, Aura), translation and classification, plus Cloudflare's Clef models.
Is Workers AI compatible with the OpenAI API?
Yes. Use the base URL https://api.cloudflare.com/client/v4/accounts/ACCOUNT_ID/ai/v1 with your Cloudflare API token. Chat completions and embeddings work for most models; the Responses API works for gpt-oss.
What are the Workers AI rate limits?
300 requests per minute for text generation (20 per minute per model for paid-only models), 3,000 for embeddings, 720 for speech recognition, translation and text-to-image, and 2,000 for text classification, per account.
Can I use Workers AI without a Worker?
Yes. Call the REST API from any server or script with your account ID and an API token, or use the OpenAI-compatible endpoint with the OpenAI SDK.
Is Workers AI cheaper than OpenAI?
For small open models, usually much cheaper: Llama 3.1 8B fp8-fast costs a few cents per million tokens, and the free daily allowance covers small apps entirely. For hard reasoning or coding tasks, frontier models from OpenAI or Anthropic may be worth their higher price.
What is the difference between Workers AI and AI Gateway?
Workers AI runs models. AI Gateway sits in front of any AI provider, including Workers AI, OpenAI and Bedrock, to cache responses, rate limit, retry and log requests. AI Gateway can also hold prepaid credits for Workers AI's paid models.
Does Workers AI keep my prompts?
Cloudflare does not use your Workers AI inputs and outputs to train or improve AI models. If you turn on AI Gateway logging, your requests are stored in your own account's logs, which you control.
How much does Whisper cost on Workers AI?
$0.0005 per audio minute for Whisper and Whisper large v3 turbo, so 1,000 minutes cost $0.50, and about 243 minutes a day fit in the free allowance.
How much does image generation cost on Workers AI?
FLUX.1 schnell costs $0.0000528 per 512 x 512 tile plus $0.0001056 per step, about $0.00063 for a 1024 x 1024 image at 4 steps. About 173 such images a day fit in the free allowance.
Why does Workers AI say error 5016 Model agreement?
Some Llama models require you to accept Meta's license once. Send a request with the prompt "agree" to that model, then make your real requests.
How do I get a Cloudflare Workers AI API key?
In the dashboard, open AI, Workers AI, Use REST API, and choose Create a Workers AI API Token (or use the Workers AI template under My Profile, API Tokens). Copy the token when it is shown, together with your account ID, and store both as environment variables.
Where do I find my Cloudflare account ID?
On the Workers & Pages overview page in the dashboard, in the account details on the right, and on the Workers AI Use REST API page. It is also the string right after dash.cloudflare.com/ in your browser's address bar.
Is there a Workers AI playground?
Yes. The Workers AI LLM Playground lets you pick a model, set a system prompt and chat with it in your browser, and the dashboard can run models too. Use it to compare models on your own questions before you write code.
Is GLM 5.2 free on Cloudflare Workers AI?
No. GLM 5.2 and 5.3 are paid-only models that need Workers Paid or prepaid AI Gateway credits. GLM 4.7 Flash runs on the free daily allowance.
Is Cloudflare Workers free?
Yes, up to 100,000 requests a day on the free plan, which also includes 10,000 Workers AI Neurons a day. Workers Paid costs $5 a month with 10 million requests included and lifts the Workers AI cap.
What is the cheapest model on Workers AI?
For text generation, IBM Granite 4.0 H Micro at $0.017 per million input and $0.112 per million output tokens, then Llama 3.2 1B. For embeddings, BGE M3 and Qwen3 Embedding 0.6B at $0.012 per million tokens. Cheap models suit classification and short replies; test answer quality before you rely on them.
Does Workers AI support function calling?
Yes, on models trained for it, such as Llama 3.3 70B, Qwen3, gpt-oss and Kimi. You pass a list of tools with your messages, the model returns which tool to call with which arguments, your code runs it, and you send the result back for the final answer.
Can I run Workers AI in production on the free plan?
You can, but the hard daily cap means your app stops answering when the 10,000 Neurons run out, until 00:00 UTC. For anything customers rely on, Workers Paid at $5 a month removes the cap and still gives you the free daily Neurons first.
Can I use Workers AI from India, the UK or Australia?
Yes. Workers AI runs on Cloudflare's global network, so you can call it from any country where you can open a Cloudflare account. Prices are the same everywhere, in US dollars, and requests run in a data center with free GPU capacity, usually near your users.
Where do I see my Workers AI usage?
In the Cloudflare dashboard under AI, Workers AI, which charts Neurons per day and per model, and in your billing page for paid usage.
Three weeks after launch, Jake's chat box had answered about 4,800 questions. The busiest day used 2,300 Neurons, less than a quarter of the free allowance, and the bill was still $0. The Sunday question came up 610 times. Jake's only change request was to make the bot say "we're closed Sunday, but you can drop your phone in the after-hours box" instead of just "we're closed," which Ethan fixed by adding one line to the system prompt, at a cost of about twenty extra input tokens per chat.
📌 If you keep one line from this page
Cloudflare Workers AI costs $0.011 per 1,000 Neurons after a free 10,000 a day on every plan (reset 00:00 UTC), which is $0.045 in and $0.384 out per million tokens on Llama 3.1 8B fp8-fast; the free plan stops at the allowance with error 3036, and Workers Paid ($5 a month) keeps going.
Smallest good model · fp8-fast builds · always set max_tokens.
Revision note. Written October 21, 2026. Prices are Cloudflare's list prices on that date. We will update this page when Workers AI prices, models or limits change.