Skip to content
inference.academy

Paying for inference

What actually drives my LLM API bill?

An invoice says tokens in and tokens out. It does not say that most of the tokens in were tokens the provider had already read, sent again because a conversation re-sends its whole history every turn. Pick a model and a workload that looks like yours, and watch which line of the bill actually moves when you change something.


Model, at list price on 2026-09-16
Workload shape
explicit: reads at $0.2, writes at $2.5 per 1M; batch at 50%
No caching$15K / month
Caching at 90% hits (your settings)$4.9K / month
Caching and the batch tier$2.4K / month
System prompt, re-sent 10.3cHistory, re-sent 24.5cNew input 9.4cOutput 10.0cper conversation, your settings

History re-reads are the biggest line: 94% of every prompt token you are billed for is something the provider has already seen. At 90% hits the cache takes this conversation from $1.72 to 54.1c.

Per month
$4.9K
Per conversation
54.1c
Prompt tokens re-read
94%
Served from cache
85%
Model, same workloadNo cacheYour settingsCache
Claude Fable 5.1 Anthropic$77K$20Kexplicit
Claude Opus 5 Anthropic$39K$12Kexplicit
Claude Sonnet 5 Anthropic$15K$4.9Kexplicit
GPT-6 Astra OpenAI$77K$24Kexplicit
GPT-5.6 Terra OpenAI$16K$5.1Kexplicit
GPT-5.6 Luna OpenAI$1.6K$505explicit
Gemini 3.8 Flash Google$5.8K$1.6Kautomatic
GLM-5.3 Z.ai$11K$3.5Kautomatic
GLM-5.3 Flash Z.ai$681$237automatic
DeepSeek V4.1 Flash DeepSeek$1.1K$237automatic
DeepSeek V4 Pro DeepSeek$4.4K$902automatic
Turn t sends the system prompt, everything from turns 1 to t-1, and the new message, and gets 400 tokens back. With caching, the prefix already seen is charged at the cache read price on a hit and re-written on a miss; new tokens are written at the write price so the next turn can read them. Thirty days a month. List prices from the OpenRouter catalogue on 2026-09-16, which is what a direct account pays before any router fee; check the vendor page before deciding anything.

Output is expensive per token; history is expensive because you pay for it every turn. A token out costs four to six times a token in on most models, which is why the first instinct is to shorten answers. But a twenty-five turn agent session sends its first tool result twenty-four more times, and by the last turn the request is almost entirely things the model has seen. In the coding-agent shape above, 94% of every prompt token billed is a re-read. That is the biggest line on the invoice, it grows with the square of the conversation length, and it is invisible in a per-token price list.

Prompt caching is the lever, and it is a prefix contract. Every major provider will serve a prompt token it has already processed at around a tenth of the price, some automatically, some only where you mark the breakpoints, and the explicit ones charge a quarter more to write what they will later read. The condition is that the request begins with the exact bytes of an earlier one. A timestamp in the system prompt, a session id, a tool list in a different order, a retry that rebuilds the conversation another way: any of them moves the prefix and drops you silently onto the uncached line. The cache also expires, five minutes on most defaults, so a user who thinks for ten minutes pays full price for their history. Stable content first, volatile content last, and the cached-token count on a dashboard from day one, because nothing else tells you when this breaks. On a measured agent loop, cache misses cost 5.6 times more per turn.

The batch tier is half price for work that can wait. Anthropic, OpenAI, Google and Z.ai all list an asynchronous tier at 50%, with results within a day; DeepSeek does not. Classification, extraction, nightly summaries, evaluation runs: anything not attached to a person waiting is candidate. It stacks with caching. Most teams who have never used it have a quarter of their spend that would qualify.

What to watch, if you watch four things. The cached share of prompt tokens, because a drop is a broken prefix. Cost per task rather than per token, because a cheaper model that takes three tries is not cheaper. The ratio of input to output tokens, because it tells you which price matters for you. And retries, because a timeout that is retried is billed twice and appears in no latency chart.


What this model leaves out

Reasoning tokens. On a thinking model the tokens spent thinking are billed as output and are often several times the visible answer. The output slider here is the visible answer only; if your model reasons, multiply that line.

Long-context surcharges and tiered pricing. Several vendors charge more per token above a threshold, typically 200K of context. The simulation prices every token at the base rate.

Cache lifetimes, minimum prefix lengths and the difference between automatic and explicit caching in practice. A 90% hit rate is a good implementation; the default for an unmanaged one is nearer the 53% to 100% measured across serving routes on the next page.

Router fees and the difference between list price and what a router’s upstream actually charges, which is the subject of the next page.


Read next