Large Language Model (LLM) Usage Cost Calculator
Estimate monthly LLM API cost from token use, caching and retries with budget checks plus same-workload model price comparisons.| Cost item | Monthly amount | Basis | Copy |
|---|---|---|---|
| {{ row.label }} | {{ formatCurrency(row.amount) }} | {{ row.basis }} |
| Scenario | Change | Monthly cost | Vs current | Copy |
|---|---|---|---|---|
| {{ row.label }} | {{ row.change }} | {{ formatCurrency(row.cost) }} | {{ formatSignedCurrency(row.difference) }} |
LLM bills can change sharply even when request counts barely move. A longer prompt is charged at an input rate, generated text is charged at a separate output rate, and retries create extra billed attempts. For many workloads, output tokens cost more than input tokens, so a small increase in response length can outweigh a much larger prompt reduction.
Useful cost planning starts with a representative request rather than a provider headline price. Measure the billed token counts from production logs, separate successful requests from retry overhead, and use the number of days the workload actually runs. A weekday batch job and a continuously available service should not share the same monthly-volume assumption.
- Uncached input
- Prompt tokens billed at the normal input rate.
- Cached input
- The share of prompt tokens that qualifies for the provider's cached-read rate. This is a token share, not merely the share of requests that report any cache hit.
- Output
- Generated tokens billed at the output rate, including any billable reasoning tokens reported by the provider.
- Retry multiplier
- Billed attempts divided by successful requests. A value of 1.10 adds ten percent attempt overhead.
Price is only one model-selection factor. Two models can produce different token counts, latency, success rates, and answer quality for the same task. A price comparison therefore answers what the entered workload would cost under each rate card; it does not predict which model will complete the workload with the same quality or number of retries.
Published rate cards also change. Contract discounts, batch tiers, long-context surcharges, cache writes, cache storage, grounding, tools, taxes, and regional terms may sit outside a simple token estimate. Treat the result as a planning baseline and reconcile it with a recent invoice before committing a budget.
How to Use This Tool:
Start with a measured workload and the rate card that will actually bill it.
- Choose a Pricing profile or select Custom rate card and enter the normal input, cached-input, and output prices in USD per 1,000 tokens.
- Enter average Input tokens per request, Output tokens per request, successful requests per day, and active days per month. Use billed token counts rather than character estimates when logs are available.
- Set Cached input share. Open Advanced only when retries, a planning buffer, fixed monthly fees, growth, or a budget cap belong in the estimate.
- Read Monthly cost first, then compare the token-cost breakdown and scenarios. Check the model price ladder only after confirming that every row is being tested against the same workload.
Interpreting Results:
- Monthly cost includes variable token charges, the planning buffer, and fixed monthly fees. Daily and annual figures are direct planning extensions of that monthly estimate.
- Budget variance is the entered budget cap minus monthly cost. A positive value is remaining room; a negative value is an overrun.
- Cache savings compares the entered cache share with a zero-cache version of the same workload. It excludes cache-write and storage charges.
- Scenario differences change one stated assumption at a time. They are sensitivity checks, not forecasts.
Technical Details:
Monthly token spend is the sum of uncached input, cached input, and output charges across all billed attempts. The retry multiplier increases attempts but does not increase the successful-request count. The planning buffer applies only to variable token charges, while fixed fees are added afterward.
Formula Core:
The calculation first blends the two input rates by cached-token share, then prices one request and scales it to the month.
| Symbol | Meaning | Unit |
|---|---|---|
| A | Monthly billed attempts | attempts |
| q, d, r | Successful requests per day, active days, and retry multiplier | requests/day, days, ratio |
| h | Cached input share divided by 100 | ratio |
| Tin, Tout | Input and output tokens per request | tokens |
| Rin, Rcache, Rout | Normal input, cached-input, and output rates | USD per 1,000 tokens |
| V, m, F, M | Variable token cost, buffer ratio, fixed fees, and final monthly cost | USD, ratio, USD, USD |
For the built-in Terra example of 1,400 input tokens, 600 output tokens, 240 requests per day, 30 days, no caching, and no retries, the saved rate profile produces 7,200 attempts. It prices 10.08 million input tokens at $25.20 and 4.32 million output tokens at $64.80, for a $90.00 monthly estimate before fixed fees or buffer.
Price-profile rules:
- Built-in prices are converted from USD per million tokens to USD per 1,000 tokens before calculation.
- The growth scenario raises successful requests only; it does not change the current monthly estimate.
- The output-trimming scenario uses 75% of the entered output tokens, while the cache scenario adds 25 percentage points to cached input up to a 100% ceiling.
- Currency results retain full calculation precision and are formatted to cents for display.
Pricing Accuracy:
The built-in profiles are a dated planning snapshot from 12 August 2026. Provider pricing can change, and the saved OpenAI profiles do not include price changes published after that date. Use Custom rate card for the current contract price, and check context-length tiers, cache-write charges, storage, batch processing, regional routing, tools, credits, and taxes separately.
References:
- Compare OpenAI API models, OpenAI.
- Claude Platform pricing, Anthropic.
- Gemini Developer API pricing, Google.