Workers AI is not billed in tokens. It is billed in neurons, and the conversion between the two is published per model, which means you can compute a real cost per request rather than estimating one.
What a neuron is
Cloudflare defines a neuron on its Workers AI pricing page as its way of measuring AI output across different models, representing the GPU compute needed to perform a request. It is a unit of work, not a unit of text, which is why one unit can price a text completion, an embedding and an image generation on the same meter.
The practical consequence is that neurons are the only figure that composes across a mixed workload. If your Worker does one embedding and one completion per request, adding tokens together is meaningless because the two are not the same kind of token; adding neurons together is exactly right.
The two numbers that set your bill
At the time of writing, Cloudflare publishes a free allocation of 10,000 neurons per day at no charge, on both the Free and the Paid plan, and a rate of $0.011 per 1,000 neurons for usage beyond that on Paid. Those two figures, plus a per-model neuron rate, are the whole model.
The per-model rates are published as neurons per million tokens, separately for input and output. A few from Cloudflare’s pricing table, quoted as of August 2026:
- Llama 3.2 1B — 2,457 neurons per million input tokens, 18,252 per million output tokens ($0.027 and $0.201 per million tokens respectively).
- Mistral 7B — 10,000 neurons per million input tokens, 17,300 per million output tokens.
- Llama 3.1 70B — 26,668 neurons per million input tokens, 204,805 per million output tokens ($0.293 and $2.253 per million tokens).
Notice the ratio inside each row rather than the difference between rows. Output on Llama 3.1 70B costs about 7.7 times what input costs per token; on Llama 3.2 1B the same ratio is about 7.4. That asymmetry is not a Cloudflare pricing decision, it is the economics of autoregressive decoding showing through the meter, and it means the single largest lever on your bill is how long the answers are.
Every figure in this section is Cloudflare’s published value at the time of writing and is expected to move — the model catalogue changes monthly and rates change with it. Read the current numbers from Cloudflare’s Workers AI pricing page before committing them to a budget.
Working a cost per request
Take a support-answering endpoint. The assumptions, stated so you can substitute your own: 800 input tokens per request (a system prompt plus two retrieved passages plus the question), 200 output tokens per request, and Llama 3.1 70B as the model. Nothing here is measured — it is arithmetic on Cloudflare’s published rates.
input : 800 / 1,000,000 x 26,668 neurons = 21.33 neurons
output : 200 / 1,000,000 x 204,805 neurons = 40.96 neurons
total = 62.29 neurons per request
cost : 62.29 / 1,000 x $0.011 = $0.000685 per request
~ $0.69 per 1,000 requests
~ $68.52 per 100,000 requests
The same arithmetic on Llama 3.2 1B, with the same 800-in/200-out assumption, gives 1.97 + 3.65 = 5.62 neurons per request, or about $0.0000618 — roughly a ninth of a cent per thousand requests. An eleven times cost difference between the two models on an identical workload is the sort of thing worth knowing before choosing, and it is fully derivable from published numbers.
Note also that the 200 output tokens contributed 66% of the 70B cost from 20% of the tokens. Cutting the answer to 100 tokens saves more than halving the prompt does.
How far 10,000 neurons a day goes
Dividing the daily free allocation by the per-request figures above gives a concrete answer to the question people actually have:
Llama 3.1 70B : 10,000 / 62.29 = ~160 requests per day
Llama 3.2 1B : 10,000 / 5.62 = ~1,780 requests per day
(same assumption: 800 input tokens, 200 output tokens per request)
So the free allocation is a development and demo budget on a large model, and something closer to a small-app budget on a small one. When it runs out, the request does not queue or degrade — Cloudflare documents error 3036, HTTP 429, with the message “You have used up your daily free allocation of 10,000 neurons”. Handle that specific code rather than treating every 429 alike; the other documented 429 on this service means something entirely different, and the rate limits page covers the distinction.
Reading the meter yourself
The arithmetic above uses assumed token counts. You do not have to assume: a non-streaming text-generation call returns a usage object with prompt_tokens, completion_tokens and total_tokens, which is everything the neuron computation needs. Recording it per request converts a forecast into a measurement of your own traffic.
// rates in neurons per million tokens, from Cloudflare's pricing table
const RATES = {
"@cf/meta/llama-3.1-8b-instruct": { in: 0, out: 0 }, // fill from the table
};
function neuronsFor(model: keyof typeof RATES, usage: {
prompt_tokens: number;
completion_tokens: number;
}) {
const rate = RATES[model];
return (
(usage.prompt_tokens / 1_000_000) * rate.in +
(usage.completion_tokens / 1_000_000) * rate.out
);
}
Two cautions about that pattern. The rate table is a copy of somebody else’s published numbers and will drift, so treat any total you compute from it as an estimate for capacity planning rather than as a reconciliation of an invoice; the account’s own usage reporting is the authority on what you were charged. And usage is on the non-streaming response. A streamed call resolves to a ReadableStream, so if you stream everything you have no usage object at all unless the provider surfaces one in the final frame.
The practical consequence is that a fully streamed product measures its own token consumption worse than a non-streamed one. Sampling helps: run a small percentage of traffic non-streamed, or count output tokens approximately as you relay frames, and accept an approximate number rather than having none.
What the neuron price does not include
Neurons pay for inference. They do not pay for the Worker that made the call, which is billed on Workers’ own request and CPU-time meter; they do not pay for the Vectorize queries a retrieval step performs, which are billed on queried and stored vector dimensions; and they do not pay for any third-party provider you call instead of a @cf/ model. A retrieval-augmented request touches at least three meters, and a cost model that counts only the largest one will be wrong in the direction that matters.
Cloudflare also lists some models as requiring the Workers Paid plan — error 5035, HTTP 403, “This model requires a Workers Paid plan” — and applies tighter per-account request rates to frontier models. Neither is a price, but both change which models your cost model is allowed to contain.
Neuron rates are per model, so the moment you route between a @cf/ model and anything else, cost attribution stops being readable off one invoice — you have neurons on one meter and dollars per million tokens on another, with different rounding and different billing periods. Whatever normalises those into one per-request number has to sit where every call passes through it. That is what an LLM gateway like Multigrid records per request; the useful part is the principle that the measurement point must be upstream of the routing decision, not downstream of it.
Top comments (0)