LLM Cost Calculator
All calculations run locally in your browser — no token counts or model choices are sent anywhere.
Input Cost
$0.00
Output Cost
$0.00
Total Cost
$0.00
How to use this LLM cost calculator
- Pick the model you plan to use.
- Enter your expected input and output token counts.
- The estimated cost in USD updates instantly.
How is API cost calculated?
Most LLM providers charge separately for input tokens (the prompt you send) and output tokens (the response generated), usually priced per million tokens. Output tokens are almost always more expensive than input tokens, so a long generated response costs more than a long prompt with a short answer.
Are these prices exact?
They're the standard public list prices at the date shown above, but providers change pricing periodically and may offer batch, cached, or volume discounts — check your provider's official pricing page for exact billing.
How do I get my token counts?
Use OmniDeck's Token Counter to get exact input token counts for your prompt, then estimate expected output length separately.
Why output tokens cost more than input tokens
This price asymmetry comes directly from how these models actually generate text. Processing input tokens is comparatively cheap because the model can analyze the entire prompt in a single parallel pass, computing everything at once. Generating output tokens works completely differently: each new token depends on every token that came before it, including ones the model itself just generated, which forces a sequential, one-token-at-a-time process that can't be parallelized the same way. That sequential dependency makes generating each output token meaningfully more computationally expensive than analyzing each input token, which is the direct technical reason providers price the two differently rather than an arbitrary business decision.
Why prompt caching can change the real cost dramatically
Several providers now offer a caching discount for repeated portions of a prompt — a long system prompt, a big block of reference documents, or instructions that stay identical across many calls — charging significantly less for cached input tokens than fresh ones on repeat requests within a short time window. For an application making frequent calls with a large, mostly-unchanged prompt prefix (a chatbot with an extensive system prompt, a tool processing many documents against the same instructions), this can reduce real input costs substantially compared to what a naive per-token calculation like this one would suggest. This calculator doesn't model caching discounts, so its input cost estimate is a ceiling for that kind of repeated-prompt use case, not necessarily what you'll actually be billed.
Context window size and price are two separate things
It's easy to assume a model with a larger maximum context window is somehow a "bigger" or more expensive tier across the board, but context window (how much text the model can consider at once) and per-token price (what each token actually costs) are independent properties that don't move together in any consistent way. A model can support a very large context window while charging a modest per-token rate, or a smaller context window while charging more — the two numbers answer different questions (how much can I send at once, versus how much does each token cost) and need to be checked separately rather than assumed to correlate.
Why estimating output length in advance is inherently imprecise
Input token count is exact and knowable before you send a request — this site's Token Counter can calculate it precisely. Output token count is fundamentally different: it depends on how long a response the model actually generates, which you can't know with certainty until the response finishes streaming back. Most APIs let you set a maximum output token limit as a safety cap against runaway generation, but the actual cost is based on tokens genuinely produced, which is usually less than that cap. The practical approach is estimating based on typical response length for similar past prompts, or checking actual usage after a handful of test calls, rather than expecting to predict output length exactly in advance.
Limitations of this tool
This calculator uses standard public list pricing as of the date shown above — it doesn't account for prompt caching discounts, batch processing discounts, or volume-tier pricing that many providers offer for high-usage accounts, all of which can make your actual bill meaningfully lower than this straightforward per-token calculation suggests. It also doesn't include charges for anything beyond basic input/output tokens, like fine-tuning, embeddings, or tool-use surcharges some providers bill separately. Treat this as a quick, standard-rate estimate for planning purposes, and check your provider's official pricing page and your account's actual billing dashboard for the real, final number.