# How to estimate LLM API cost before you build

Canonical: https://llmcostbot.com/en/guides/how-to-estimate-llm-api-cost
Verified: 2026-12-02
License: CC BY 4.0 with attribution to LLMCostBot

An LLM bill is four numbers multiplied: input tokens per call, output tokens per call, calls per month and the recorded price per 1M tokens. This guide fixes each number in order, applies the 30 recorded list prices, and shows where a single figure becomes misleading. Every figure is an estimate from list prices, not a quote.

## Start with the four numbers, not the model

Most cost comparisons start with a model and then guess the tokens. That order hides the real driver: a 2,000-token support reply and a 180,000-token contract are different products, not different line items. Write down input tokens, output tokens, calls per month and the retry rate first. Only then compare prices.

The retry rate matters because every retry re-sends the same input and produces output again. A 5% retry rate is a 5% bill increase on the same traffic, before any price change. This catalog keeps retries separate from the base volume so the effect stays visible.

## Per-1M pricing is a unit, not a bill

Prices are quoted per 1M tokens, but bills are per call. The conversion is simple: tokens per call ÷ 1,000,000 × price per 1M. On GLM 5.3 Flash, a support reply with 2,000 input and 300 output tokens costs <$0.0001 per call at standard input prices. Multiply by volume to reach a month.

The mistake is comparing the input price of two models when the workload is output-heavy, or the output price when almost all tokens are input. The workload template pages show both sides and the blended total, so the unit price never stands in for the bill.

## Apply hard constraints before ranking by price

A cheap model that cannot hold your document is not a cheaper option; it is not an option. Context window, maximum output and input modalities are hard filters. The templates below remove models that fail a constraint, then rank the rest by recorded price.

Workload templates and their cheapest eligible model (verified 2026-12-02)

| Workload | Required | Cheapest eligible | Monthly |
| --- | --- | --- | --- |
| customer support bot | none | GLM 5.3 Flash | $1.81 |
| RAG assistant | context ≥ 500,000 | GLM 5.3 Flash | $2.91 |
| coding agent | context ≥ 1,000,000; output ≥ 200,000 | DeepSeek V4.1 Flash | $0.8304 |
| PDF invoice extraction | context ≥ 128,000; file input | Claude Haiku 5.5 | $3.94 |
| long-document summary | context ≥ 1,000,000; file input | Claude Haiku 5.5 | $0.5508 |
| translation pipeline | none | GLM 5.3 Flash | $0.4731 |
| content writing | output ≥ 8,000 | GLM 5.3 Flash | $0.1303 |
| meeting summary | audio input | Gemini 4 Hydrogen | $11.47 |

Each row uses its page's stated assumptions. Open the template for tokens, volume and sensitivity.

## Report a range, not a point estimate

Token counts are estimates. A support reply that averages 2,000 input tokens will be 1,400 on some days and 3,100 on others. The workload pages therefore show a ±30% volume range next to the headline figure, plus a seven-scenario sensitivity table. If a ±30% swing changes the decision, the decision needs a tighter token measurement, not a different model.

The range is arithmetic, not a confidence interval. It does not model seasonality, product changes or price revisions; it only shows how the total moves when the assumptions move.

## A worked example, line by line

Take the customer support bot template. It assumes 2,000 input tokens and 300 output tokens per call, 20,000 replies per month, and a 2% retry rate. The effective call count is 20,400 per month, not the headline volume, because retries repeat the request.

Multiply the effective calls by the token counts: 40,800,000 input tokens and 6,120,000 output tokens per month. On GLM 5.3 Flash, that is $1.32 of input and $0.4988 of output, for $1.81 in total. Every number in that sentence can be checked against the model page and the assumption box.

Writing the split down is more useful than writing only the total. If input is the larger line, the levers are prefix size and cache hit rate. If output is larger, the levers are answer length and output price. A single monthly figure hides that choice; a two-line bill exposes it.

## Measure tokens before you trust the estimate

A common shortcut is four characters per token for English text. It is a rough heuristic, not a measurement: code, JSON, Chinese, emoji and long identifiers all move the ratio. Use it to size a first estimate, then replace it with a sample from the provider's usage report or a tokenizer for the chosen model.

Sample deliberately. Take one hundred real requests, measure the full prompt (system instruction, tool definitions, retrieved context and the user turn) and the full completion, and compute the average and the spread. Averages set the budget; the upper end of the spread tells you how often a request will hit a context or output ceiling. This catalog does not collect traffic distributions, so the spread has to come from your own logs.

Finally, record what you measured and when. Token counts drift when the prompt template changes, when a retrieval step adds chunks, or when the product starts sending images. An estimate without a measurement date quietly becomes a historical anecdote.

## Set a guardrail, not a promise

An estimate is a planning input, not a procurement commitment. Use it to compare options and to set a monthly guardrail, for example a budget alert at 130% of the estimate. If the alert fires, compare the actual token mix with the assumed mix before changing models; a prompt that grew is a more common cause than a price change.

Re-run the estimate when any of the four inputs changes materially: the prompt, the output length, the monthly volume, or the recorded price. The price index page exists for the last one; the workload sensitivity table shows how much the first three can move the total. A quarterly re-check is usually enough for a stable product, and a re-check before every launch is cheap insurance.

## A five-minute checklist

Before you present a monthly number, walk through the same five checks. They take minutes and prevent most of the errors that make a cost model untrustworthy later.

- Fix the four inputs: input tokens, output tokens, calls per month and retry rate.
- Apply hard constraints first: context, maximum output and input modalities.
- Compute the total from recorded prices, and show the input and output lines separately.
- Attach a ±30% range and name the assumption that moves the total most.
- Write down the source link, the verification date and the trigger for re-checking.

## Compare two candidates fairly

A fair comparison holds everything except the model constant. Same token counts, same monthly volume, same retry rate, same cache assumption and the same hard constraints. If one candidate needs chunking and the other does not, the token counts are no longer the same and the totals are not comparable; model the chunked path separately.

Write the comparison as two lines per candidate, input and output, then a total. When one candidate wins on input and loses on output, the reader can see why the final order flips with the workload. A single total without the split invites the reader to assume the wrong driver.

## When to revisit the model

Revisit the choice when the workload changes, not on a fixed calendar. A new retrieval step, a longer answer format or a different input modality can invalidate the constraint check. A price change can invalidate the arithmetic even when the workload is unchanged. The changelog and the monthly price index exist to make the second case visible.

If neither the workload nor the prices moved, re-running the same estimate usually produces the same answer. Spending the review time on token measurement is a better use of attention than re-ranking unchanged prices.

## What the estimate leaves out

Batch discounts, negotiated rates, committed-use credits, taxes and failed requests beyond the stated retry rate are not included. Cached-input pricing is applied only where the record contains a cached price. Answer quality, latency, throughput, rate limits, region and retention are not measured, so a cheaper total is not automatically a better product decision.

- Batch pricing is transcribed for some vendors but not applied to the totals; the batch guide shows how to reason about it.
- Missing fields read Not collected; they are never filled with a guess.
- Re-check the linked vendor page before signing a contract or promising a budget.

## Takeaways

- Fix tokens, volume and retries before comparing model prices.
- A per-1M price is a unit; the bill is calls × tokens × price.
- Filter on context, output ceiling and modalities before ranking by price.
- Show a ±30% range and name the assumption that moves the bill most.

## FAQ

### How accurate is a workload estimate?

It is exact arithmetic on estimated inputs. The token counts and retry rate are assumptions, so the total is only as good as those four numbers. The page shows a ±30% volume range and a sensitivity table instead of a false precision.

### Should I use the cheapest model per token?

Only after the hard constraints pass and the token mix is known. A model with cheap input but expensive output can lose on an output-heavy workload, and the cheapest per-token record may not hold your context. Compare the monthly total for your workload, not the unit price.

### Can I compare a cached model with one that has no cache price?

Only after applying the same measured hit rate to both. A model without a published cache price keeps its standard input price, so the comparison mixes a discount with no discount. State that difference in the note.

### Should I budget on the average or the peak token count?

Use the average for the monthly budget and the upper end of your sample for capacity planning. A workload can have a modest average and still hit context or output ceilings on a small share of requests. This catalog records the ceilings, not your traffic distribution.

### Do these totals include batch or cached pricing?

Cached pricing is applied only when the model record has a published cached-input price and the workload assumes a hit rate. Batch discounts are not applied. Both are explained on the workload page and in the dedicated guides.
