- November 24, 2026
- 7 min read
What You’re Actually Paying For in an LLM Token
- Input, output, and cached tokens are priced differently because each takes a different amount of computation to produce.
- Prices vary widely across models because of model architecture, GPU hardware, and inference engine efficiency.
- For agent workloads, cache reuse decides the bill: the same 30-turn task can cost 5× more when context is recomputed instead of cached.

Say you are choosing a model, a provider, or both. Maybe you are building an agent or configuring an existing one. The agent might be a coding agent that edits a repository and runs its tests, a general-purpose assistant, or something customized to your product. Where do you even start, and what does it cost?
Most people start on a discovery page with a dashboard that shows the available models, what they are good at, and pricing. You may see a lengthy list of models that each carry three separate quotes (input, output, cached), with prices that swing by orders of magnitude between the rows. One model's tokens go for pennies per million, and the next model listing charges dollars for the same million.
It's tempting to read such a list as pure market dynamics: launch-week discounts, hype pricing, or whatever the traffic will bear. Some of that is real, but most of the spread is not arbitrary. Each quote comes down to the same few questions. How much computation does a token cost on this model, on this silicon, and under this serving stack? Answer those questions, and the price list starts to make more sense.
In this post, we will explore what influences model pricing. The three prices per model exist because three different computations sit behind them. Input, output, and cached tokens are priced differently because they cost different amounts to produce, and prices vary across models because per-token cost depends on the model, the hardware, and the serving engine. For agent workloads in particular, where the same growing context is sent over and over, whether that repetition is reused or recomputed can swing the cost of an identical task by as much as a factor of five. But first, let’s break down what happens with each LLM request.
Input vs. Output Tokens: Different Computations, Different Costs
Input and output prices differ because generating a token is a fundamentally different computation from reading one. Let's unpack how that works at a deeper level.
An inference request happens in two phases. When the request arrives, the server runs prefill, which processes the entire input prompt in parallel and stores the keys and values for every token in the KV cache. Then it runs decode, which generates output tokens one at a time, with each one attending to the full input plus everything generated so far (Figure 2). To produce the 1,000th output token, the GPU must re-read the stored state of the full prompt and the 999 output tokens before it, on top of the model itself.
The two phases have opposite hardware profiles. Prefill is generally compute-bound. Because all input tokens are processed in one pass, the GPU performs large matrix multiplications that keep its compute units saturated. A pass that would process one user's 10,000-token prompt can instead interleave several incoming prompts into the same compute-dense step, keeping the GPU's arithmetic units busy and spreading the same GPU-seconds over more customers. That works out to a fraction of the GPU time per token that decode needs, which is why input tokens are the cheap line on the price list.
Decode, on the other hand, is memory-bandwidth-bound, especially at smaller batch sizes. To generate a single token, the GPU must read the model's weights plus the KV cache for the context from high-bandwidth memory (HBM), then use that data for a tiny amount of arithmetic per byte moved. The work per token also grows as the context grows, because every step reads everything before it (Figure 3). NVIDIA's own engineering guidance describes each decode step as a matrix-vector workload, one that leaves the GPU's compute engines underused. The rest of the time, the chip is waiting on memory.
So an output token simply costs more GPU time than an input token, and the price list reflects that directly. The output rate is typically 3–5× the input rate for the same model. That ratio is not a surcharge. It is the shape of the arithmetic that ultimately shows up on the price list.
Why Cached Tokens Are So Cheap
Agent workloads call the model repeatedly with a growing shared prefix: the system prompt, the conversation so far, plus tool results. From turn to turn, almost all of that input is text the model has already processed. A companion post, How Modern LLM Architectures Reshape Agent Inference, covers how modern architectures change what a runtime must retain and reuse.
Prefix caching exploits that repetition. If the KV state was recently computed for a prompt's leading tokens and is still resident, the runtime reuses it and prefills only the newly appended suffix. A cache hit on 20,000 tokens means the GPU does zero heavy matrix work for those 20,000 tokens. It just resumes from a stored state.
The fair question is why providers charge for cached tokens at all, since the heavy computation was already done and paid for once. The answer lies in what the cached token still costs between calls. While cached, those 20,000 tokens occupy HBM that could otherwise hold other caches or serve other requests, and retaining them is what providers are paying for between calls. During decoding, the GPU still reads that cached state for every generated token. The bandwidth cost of a long context does not disappear, but the up-front computation does. Cached tokens are therefore much cheaper than fresh input tokens, and the cache line is priced accordingly.
Many providers, FriendliAI included, pass much of that saving to the customer. Cached input is commonly priced at 10–50% of the input price, sometimes lower. Note the discount applies to input tokens that hit the cache. Every output token you generate is still fully priced, because the decoding step cannot be skipped.
Why Prices Vary So Much Across Models
Every price list carries the same three lines: input, output, and cached input. The absolute numbers can differ by two orders of magnitude across models. Three layers of the stack explain most of the spread: the model, the hardware it runs on, and the inference engine serving it.
The model. Start with parameters. For a dense model, generating a token means reading all of its parameters from memory, so cost per token grows with model size. Mixture-of-experts (MoE) architectures break exactly that link. Only a subset of experts is active per token, so an MoE model's serving cost tracks its active parameter count rather than its total, and an 8×-bigger MoE model that keeps the same active count can keep its per-token compute roughly flat while quality rises, though the larger total parameter set still has to sit in memory, carrying its own cost in more GPUs or less room for the KV cache. MoE is why recent frontier-sized open models can price close to much smaller dense models. Attention architecture matters in the same way, because it sets how much state the model must store and read per token as the context grows. Grouped-query attention keeps a smaller per-token KV state, while linear, hybrid, and recurrent architectures compress or fix the amount of history the model carries. A cheap token under one architecture and an expensive token under another can be the same model family, purely because of state growth.
The hardware. Decode is typically bound by how fast memory feeds the chip rather than by raw compute, so GPUs matter mostly through HBM bandwidth and capacity per dollar. A new-generation GPU like the B200 trades up on both, lowering cost per token even at the same per-hour rental price. Capacity also sets how large the KV cache can be before spilling or evicting, which determines cache-hit economics as much as the discount does. Hardware also determines what computations run: each GPU generation brings different supported precisions, kernels, and attention implementations, so the same model can be a different amount of work depending on which silicon it was compiled for.
The inference engine. The same model on the same GPUs can cost wildly different amounts to serve depending on the inference engine. Because decode underutilizes compute, a better runtime recovers that headroom by batching more concurrent requests onto the GPU. More users share each gigabyte of weights read, which lowers the cost per token for everyone. In our recent benchmark, FriendliAI Inference generated about 2.1× vLLM's throughput on identical B200 GPUs, for roughly 53% lower GPU cost per token for the same model. Serving efficiency is a key factor that varies between providers offering the same model, which is exactly why identical open-weight models can carry meaningfully different prices across providers.
How Caching Affects Agent Costs
Production agent workloads are overwhelmingly input-heavy: research on serving real agents reports input-to-output token ratios around 100:1. At that ratio, the input and cache lines decide the spend, not the output line. Whether the growing context is reused or recomputed decides the total, as the example below shows.
Consider a coding agent completing one task (Figure 5). Its state is the system prompt, instructions, and file contents, reaching 30,000 tokens, and each agent turn appends roughly 1,000 tokens (a tool result plus the model's next reasoning step and tool call). Every turn re-sends everything from the beginning, so the input grows linearly while the genuinely new part stays constant. The task takes 30 turns. Assume the 30,000-token starting context is already warm in the cache from earlier work. Across all 30 turns, the agent's requests carry about 1.34 million input tokens in total, of which about 1.31 million hit the prefix cache. Only 30 thousand of those are genuinely new. Output comes to 30 thousand tokens as well.
The table below prices the same task under three caching conditions. Every scenario uses the same illustrative input and output rates, $0.60 and $2.40 per million. Only the cache price changes: $0.06 per million where the discount is 90%, $0.30 where it is 50%, and nothing cached at all in the no-hit case.
| Scenario | New input cost | Cached input cost | Output cost | Total |
|---|---|---|---|---|
| Every prefix cached (90% off) | $0.018 | $0.078 | $0.072 | ~$0.17 |
| Every prefix cached (50% off) | $0.018 | $0.392 | $0.072 | ~$0.48 |
| No cache hits | $0.801 | $0 | $0.072 | ~$0.87 |
(Illustrative rates per million.)
Two things stand out. First, the output tokens contribute $0.072 of the bill in every scenario, so the lines that decide the total are input and cache. Second, the size of the cache discount matters as much as the hit rate: the same task with the same perfect reuse costs nearly three times as much at a 50% discount than at 90%. And when caching fails entirely, the extra $0.70 buys nothing new. It recomputes tokens the model has already seen, the earliest ones up to 29 times over.
The Price List, Demystified
Read the pricing page again, and it is less mysterious. Input prices reflect a batchable, compute-bound pass. Output prices reflect serial decoding whose work grows with the context. Cache prices reflect skipped computation, with only the memory and reads still charged. Across models, the numbers track active parameters, state growth, GPU economics, and the efficiency of the serving engine underneath. The complexity that looks arbitrary at first glance is largely a matter of arithmetic and how tokens are actually processed.
For agent builders, all these points inform what to look for on a pricing page. How the inference engine calculates and then reuses a growing context as cache instead of recomputing it can say more about your eventual bill than the headline rates do. Understanding these mechanics lets you be selective about your inference platform. Try models like GLM-5.3 and GLM-5.3-Flash through FriendliAI Model APIs and run these comparisons on your own workloads. See how FriendliAI's inference efficiency translates into pricing on Friendli Suite.
👉 Browse open-weight models on FriendliAI
👉 Get your API key on Friendli Suite
👉 Connect your coding agents to FriendliAI with FriendliLink
👉 Join the FriendliAI Discord Community
Written by
FriendliAI Tech & Research
Share
General FAQ
Still have questions?
If you want a customized solution for that key issue that is slowing your growth, support@friendli.ai or click Talk to an engineer — our engineers (not a bot) will reply within one business day.

