How to Estimate LLM Costs Before You Build: A Worked Example
A step-by-step method for turning expected traffic into a monthly LLM bill, with a full worked example at current prices and the mistakes that most often make estimates wrong.
Most LLM budgets come out too low, and the usual cause is a missing input: the size of the system prompt, the retries, or the reasoning tokens nobody counted. This guide gives a method you can finish in under an hour, then runs it on a real example with current prices.
All prices are per 1 million tokens, as of November 2026, from the data on this site. They change, so rerun the numbers in the calculator before you commit to a budget.
The formula
monthly cost = requests per month × (input tokens × input price + output tokens × output price) ÷ 1,000,000
Two refinements make it realistic:
- Part of the input may be billed at a cached rate, which is far lower.
- A multiplier covers retries and extra calls.
Everything below is about getting honest values for each term.
Step 1: Count requests, not users
Monthly active users is a poor unit. Use this chain instead:
- Daily active users (not monthly).
- Requests per active user per day.
- Model calls per request. A plain chat reply is one call. An agent that plans, calls a tool and checks its work might be four.
- Multiply by 30.
If you have no data, write down a low, expected and high value for each and carry all three through. A range is more useful than a false single number.
Step 2: Measure input tokens by part
Do not guess one number for "input". List the parts and count each with the token counter:
- System prompt
- Tool or function definitions (these are sent on every call)
- Retrieved documents or knowledge-base snippets
- Conversation history
- The user's message
History grows every turn, so use the average across a session rather than the first turn. In the worked example below, the system prompt and tool definitions alone are 1,300 of 3,000 input tokens, and a guess based on the user's message would miss all of them.
Step 3: Measure output tokens
Run 20 to 50 realistic prompts through a candidate model and record the output length. Use the average, then check the 90th percentile, because long answers cost the most. Short chat replies are often 100 to 400 tokens. Reports, code and summaries of long text can be 1,000 to 4,000.
Step 4: Decide the cache share
Find the part of every request that is identical from call to call and sits at the start of the prompt. That is cacheable. Divide it by total input to get a cache share. Be conservative: caches expire and the first request after expiry pays full price. Prompt Caching Explained covers the mechanics.
Step 5: Add overhead
Add 10% for retries and validation failures as a starting point, and more for agent loops. If any part of the work can wait hours, price it separately at batch rates. The batch listings in our data run at half the standard price, but only some providers offer them.
A fully worked example
A support copilot inside a SaaS product.
- 4,000 daily active users, 5 requests each: 20,000 requests a day, 600,000 a month.
- One model call per request.
- Input: 3,000 tokens. That is a 900-token system prompt, 400 tokens of tool definitions, 1,200 tokens of knowledge-base snippets, and 500 tokens of history plus the user message.
- Output: 400 tokens.
- Cache share: the system prompt and tools are 1,300 of 3,000 tokens, about 43%. We assume 40% to stay cautious.
- Overhead: +10% for retries.
Monthly bill by model:
| Model | Input / Output price | No caching | 40% cached | Plus 10% retries |
|---|---|---|---|---|
| DeepSeek V4 Flash 0731 | $0.07 / $0.14 | $159.60 | $119.28 | $131.21 |
| Claude Haiku 5.5 | $0.10 / $0.50 | $300.00 | $235.20 | $258.72 |
| GPT-6.1 Terra | $1 / $5 | $3,000.00 | $2,316.00 | $2,547.60 |
| Claude Sonnet 5.5 | $2 / $10 | $6,000.00 | $4,632.00 | $5,095.20 |
| Claude Opus 5.5 | $4 / $20 | $12,000.00 | $9,264.00 | $10,190.40 |
Check one row by hand. For Sonnet 5.5, the uncached input is 1,800 tokens at $2 plus 1,200 cached tokens at $0.10, which is $0.00372. Output is 400 tokens at $10, which is $0.004. Together that is $0.00772 per request, or $4,632 over 600,000 requests.
Caching saved about 23% here, because only 40% of input is cached and output is billed in full. Opus 5.5 costs over 75× as much as the cheapest row, so model choice moves the bill far more than caching or retries. A single-turn support answer may not need the top model at all, so test quality on two or three cheaper models before you price.
The DeepSeek row uses the cheapest host's price on OpenRouter, since DeepSeek does not sell that snapshot itself. Host prices move often; the Anthropic and OpenAI rows are the labs' own list prices.
Mistakes that break estimates
Ignoring output-heavy work. The example above is input-heavy. A report generator with 500 tokens in and 4,000 out on Sonnet 5.5 costs $0.041 per request, and 98% of that is output. See Input vs Output Token Pricing.
Forgetting reasoning tokens. Reasoning models produce hidden thinking tokens that bill as output. Suppose the example model spends 1,500 reasoning tokens per request on top of the 400 visible ones. Output cost per request rises from $0.004 to $0.019, and the monthly bill on Sonnet 5.5 goes from $4,632 to $13,632, nearly 3×. The 1,500 figure is an assumption for illustration. Measure it on your own prompts, since it varies a lot by task and by effort setting.
Underestimating the system prompt. A 4,000-token prompt of rules and examples feels free until you multiply it by 600,000 requests.
Forgetting that history grows. A 20-turn conversation resends every earlier turn each time.
Pricing only the happy path. Retries, tool-call loops and fallback calls to a bigger model all add tokens.
Using list prices for a different tier. Batch, cached and standard rates differ. Check which one your design will actually hit.
Stress-test the result
Run three checks before you present the number:
- Multiply traffic by 10. Does the product still make sense if it succeeds?
- Set the cache share to zero. Can you afford the bill if caching underperforms?
- Swap in a model one tier cheaper and one tier dearer using the compare page.
If the bill is too high, Cut LLM API Costs lists the levers in order of effect. To find a cheaper model that still fits your quality needs, read Which Model Is Cheapest for Your Workload. The calculator builds the same table as above for any model we track.
Frequently asked questions
How accurate can a pre-launch estimate be?
Treat it as a range. Prices are known to the cent; requests per user and output length are guesses until real users arrive. Replace the guesses with logged token counts after the first week of traffic.
Should I estimate with the average request or the worst case?
Use the average for the budget and the 90th percentile to size rate limits and alerts. Costs are skewed: a minority of long requests often account for a large share of the bill.
Do I need to count tokens exactly?
No. Providers use different tokenizers, so counts differ by model. A count within 10% is fine for planning. Use the token counter for a close approximation, then read real usage numbers from API responses once you are live.
Are free tiers and credits worth including?
Leave them out of the steady-state estimate. They are one-off and they hide the real unit cost. Note them separately as launch runway.
Try it with your workload
Set your tokens per request and requests per day once, and see what every model would cost you per month.