Every provider quotes llm pricing per million tokens, yet two providers with nearly identical price lists can produce bills that differ by a factor of three. The headline rate is only one ingredient. To compare LLM pricing across providers without a spreadsheet, you need one shared unit of work, a short list of the charges outside the headline rate, and a way to test real prompts against real models.
Why the headline rate misleads you
A price list tells you what a million tokens cost, not how many tokens your app sends, how many come back, or what happens when a request is cached, retried, or batched. Two models priced the same can behave very differently: one may need a long system prompt on every call, the other may answer in half the words. The cheaper model on paper can end up the expensive one in practice.
Providers also define the same thing differently. Some split input and output prices widely, others keep them close. Some discount cached reads, others bill every token at full price. Some offer a batch discount for work that can wait a day, others do not. Comparing headline rates alone is like comparing cars by fuel price while ignoring how much fuel each one burns. The first move is not to open three pricing pages side by side. It is to define what one unit of work costs you, in your app, with your prompts.
Pick one unit of work and price everything against it
Your users do not buy tokens; they buy outcomes. A support reply, a document summary, a code review, a classification: each of these is one unit of work. Measure everything against that unit.
List the three or four tasks your app runs most often. For each one, note the typical prompt: system instructions, user input, and retrieved context. Then run each task a few times on each candidate model and record input tokens, output tokens, cached tokens, and whether the answer was usable without a retry. Most provider dashboards report token usage per request, so you need no special tooling.
Once you have those numbers, the comparison becomes arithmetic: input tokens times the input rate, plus output tokens times the output rate, minus any caching discount. That is your cost per unit of work. If you already track AI API costs before the bill surprises you, reuse that usage data instead of running fresh tests. You do not need an llm cost calculator for this; a few lines of notes and a pocket calculator are enough.
The table below shows the line items that feed into a cost per unit of work. Every provider bill is built from some combination of these rows.
| Line item | What it is | Why it varies |
|---|---|---|
| Input tokens | Prompt and retrieved context | Long prompts inflate it |
| Output tokens | Tokens the model generates | Verbose models cost more per answer |
| Cached input | Repeated prefixes at a discount | Discount and cache life differ |
| Batch requests | Non-urgent work, lower rate | Not every provider offers it |
| Retries | Repeat calls after errors | Unreliable models cost more |
Input vs output token costs are not interchangeable
Output tokens usually cost several times more than input tokens, so a model that writes long answers is expensive even when its input rate looks cheap. This matters most for drafting, summarising, and code generation, where the answer is much longer than the question. For classification or extraction, where the answer is a few tokens, the input rate dominates instead.
Work out the input-output ratio for each of your tasks before you compare rates. A chatbot that sends a 2,000-token conversation history and gets a 150-token reply back is input-heavy. A report writer that takes a short brief and returns 1,500 tokens is output-heavy. The same two providers will rank in opposite order for those two workloads. If you want a deeper look at how token counts drive the bill, the breakdown of LLM token costs and how to cut your AI bill without losing quality pairs well with this step.
Compare LLM pricing across providers in ten minutes
Here is the whole method, compressed into a routine you can run whenever a provider changes prices or a new model ships.
- List your top three tasks. Use the tasks that generate most of your traffic, not the ones that sound interesting.
- Capture real prompts and outputs. Pull ten recent requests per task from your logs, or write ten representative examples by hand.
- Run them on each candidate model. Record input tokens, output tokens, and whether the answer was usable without a retry.
- Apply each provider’s published rates. Compute the cost per task from your token counts, minus any caching or batch discount. Check official pricing when you run the test, since rates change and list prices drift out of date.
- Add the retry rate. If a model needs a second attempt one time in ten, add ten percent to its cost per task. A model that answers correctly the first time is cheaper than a cheaper model that does not.
- Rank by cost per completed task, not cost per token. The winner finishes the job for the least money, not the one with the lowest sticker price.
This routine fits on one page of notes. Run it again whenever your prompts change, because a new system prompt or a larger retrieval window can flip the ranking.
The charges that never appear in the headline rate
Four line items quietly move the total, and none of them show up when you compare two headline rates.
Prompt caching. If your system prompt and retrieved context repeat across requests, some providers bill those repeated tokens at a steep discount after the first call. Discount size and cache lifetime vary widely. If your app sends the same long instructions on every call, caching can cut the input bill sharply; if every request is unique, it saves nothing. The guide to how LLM prompt caching works explains when the discount applies and when it does not.
Batch pricing. Some providers cut the rate substantially for requests that can wait hours instead of seconds. Overnight summarisation, bulk classification, and backfill jobs fit this pattern well; live chat does not. If half your workload can wait, the batch rate is the rate that matters for that half.
Failed and repeated calls. Timeouts, rate limits, and answers that miss the mark all cost money twice: once for the failed call, once for the retry. Track your retry rate per model for a week. A token pricing comparison that ignores retries flatters the model that fails most.
When the cheapest model costs more
The lowest rate per million tokens wins only when everything else is equal, and it rarely is. Three situations flip the ranking.
First, quality gaps. A cheap model that needs a retry, a longer prompt, or a human review step is not cheap. Fold the share of answers that ship without rework into the cost per completed task.
Second, context size. A model with a small context window may force you to split long documents into several calls, each carrying the instructions again. The extra calls cost more than the saving on the rate. A pricier model with a larger window can finish the same document in one call.
Third, speed. A slow model holds connections open, queues requests, and forces you to run more concurrency to meet latency targets. That shows up as infrastructure cost and as users abandoning slow features, neither of which appears on the provider invoice. Before switching on price alone, read a current comparison of the major LLM API pricing and re-run the ten-minute test above with your own prompts, since published comparisons age fast and your workload is the only one that matters.
A short checklist before you switch providers
Switching is cheap to start and expensive to undo. Run through this list first.
- Re-run your top three tasks on the new model with real prompts and confirm the answers are good enough to ship.
- Compare cost per completed task, including retries, caching, and batch discounts, not cost per million tokens.
- Check whether your prompts rely on behaviour only the old model has, such as strict JSON output, tool calling, or a particular tone.
- Confirm data handling, region availability, and rate limits meet your needs; a lower price does not help if the model is unavailable in your region.
- Move a small share of traffic first and watch error rates, latency, and cost per task for a week before moving the rest.
Price lists change every few months, and new models arrive faster than that. The habit that saves money is not picking the cheapest provider once; it is re-running a small, honest comparison whenever something changes. The token optimisation techniques that cut LLM API costs are a useful next step once the comparison tells you where the money actually goes.