Practical developer guides
LLM cost estimates: input, output and excluded charges
Compute costs from explicit per-million prices and keep caching, retries and provider usage separate.
State both prices and units
Input and output can have different prices. Convert per-million rates using 1,000,000 rather than 1,000.
The site uses the rates you enter; it does not fetch a live provider price list. The values below are fictional arithmetic fixtures.
{"inputTokens":100000,"outputTokens":20000,
"inputPricePerMillion":2,"outputPricePerMillion":8}
Input $0.20 + output $0.16 = $0.36Do not equate text count with billed usage
A tokenizer estimates supplied text under one encoding. Full requests can include wrappers, tools, multimodal content and provider-defined billable usage.
Use final usage fields from the actual service for invoice reconciliation. A local count is useful for budgeting and comparison.
Model cached input as its own line
Cached input may have another rate and eligibility rule. The site's simple estimator does not automatically apply cache discounts.
Split ordinary and cached input into separate manual calculations when the provider contract requires it; avoid counting cached tokens twice.
General model:
uncachedInput × rateA / 1e6
+ cachedInput × rateB / 1e6
+ output × rateC / 1e6Include operational multiplication
Retries, agent loops and multiple candidate outputs can multiply requests beyond one visible user interaction. Taxes or service fees are additional assumptions.
Record the chosen rates and expected run count in a budget. Validate arithmetic with the calculator, then reconcile against observed usage rather than treating an estimate as a bill.