← Blog

LLM Cost Estimation: A Practical Method for Budgeting Spend

2026-09-18 · 5 min read · SubToAPI Team

LLM cost estimation is the process of predicting how much you'll spend on a language model before or while building a feature, so you can budget correctly and avoid surprises on your invoice. The core method is simple: estimate token volume, multiply by per-token pricing, then adjust for real-world factors like retries, system prompts, and usage growth. The hard part isn't the math — it's getting the inputs right.

This article walks through a repeatable estimation process you can apply to any feature, with worked examples and the assumptions people most often get wrong.

The Basic Formula

Every LLM cost estimate starts from the same equation:

cost = (input_tokens × input_price) + (output_tokens × output_price)

Most providers price input and output tokens differently, and output tokens are usually 3–5x more expensive per token. That asymmetry matters more than people expect — a feature that generates long responses can cost far more than one with long prompts but short answers.

To estimate total cost for a feature, you need:

  1. Tokens per request (input and output separately)
  2. Requests per day/month
  3. Price per token for input and output
  4. A growth or peak multiplier for realistic planning

Get any one of these wrong by 2x and your whole estimate is off by 2x — so it's worth spending real time on each.

Step 1: Estimate Tokens Per Request

Don't guess. Take 10–20 real or realistic prompts for your feature and count tokens using the model's tokenizer (or a rough rule: 1 token ≈ 4 characters of English text). Include everything that actually gets sent:

System prompts and RAG context are the most commonly forgotten costs. A 50-token user question sitting behind a 600-token system prompt and 800 tokens of retrieved context is really a ~1,450-token input, not a 50-token one.

For output, look at actual response lengths from testing, not the theoretical maximum. If you cap max_tokens at 1000 but responses average 250, estimate on the average — but keep the cap in mind as your worst case for cost ceilings.

Step 2: Estimate Request Volume

This is usually the biggest source of error in cost estimates, because it depends on adoption, not engineering. A few ways to ground it:

Always produce a range, not a single number — a low, expected, and high case. Volume estimates for new features are frequently wrong by 3–10x in the first few months, so build your plan around the range, not the midpoint.

Step 3: Apply Real-World Multipliers

Raw token math underestimates actual spend. Account for:

A reasonable rule of thumb: take your raw token-math estimate and multiply by 1.3–1.6 to get a realistic production number, depending on how conversational and tool-heavy the feature is.

Worked Example

Say you're estimating a support-chat feature:

Input tokens per conversation ≈ 900 + 500 + (60×3) + (300×2, prior outputs resent) = 3,080 Output tokens per conversation ≈ 300 × 3 = 900

At a blended rate (adjust to your provider's actual pricing) of $3/million input tokens and $15/million output tokens:

input cost  = 3,080 / 1,000,000 × $3  = $0.00924
output cost = 900   / 1,000,000 × $15 = $0.0135
total per conversation ≈ $0.023

At 5,000 conversations/month: ~€110/month in raw model cost (currency-adjusted), before your ~1.4x real-world multiplier — so budget closer to €150.

Where Estimates Break Down

The most common estimation mistakes:

If you're building on top of an API layer like SubToAPI, usage metadata returned with each response (token counts, model used) makes it much easier to replace estimates with actual measured numbers within days of shipping — check /docs/messages for the response format. That's the fastest way to correct an estimate: ship to a small cohort, measure real token usage for a week, then re-run your volume math with real numbers instead of assumptions.

questions

What's the fastest way to estimate LLM costs for a new feature? Count tokens on 10–20 realistic prompts (including system prompt and context), multiply by expected monthly volume and per-token pricing, then apply a 1.3–1.6x multiplier for retries, multi-turn history, and tool calls.

Why do LLM cost estimates end up too low in production? The usual causes are ignoring system prompt/context overhead, using average instead of realistic peak output length, and not accounting for conversation history growing token counts on every turn.

Should I estimate cost per request or cost per user? Both. Cost per request tells you unit economics; cost per active user (requests/user × cost/request) tells you whether the feature is financially viable at your expected user base, which is usually the number that matters for budgeting.

Turn your Claude access into an HTTPS API

SubToAPI gives you application API keys, streaming, tool use and usage insights on top of your existing Claude access — set up in minutes.

Start free  Read the quickstart →