Free tool

LLM API Cost Calculator

Estimate OpenAI, Claude and Gemini API costs from your token usage and request volume.

Uses current published model pricing. No signup.

Model & workload

View model details

Don’t know your token count? Use the AI Token Counter

The part of the input above that is read from the prompt cache. It is not added on top.

Include reasoning or thinking tokens if your model generates them.

Request volume period
Quick set
Pricing mode

Calculations run entirely in your browser. No API requests are sent to model providers.

Estimated cost

Estimated monthly cost

$40.00

$0.04 / request

Claude Sonnet 5.5 · Standard

Per request

Cost per request, by token type
Input10,000 × $2.00 / 1M$0.02
Output2,000 × $10.00 / 1M$0.02
Total$0.04
Requests / month
1,000
Input tokens / month
10M
Output tokens / month
2M

Pricing last verified: · View model details

Estimates use published API rates and exclude taxes, negotiated enterprise pricing, credits and provider-specific account discounts. Provider billing may round or meter requests differently.

Provider pricing notes for Claude Sonnet 5.5
  • Cache write prices are shown for 5-minute and 1-hour retention.
  • Setting inference_geo to "us" applies a 1.1x multiplier on Claude 4.6 and later models.
  • Anthropic includes the full 1M-token context window at standard pricing for this model.

Cache storage fees, search or tool charges, regional premiums and other add-ons listed above are not included in the estimate.

Compare model costs

The same workload and pricing mode (Standard) on up to 5 models. The lowest cost is a number for this workload, not a verdict on which model is better.

Choose models (3 of 5 selected)
OpenAI
Anthropic
Google
  • Claude Sonnet 5.5

    Anthropic

    Selected
    Input
    $0.02
    Output
    $0.02
    Per request
    $0.04
    Monthly
    $40.00
  • GPT-6.1 Sol

    OpenAI

    Input
    $0.02
    Output
    $0.02
    Per request
    $0.04
    Monthly
    $40.00
  • Gemini 4 Argon

    Google

    Price changes Dec 1, 2026
    Input
    $0.02
    Output
    $0.02
    Per request
    $0.04
    Monthly
    $40.00

These models cost the same for this workload.

“Lowest estimated cost” compares models whose documented limits fit this workload. A model that exceeds a documented limit stays in the table with its hypothetical cost.

Browse AI model pricing and specs

This calculator estimates developer API usage, not ChatGPT Plus, Claude Pro, Gemini subscription, or other consumer plan costs. All free tools.

Guide

How to calculate LLM API cost

LLM APIs bill by the token, with separate prices for what you send and what the model writes back. For one request the cost is:

cost per request =
  (uncached input tokens  x input price
 + cached input tokens    x cached-input price
 + cache-write tokens     x cache-write price
 + output tokens          x output price) / 1,000,000

monthly cost = cost per request x requests per month

Prices are quoted per 1 million tokens. Cached input and cache writes are parts of your input, so the calculator never charges a token twice: with 100,000 input tokens of which 20,000 are cached, it bills 80,000 at the input price and 20,000 at the cached-input price.

Worked example with Claude Sonnet 5.5: 100,000 input tokens (20,000 of them cached) and 10,000 output tokens cost $0.16 for the 80,000 uncached input tokens at $2.00 per 1M, $0.002 for the cached tokens at $0.10 per 1M and $0.10 for the output at $10.00 per 1M: $0.26 per request, or $13,100.00 for 50,000 requests a month at today's rates.

OpenAI API cost calculator

Choose a GPT model above to price input, cached input and output tokens at OpenAI's published rates. These are the standard, short-prompt rates in the calculator today, per 1M tokens:

OpenAI model prices per 1 million tokens
ModelInputCached inputOutput
GPT-6 Astra$10.00$1.00$50.00
GPT-6.1 Sol$2.00$0.10$10.00
GPT-6.1 Terra$1.00$0.05$5.00
GPT-6 Luna$0.10$0.01$0.50

GPT-6 Astra, GPT-6.1 Sol, GPT-6.1 Terra and GPT-6 Luna move to higher long-context rates above 272,000 prompt tokens. The calculator applies that tier on its own and says so when it does.

Models with other pricing modes, such as Batch, Fast mode or Ultrafast, add a Pricing mode control when you select them. Browse the full specs in the AI model directory.

Claude API cost calculator

Anthropic's Claude models are priced per token in the same way. Standard, short-prompt rates per 1M tokens:

Anthropic model prices per 1 million tokens
ModelInputCached inputOutput
Claude Fable 5.1$10.00$0.25$50.00
Claude Opus 5.5$4.00$0.20$20.00
Claude Sonnet 5.5$2.00$0.10$10.00
Claude Haiku 5.5$0.10$0.01$0.50

Claude Haiku 5.5 moves to higher long-context rates above 100,000 prompt tokens. Claude Fable 5.1, Claude Opus 5.5 and Claude Sonnet 5.5 have no long-context tier in HistChat’s pricing data.

Prompt caching has its own prices. Cache reads are priced well below normal input (for Claude Fable 5.1, $0.25 versus $10.00 per 1M), and writing to the cache costs more than normal input ($12.50 versus $10.00 per 1M for Claude Fable 5.1 with 5 minutes retention). Open Cache writes (advanced) in the calculator to include them.

Gemini API cost calculator

Google's Gemini API prices input, cached input and output tokens per 1M. Standard, short-prompt rates in force today:

Google model prices per 1 million tokens
ModelInputCached inputOutput
Gemini 4 Argon$2.00$0.10$10.00
Gemini 3.1 Pro (Preview)$2.00$0.20$12.00
Gemini 3.8 Flash$0.75$0.075$3.75
Gemini 3.6 Flash$0.75$0.075$3.75
Gemini 3.5 Flash-Lite$0.30$0.03$2.50

Some prices are scheduled to change, and the calculator uses the rates in force on the current UTC date: Gemini 4 Argon changes on Dec 1, 2026, Gemini 3.8 Flash changes on Jan 1, 2027 and Gemini 3.6 Flash changes on Jan 1, 2027. When a change affects your pricing mode, the result shows a Price changes notice and, where every needed price is published, what the same workload would cost from that date.

Gemini 3.1 Pro (Preview) moves to higher long-context rates above 200,000 prompt tokens.

How prompt caching changes cost

Prompt caching lets a provider reuse a repeated prefix, such as a system prompt, tool definitions or a long document, instead of processing it as new input each time. The reused part is billed at the cached-input price, which is lower than the normal input price where a provider publishes one. With Claude Sonnet 5.5, the example above costs $0.26 per request with 20,000 tokens cached, against $0.30 with none cached.

Caching does not make every request cheaper: some providers charge extra to write to the cache, and cache storage can be billed separately. The calculator includes cache reads and, for models that publish them, cache writes. It does not include cache storage fees.

Why long prompts can cost more

Some models charge a higher rate for the whole request once the prompt crosses a length threshold, not just for the tokens past it. A request just under the threshold and one just over it can therefore differ in price by far more than their token difference. Where a model has such a tier, the calculator checks your prompt length (uncached input, cached input and cache writes together) against the threshold and shows a Long-context rate applied notice with the threshold it used.

API cost vs ChatGPT and Claude subscription pricing

This calculator estimates developer API usage, not ChatGPT Plus, Claude Pro, Gemini subscription, or other consumer plan costs. Subscriptions are flat monthly plans for using a provider's apps and have their own limits. API usage is metered by the token and billed to a developer account. The two are separate products with separate pricing, so one cannot be used to predict the other.

How to estimate monthly AI costs

  1. Pick the model and, if it offers one, the pricing mode.
  2. Enter the input tokens per request, including system prompts and context. If you do not know them, count a typical prompt with the AI Token Counter.
  3. Enter the cached portion of that input and the output tokens you expect, including any reasoning tokens.
  4. Enter your requests per month, or per day if that is easier. Per-day volume is multiplied by 30 for the monthly estimate.
  5. Compare the result with other models under Compare model costs, and treat it as a planning estimate rather than a bill.

Frequently asked questions

How is LLM API cost calculated?
Each request is billed per token: uncached input tokens at the input price, cached input tokens at the cached-input price, any cache-write tokens at the cache-write price, and output tokens at the output price, all quoted per 1 million tokens. This calculator adds those up for one request, then multiplies by your request volume.
How much does 1 million tokens cost?
It depends on the model and on whether the tokens are input or output. For example, Claude Sonnet 5.5 lists $2.00 per 1M input tokens and $10.00 per 1M output tokens. Pick a model above to see the rates it uses.
Does cached input cost less?
Where a provider publishes a cached-input price for the model and pricing mode, yes, and the calculator uses it for the tokens you mark as cached. If a mode has no published cached-input price, the calculator says so instead of guessing one.
Why can long-context requests cost more?
Some models are priced in tiers by prompt length. When a request’s prompt goes over the model’s threshold, the provider bills the whole request at a higher rate. The calculator applies the tier automatically from the model’s published rules and tells you when it has.
Does this calculate ChatGPT Plus cost?
No. It estimates developer API usage billed per token. It does not estimate ChatGPT Plus, Claude Pro, Gemini subscription or other consumer plan costs.
Can I compare Claude and GPT API costs?
Yes. Use Compare model costs under the calculator to price the same workload on up to five OpenAI, Anthropic and Google models. The lowest estimated cost is only a number for that workload; it says nothing about which model is better.
Are prices updated automatically?
No. Prices come from HistChat’s AI model directory, which is checked against each provider’s documentation by hand (most recently Oct 31, 2026). The calculator does not fetch live prices. It uses the rates in force on today’s date, including announced price changes.
Are taxes or enterprise discounts included?
No. Estimates use published API rates and exclude taxes, negotiated enterprise pricing, credits and provider-specific account discounts. Provider billing may also round or meter requests differently.

Pricing last verified Oct 31, 2026. Default model: Claude Sonnet 5.5. Compare models side by side or browse AI model pricing and specs.

Working with MCP servers? Try the MCP Config Generator.