computetrail

← Guides

How to Estimate Your LLM API Bill Before You Ship

By Jaehyun Jeon · reviewed 2026-07-19
Engineer working with LLM APIs; maintainer of computetrail. About →

Almost every team we talk to picks a model the same way: they open a pricing page, see a number like “$2 per million tokens,” multiply by a vague guess, and move on. Then the first real invoice arrives at three times the estimate.

The gap is almost never the price. It’s that a per-million-token number hides three things that decide your actual bill: the split between input and output tokens, whether you’re paying full price for repeated context, and how much your traffic really is. Here is the method we use, worked end to end with live prices.

Step 1: Separate input from output

This is the single biggest mistake. Providers quote input (the prompt you send) and output (the text the model generates) as two different prices, and output is almost always several times more expensive. As of our 2026-07-14 snapshot:

If you estimate on the input price alone, you’ll undercount output by 5–6×. So the first thing to do is estimate the two token streams separately.

A rough starting point for a chat or assistant workload: 1,000–2,000 input tokens per call (system prompt + retrieved context + user message) and 200–600 output tokens for a typical answer. Reasoning-heavy or long-form generation flips this — output can dwarf input.

Step 2: Build a monthly volume, not a per-call cost

Per-call costs are reassuringly tiny and completely misleading. Work in months.

Take a support assistant handling 50,000 conversations a month, one model call each, at 1,500 input tokens and 400 output tokens per call:

Now price that against three models:

Model Input (75M) Output (20M) Monthly
Claude Sonnet 5 $150 $200 $350
GPT-5.6 Luna $75 $120 $195
DeepSeek V4 Pro ($0.435 / $0.87) $32.60 $17.40 $50

Same workload, same token counts — a 7× spread in bill, entirely from model choice. This is why the per-million number on its own tells you almost nothing.

Step 3: Subtract what you can cache

Most production prompts repeat a large, identical chunk on every call — a system prompt, tool definitions, a few-shot block, or retrieved documents. Many providers now let you cache that chunk and charge a fraction of the input price to re-read it. In our data, 168 of 315 paid models publish a cache-read price, and on the major models the discount lands around 90%.

Back to the example. Suppose 1,000 of those 1,500 input tokens are a fixed system prompt you can cache. On Claude Sonnet 5:

(There’s a one-time cache-write cost and a short time-to-live to account for, but for steady traffic the read savings dominate. We break the caching math down separately.)

Step 4: Add the things people forget

The estimate above is the floor. Real bills also carry:

Step 5: Sanity-check against the blended price

Once you have an input:output ratio, you can collapse a model to a single “blended” number for quick comparison. computetrail shows a blended figure assuming a 3:1 input-to-output mix — (3 × input + output) / 4. For the models above that’s roughly $4.00 (Sonnet 5), $2.25 (GPT-5.6 Luna), and $0.54 (DeepSeek V4 Pro) per 1M tokens.

Blended numbers are for ranking, not budgeting — your real ratio might be 10:1 (heavy RAG) or 1:3 (long-form writing), which moves the answer a lot. Use blended to shortlist, then price your actual ratio for the finalists.

A checklist you can reuse

  1. Estimate input and output tokens per call, separately.
  2. Multiply by realistic monthly call volume.
  3. Price input and output against each candidate model.
  4. Subtract cacheable repeated context (~90% off on majors).
  5. Add 10–15% for retries, plus fan-out for chains/agents.
  6. Rank on blended price, budget on your real ratio.

The prices in this guide are from our 2026-07-14 snapshot and move over time — sometimes sharply. Each model on computetrail carries its own daily price history, so before you commit a budget, check whether your chosen model’s numbers still hold.


Figures from computetrail’s 2026-07-14 price snapshot. computetrail records LLM API prices once a day and keeps the full history; see our methodology. This guide is general cost-modeling information, not financial advice — verify current provider pricing before committing.

More guides