Formulas and sources
Each formula this calculator uses, where it comes from, and what it leaves out. "How it works" shows the same formula with your own numbers.
Cost of one request
In the one-model view
- Cost / request
- the cost of one API call
- Input Tokens
- the prompt, system instructions and context sent to the model
- Output Tokens
- the tokens the model writes back
- Input Rate
- the price per 1 million input tokens, after any option below
- Output Rate
- the price per 1 million output tokens, after any option below
Rates are in US dollars per 1 million tokens, as each provider’s own pricing page states them. For Llama 4, which Meta’s pricing page does not list, they are the median of its hosting providers’ prices. This panel carries no prices: the model details under the model picker show the rate in use, the date it was last checked and where it was read.
Source: Standard formula; no single publisher. Rates are each provider’s own per-1M-token prices, such as OpenAI’s [1], Anthropic’s [2] and Google’s [4].
Monthly cost
With Requests per month set
- Monthly
- the cost of a month of requests
- Cost / request
- from the formula above
- Requests / month
- how many requests you send in a month
A Google cache kept by the hour adds its storage charge once to the month, not to each request (see "Cache storage").
Source: Standard formula; no single publisher.
Comparing models
In the Compare view
- Monthly
- each model’s cost for the month
- Input Tokens
- the same for every model
- Output Tokens
- the same for every model
Each model is priced at its own rates, and its own long-context tier where one applies. The batch, cache, reasoning and custom-rate settings of the one-model view do not reach the columns; a column’s own Customize pricing applies to that column only. A Words setting does not reach the Compare view either: the numbers there are read as tokens. The lowest cost per request is marked Best.
Source: Standard formula; no single publisher.
Cached input and cache writes
With Cached input pricing on
- Input Tokens
- all the input tokens of the request
- Cached Tokens
- input tokens read back from the provider’s cache
- Written Tokens
- input tokens stored in a 5-minute cache on this request
- Input Rate
- the model’s input rate
- Cached Rate
- the model’s published cached price, a fraction of its input rate
- Write Rate
- the model’s published write price, a fraction of its input rate
A model with no published cached price bills cached tokens at the full input rate, and one with no published write price bills written tokens as plain input. A write only pays off once it is read back: the result says after how many reads. The written tokens count in the Input Cost card.
Source: Standard arithmetic on each provider’s published shares: OpenAI’s Cached input and Cache writes columns [1]; Anthropic’s prompt caching table and its break-even of one read for a 5-minute write [2].
Batch pricing
With Batch pricing on
- Batch Rate
- the rate for input, cached input, cache writes, reasoning and output tokens alike
- Standard Rate
- the rate without Batch pricing
- Batch Share
- the model’s published batch price over its standard price
Where a provider publishes a batch price, Batch Share is that price over the standard price. OpenAI, Anthropic and Google set it at half. A model with no published batch price, or no batch API, keeps its standard rates.
Source: Each provider’s own batch prices: OpenAI’s Batch table, which halves the cache-write price too [1], Anthropic’s, whose cache multipliers stack with the Batch discount [2][3], and Google’s [4].
Reasoning tokens
For OpenAI, Anthropic and Google models
- Billed Output Tokens
- the output tokens the provider charges for
- Output Tokens
- the visible answer
- Reasoning Tokens
- the private tokens a model spends thinking before it answers; the figure your API reports
They are not in the response, so the bill is larger than the visible answer.
Source: Billed as output tokens by OpenAI [5], Anthropic [6] and Google [4].
Long-context rates
When Input Tokens pass a model’s threshold
Above a model’s threshold, OpenAI, Google, xAI and MiniMax bill the whole request at their long-context rates, not only the tokens past it. A request just over the line can cost up to twice as much as one just under it. Claude 4.6 and later models cost the same at any length; the one exception Anthropic lists, Claude Haiku 5.5, is not in this calculator yet. The model details show each threshold.
Source: As each provider publishes it: OpenAI’s Long context prices [1], Google’s prompts over 200k tokens [4], and Anthropic’s standard pricing across the full context window [2].
Cache storage
For Google models with Cached input pricing on
- Monthly
- the cost of a month of requests
- Cost / request
- the cost of one request
- Requests / month
- requests in the month
- Cached Tokens
- the tokens kept in the cache
- Storage Rate
- Google’s storage price per 1 million tokens per hour, Standard tier
- Hours
- how long the cache is kept in the month
Google charges by the hour for keeping a cache, on top of the cheaper read. It is one charge for the period, not one per request.
Source: Google’s storage price, from its context caching rows [4].
Words to tokens
With a side switched to Words
- Tokens
- the estimated token count, rounded up
- Words
- the words you enter
- Tokens per Word
- an estimate per model family: about 1.33 for GPT and models without a ratio of their own, 1.52 for Claude 4.6 and earlier, 1.97 for Claude 4.7 and later, 1.67 for Gemini
These are estimates; real counts depend on the text and the provider’s tokenizer. "How it works" states the ratio it used for your model.
Source: Based on OpenAI’s rule of thumb of 0.75 words a token [7] and Anthropic’s 3.5 characters a token [8]. Claude 4.7 and later is scaled by the 30% more tokens Anthropic gives for its newer tokenizer [2]. Gemini’s is CalcTrail’s own estimate, at the high-token end of Google’s 60 to 80 words per 100 tokens [9].
Cost range
With Variability set above 0
- Cost / request
- the estimate
- Variability
- how far you expect the token counts to differ, as a percentage; 20 to start
The range is for one request; the monthly figure carries none.
Source: CalcTrail’s own range; no publisher.
Sources
- OpenAI. Pricing, the Standard and Batch tables (Cached input and Cache writes columns) and Long context. Undated page, read October 5, 2026.
- Anthropic. Pricing, sections "Prompt caching", "Batch processing" and "Additional notes". Undated page, read October 5, 2026.
- Anthropic. Prompt caching, its pricing section and FAQ. Undated page, read October 5, 2026.
- Google. Gemini Developer API pricing, the per-model Standard tables: Batch, context caching and its storage price, thinking tokens, prompts over 200k tokens. Undated page, read October 5, 2026.
- OpenAI. Reasoning models, section "How reasoning works". Undated page, read October 5, 2026.
- Anthropic. Adaptive thinking, section "Pricing". Undated page, read October 5, 2026.
- OpenAI. Key concepts, section "Tokens". Undated page, read October 5, 2026.
- Anthropic. Glossary, entry "Tokens". Undated page, read October 5, 2026.
- Google. Understand and count tokens, its opening section on tokens. Undated page, read October 5, 2026.
What this calculator does not cover
- Prices are standard-tier list prices in US dollars, before tax. Service tiers and surcharges are not applied: OpenAI’s Fast and Flex modes and its regional-processing uplift, Google’s Priority tier, and the US-only inference surcharges of Anthropic and xAI.
- Only the 5-minute cache write is priced (Anthropic’s 1-hour write costs twice the input rate). Inside a batch, Anthropic serves cache hits on a best-effort basis.
- Fees beyond tokens are left out: web search, code execution, the extra input tokens tool use adds, and earlier thinking blocks that Anthropic bills as input.
- Time-of-day prices, such as DeepSeek’s off-peak half price, and volume or negotiated discounts are not applied. Custom rates take a contract price.
- The Reasoning field is offered for OpenAI, Anthropic and Google models only, the three that say they bill reasoning as output. Other providers’ thinking tokens are not counted.
- A price change a provider has already announced takes effect on its date, by your device’s calendar. A model a provider has shut down is not offered for new estimates, and a saved tab keeps the model it used.
Sources checked on .