AI / LLM API Token & Inference Cost Estimator
Compare monthly token bills for frontier APIs, mini models and self-hosted GPUs, including prompt caching savings.
A shared link includes your input values and any cost line names you added. Check the names before you post.
Lowest-cost option
Mini / Fast API
$190 per month
Monthly prompts
450,000
Daily users × prompts × 30
Token volume
743M
540M input, 203M output
Annual cost gap
$35,786
Yearly difference, highest vs. lowest option
Monthly Inference Spend by Architecture
Accounts for prompt caching savings on input tokens
Monthly Inference Spend by Architecture
Illustrative benchmark rates. Check current provider price pages before budgeting.
| Option | Monthly | Annual | Best fit for |
|---|---|---|---|
| Mini / Fast APIBest | $190 | $2,284 | High-volume chat, classification and extraction |
| Self-hosted GPU | $580 | $6,960 | Strict data privacy and predictable high volume |
| Frontier API | $3,173 | $38,070 | Complex coding, legal review and multi-step agents |
Formula & Methodology
LLM costs scale with tokens, not requests. This estimator converts your traffic into monthly prompts, then into millions of input and output tokens. It prices those tokens on a frontier API, a mini model and a self-hosted GPU node, with a discount for cached input.
monthly prompts = daily users x prompts per user x 30 input millions = monthly prompts x input tokens / 1,000,000 output millions = monthly prompts x output tokens / 1,000,000 cache factor = 1 - (cache hit rate x 0.5) frontier API = input M x $2.50 x cache factor + output M x $10.00 mini API = input M x $0.15 x cache factor + output M x $0.60 GPU nodes = max(1, ceil((input M + output M) / 1,200)) self-hosted cost = GPU nodes x $580
The mini-model rate ($0.15 input and $0.60 output per 1M tokens, with a 50% cached-input discount) matches the published gpt-4o-mini list price as reported by third-party summaries. The frontier rate ($2.50 input and $10 output) is the 2024 gpt-4o list price and is out of date for current flagship models, so replace it with the current price before deciding. The GPU node price and capacity are assumptions. Self-hosting excludes staff time, redundancy and idle capacity. Use the comparison to understand the shape of cost: which lever moves the total the most, and at what volume the architecture changes.
Worked Example
A product has 2,500 daily users, each sending 6 prompts, with 1,200 input tokens and 450 output tokens per prompt. The cache hit rate is 30%.
- Monthly prompts: 2,500 × 6 × 30 = 450,000
- Input tokens: 450,000 × 1,200 = 540 million
- Output tokens: 450,000 × 450 = 202.5 million
- Cache factor: 1 − 0.30 × 0.5 = 0.85
- Frontier API: 540 × $2.50 × 0.85 + 202.5 × $10 = $3,172.50
- Mini API: 540 × $0.15 × 0.85 + 202.5 × $0.60 = $190.35
- Self-hosted: 1 GPU node × $580 = $580
The mini model is cheapest here at about $190 per month. The self-hosted node is more than the mini API at this volume but far below the frontier model. If the product grows to several times this traffic, the GPU line would step up only once the token volume passes the 1,200 million per node threshold.
Frequently Asked Questions
How many tokens is a typical prompt?
A token is roughly three quarters of an English word. A chat turn with a system prompt, conversation history and retrieved context can easily send more than 1,000 input tokens. Responses vary widely. Measure real averages from your provider usage logs, because they are the best input for this estimate.
What does prompt caching change in this model?
Providers can bill cached input tokens at a discount when the same prefix is reused. The calculator applies a 50% discount to the cached share of input tokens. Set the hit rate to the share of input tokens that really repeat, such as a long system prompt or document, and treat the result as an estimate of the saving.
When does self-hosting a GPU beat an API?
Self-hosting usually wins at high, steady volume where you can keep GPUs busy, or when data must stay inside your own infrastructure. Below that volume, idle hardware and engineering time often cost more than the API. The self-hosted line here steps up one node at a time, so the crossover depends heavily on your token volume.
Are the prices in this calculator current?
Not entirely. The mini-model rate matches a published list price, but the frontier rate is an out-of-date 2024 figure and the GPU node cost is an assumption. Provider prices change often and differ by model. Check the current price pages before budgeting, then update the rates in your own model or use the inputs as a shape-of-cost guide.
Why are output tokens priced higher than input tokens?
Output tokens are generated one at a time and need more compute than reading input in parallel, so providers charge more for them. Long answers therefore drive cost more than long prompts. If your product returns verbose responses, lowering the output length is often the fastest way to cut spend.