Token Cost Calculator
Inputs
| Input Tokens | 1,500 |
|---|---|
| Output Tokens | 500 |
| Input Price (per 1M tokens) | 3 $ |
| Output Price (per 1M tokens) | 15 $ |
Token Cost Calculator
Calculate the cost of a single LLM API call from input and output token counts and the model’s per-million-token prices, with input and output billed separately.
Inputs
Tokens
Pricing
Results
Enter a value to see results.
Details
Token cost explained
The token cost of a large language model API call is the price charged for a single request, computed from the number of tokens sent to and received from the model and the model's published per-token rates. Providers meter usage in tokens — short fragments of text, roughly four characters of English each — and bill the prompt (input) and the completion (output) separately, because the two are charged at different rates.
How pricing is quoted
A single token costs a minuscule fraction of a currency unit, so providers publish rates per one million tokens to keep the headline number readable. A rate of $3 per million input tokens means each input token costs three millionths of a dollar; an output rate of $15 per million is five times as much. Output is the more expensive side because generation produces one token at a time, each requiring a full pass over the model, whereas the input is processed in a single parallel pass.
The formula
With input tokens at price per million and output tokens at price per million, the two billed components are
Cin=106ninpin,Cout=106noutpoutand the call cost is their sum:
C=Cin+CoutThe division by converts the per-million quote into a per-token rate before multiplying by the token counts.
Worked example
Consider a request with input tokens and output tokens against a mid-tier frontier model priced at $3 per million input and $15 per million output. The input portion is
Cin=1061500×3=$0.0045and the output portion is
Cout=106500×15=$0.0075giving a total of C = 0.0045 + 0.0075 = \0.012$ for the call. Although the prompt is three times longer than the completion, the two halves contribute roughly equally to the bill, because the output rate is five times the input rate. This is the defining feature of token pricing: a short completion at a high rate can cost as much as a long prompt at a low rate.
Notes and variations
The model assumes a flat per-token rate. In practice the effective rate can fall below the headline figure: prompt caching reuses repeated context at a discount, and asynchronous batch processing trades latency for a lower rate. Token counts also depend on the tokenizer and the content — code and non-English scripts tokenize less efficiently than plain English, producing more tokens per character.
Application
Per-call cost is the atomic unit from which larger estimates are built. Multiplying it by request volume gives recurring spend, the subject of the LLM Monthly Cost Calculator, while an agentic workflow that issues many calls per task is handled by the Agent Cost Calculator. To work in the opposite direction — how many tokens a fixed budget buys — see Tokens per Dollar Calculator.
Frequently Asked Questions (FAQ)
Why are input and output tokens priced differently?
Reading the prompt and generating the reply are different workloads. Input tokens are processed in a single parallel forward pass, while output tokens are produced one at a time, each requiring a full pass over the model. Generation is therefore more compute-intensive, and providers price output tokens higher to reflect that — commonly three to five times the input rate.
How many tokens is my text?
A token is a chunk of text — often a word fragment of three to four characters in English. As a rough guide, one token is about 0.75 English words, so 1,000 tokens is roughly 750 words. Code, punctuation, and non-English scripts tokenize less efficiently, producing more tokens per character. Use a provider tokenizer for an exact count.
Why is pricing quoted per million tokens?
A single token costs a tiny fraction of a cent, so a per-token price would be an unreadable string of zeros. Quoting per million tokens keeps the headline number legible — a rate of three per million means each token costs three millionths of the currency unit.
Disclaimer
Token counts depend on the model’s tokenizer and vary with language and content. Published prices change over time and may exclude discounts for caching or batch processing. Verify current rates and exact token counts with your provider before relying on a figure for billing.