How LLM inference pricing works
LLM inference pricing explained: how per-token rates, output tokens and batch discounts add up to your bill, and how to compare providers fairly.
Updated
LLM inference pricing is the fee a provider charges for each model call. Most providers bill by the token, and they charge separately for the text you send in (input) and the text the model sends back (output). Output tokens usually cost more per token, so two calls of the same size can produce very different bills.
What gets billed on every call
A token is a small piece of text, often part of a word. Each request has two billable parts. Input tokens cover your system prompt, the user message, attached documents and any earlier conversation you resend. Output tokens cover everything the model generates, including reasoning text you never show a user.
Here is a worked example at the Claude Opus list prices of $4 per million input tokens and $20 per million output tokens. A call with 10,000 input tokens and 1,000 output tokens costs $0.04 for the input and $0.02 for the output, so the input is two thirds of the bill. Output costs five times as much per token, but the prompt is ten times longer than the answer. Flip those lengths and the split flips with them, which is why you count input and output separately.
Common mistakes that inflate the bill
Price per token is only one input to the bill. Token count per call, call volume and the input-to-output mix matter as much. These four mistakes show up most often:
- Resending a long system prompt. It adds input cost on every request, even when nothing in it changes. Keeping stable instructions in a prefix that providers can cache reduces this.
- Treating retries as free. A timeout that triggers a retry bills again. A flaky integration can double spend without anyone noticing, so log every attempt.
- Forgetting hidden output. Reasoning models can bill thinking tokens as output even when you never display them. A budget built from visible answer length will run low.
- Comparing token counts across models. Tokenizers differ, so the same contract can count as a different number of tokens in each model. Two models with similar rates can still produce different totals.
Per token versus per document
A rate card does not tell you what one job costs. The number that matters is the cost per document, ticket or extraction, and it can move in the opposite direction from the token price. A model with a lower rate still costs more per job if it needs longer prompts or writes longer answers. The cost per million tokens guide explains how those rates turn into a bill.
To get the per-document figure, run a sample of real documents through each model, add the input and output cost of every call including retries, and divide by the number of documents. Then score those same outputs, because a cost gap says little about quality on its own.
Discounts and fine print
Discounts change the effective rate, but only for some workloads. Anthropic’s Batch API is half price for work that can wait, which suits overnight extraction and bulk document jobs but not a user watching a screen. Prompt caching lowers the cost of input text that repeats across calls, which helps when many requests share a long fixed prefix. Both need your traffic to fit their rules, so read the terms before you count on them.
Rate limits can force queues or retries, and each retry is another billed call. Some providers also price very large prompts differently, so a job that sometimes sends long documents can produce two rates in one bill. Check the batch versus real-time guide before you pick a discount, and the reasoning tokens guide before you budget a reasoning model.
How to compare two price lists
Run the comparison on your own work, not on the marketing page. Use these steps, and a cost calculator can handle the arithmetic in steps two and three.
- Pull a representative sample of real inputs and count the tokens per call with each provider’s token counter.
- Multiply those counts by each provider’s input and output prices, then by calls per day.
- Add retries, failed calls and any reasoning tokens the model bills.
- Apply a discount only to the part of the workload that qualifies for it.
- Run each model on your own labeled test set and score the output. A cheap model that gets the task wrong costs more in review time than it saves in tokens.
Step five matters most. The cheapest price per token is not the cheapest route to a correct result, and a model that needs a second pass or a human check can cost more per finished job. Compare the same unit on both sides as well. A monthly invoice from one provider set against a per-call estimate from another will mislead you.
Where owning the model changes the math
Per-token pricing means your bill rises with every call, whether or not the work gets more valuable. If you run an open-weight model in your own cloud account or on-prem, the cost becomes the compute you run instead of a per-token fee. That makes the bill easier to forecast, since it depends on your own volume and capacity rather than a provider’s rate card.
Owning the setup also means you carry the capacity planning, monitoring and upgrades. For a single high-volume task, that trade often pays off. For a low-volume feature, a hosted API may still be simpler. Own Weights fine-tunes an open-weight model for one task a company now sends to a frontier API, tests it against the current model on the company’s own data, and serves it in the customer’s cloud account or on-prem. The customer owns the weights.
Start from the number that matters: the cost of one document, ticket or call on your own data. Own Weights runs a free AI cost audit that reads your code, lists every AI call with its model and estimated cost, and saves a PDF on your machine. Book a free audit or a call with the button on this page, or visit the homepage to see how the process works.
Questions
What does LLM inference cost per million tokens?
Providers list one price for input tokens and a higher one for output tokens, both per million. Output is usually the expensive side, so a model that writes long answers costs more per call. Rates change often, so read the current pricing page of each provider before you build a budget.
Why is my LLM bill higher than the per-token price suggests?
The bill multiplies token counts by call volume, so a long system prompt repeated on every request, retries and long generated answers add up fast. Reasoning models can also bill hidden thinking tokens as output. Measure tokens per call on real traffic before you trust an estimate.
Is a batch API worth it for LLM work?
It is worth it when the work does not need an answer in seconds. Batch jobs run later at a lower rate, which suits overnight processing and bulk document work. Keep real-time calls for anything a user is waiting on.