Own Weights

Cost per million tokens, explained

Cost per million tokens explained: what the price includes, why input and output are priced apart, and how to compare models by cost per task.

Updated

Cost per million tokens is the price a model provider charges for every one million tokens you send and receive. It is the standard unit for comparing model prices, but on its own it tells you what a token costs, not what a job costs. To turn it into a bill, you also need the split between input and output, the size of each job, and how many times the job runs. For a worked example, our hosted price per million tokens and per 1,000 documents sits beside Claude Opus and Sonnet on the same contracts.

What the price counts

Most providers charge for input tokens (the instructions, the prompt and the document you send) and output tokens (what the model writes back) at different rates, and output is usually the higher rate. Claude Haiku lists at $0.10 per million input tokens and $0.50 per million output tokens, for prompts up to 100K tokens. Anthropic’s Batch API is half price for work that can wait for results. Check each provider’s current pricing page before you use any of these numbers in a plan, because list prices change.

A single per-million figure is therefore a blend, and its real value depends on how much text goes in and how much comes out. A task that reads a long contract and returns a short label is almost all input. A task that drafts a long reply is mostly output. Work out your mix before you compare two prices, since two models with the same headline number can produce very different bills.

A worked example

Suppose each job sends a 20,000-token contract and gets back a 300-token answer. The sizes are made up for illustration. They are not a measured result.

At Haiku’s list prices, the input costs 20,000 × $0.10 / 1,000,000 = $0.002, and the output costs 300 × $0.50 / 1,000,000 = $0.00015. That is $0.00215 per job, or $2.15 per 1,000 jobs.

At Claude Opus’s list prices of $4 input and $20 output per million tokens, the same job costs $0.08 for input plus $0.006 for output, or $0.086 per job. That is $86 per 1,000 jobs, 40 times the Haiku figure, because both list prices are 40 times higher. Run the same sum with your own token counts in the LLM cost calculator, and then check whether the cheaper model still gets the answers right.

Mistakes that inflate the bill

  • Comparing per-million prices across tokenizers. Each model splits text into tokens with its own tokenizer, so the same document can become more tokens in one model than in another. A lower price per million tokens does not guarantee a lower bill. Compare LLM API pricing by cost per task instead. For a plain definition, read what are tokens.
  • Counting tokens on a short invented prompt. Count on a sample of real inputs, including the longest ones. Long documents can dominate the total, so an average can hide the expensive cases.
  • Ignoring repeated context. A long system prompt sent on every call is billed on every call unless the provider caches it. See prompt caching: what it saves and when it doesn’t.
  • Letting answers run long. A verbose answer bills at the same per-token rate as a short one, so answer length is a cost decision. Set a length limit in the prompt and test whether the shorter answer is still correct.
  • Forgetting hidden output. Some models bill internal reasoning as output even when you never see that text, so the output count can be far above the visible answer. See reasoning tokens and their cost.
  • Forgetting retries. Failed calls and retries consume tokens and return no result. Include them in the per-job figure.

How to compare cost per task

  1. Count tokens on a sample of your real inputs, not on a short made-up prompt.
  2. Price input and output separately, using each provider’s current pricing page.
  3. Add retries, failed calls and any reasoning output to the total.
  4. Turn the result into cost per task or cost per document, since that is what you actually pay for. For a document-based example, read LLM cost per document.
  5. Score the outputs on the same test before you switch. A cheaper model that gets more answers wrong is not cheaper. For a method, read how to test an LLM on your own data.
  6. Re-run the sum at your expected monthly volume, and again whenever a provider changes its prices. Batch and caching discounts apply only to some of your calls, so check which of them qualify.

Where a fine-tuned model fits

A per-token price is only half of the comparison. A model that costs less per token but misses more answers can cost more per correct result, so read price and accuracy together. To compare on that basis, divide the total cost of a test run by the number of answers a person marked correct. That cost per correct answer is the figure to set beside each per-million price.

If one task makes up most of your volume, the per-million price matters a great deal. Own Weights (ownweights.com) fine-tunes an open-weight model for that one task, tests it against the model you use now on your own data, and serves it in your cloud account or on-prem. A trained model is deployed only if it beats the current model on that test, and you own the weights. A smaller specialized model can lower the per-token price, but only a test on your own data shows whether it is accurate enough to replace the current model.

Start with the free AI cost audit. It reads your code as text on your own machine, makes no network calls while it reads, and saves a PDF listing your AI calls, models, estimated cost and common problems. Or book a call, and we will go through your numbers together.

Questions

What does cost per million tokens mean?

It is the price a model provider charges for one million tokens. Providers usually list separate prices for input and output. Your bill is each price multiplied by the tokens you send and the tokens you receive.

Why is output more expensive than input?

The model writes output one token at a time, which takes more compute than reading input in one pass. Providers price the two separately, and output is usually the higher rate. Check each provider's current pricing page for its numbers.

Does the lowest price per million tokens mean the lowest bill?

No. A model with a lower token price can split the same text into more tokens, need retries, or write longer answers. Compare the total cost of one task on your own data before you switch.