ToolsAnthropic, OpenAI, Google
AI API cost calculator
Pick a model, fill in token counts and the number of requests, and this tool works out standard and batch cost from the official per-million-token prices. Covers 52 models; price data fetched 2026-12-03.
Calculator
- Standard: per request
- —
- Standard: total
- —
- Batch: per request
- —
- Batch: total
- —
Amounts are in USD. This tool multiplies the official per-million-token prices by the token counts and covers input and output tokens only, not caching, tools or other surcharges. The result is an estimate, not a quote; your official invoice is authoritative.
How it is calculated
- Cost per request = input tokens ÷ 1,000,000 × input price + output tokens ÷ 1,000,000 × output price. Total = cost per request × number of requests.
- OpenAI: the official definition is that short context is up to 272K input tokens and long context is above 272K. This tool treats 272K as 272,000 and picks the short- or long-context price from the input tokens per request.
- Claude Haiku 5.5: the official page states that requests whose prompt exceeds 100,000 tokens are charged the higher price; this tool picks the price from the input tokens per request.
- Gemini: for models the official page prices in two prompt-length tiers, this tool treats 200k as 200,000 and picks the tier from the input tokens per request.
Models not included
| Model | Reason |
|---|---|
| Claude Opus 4.1Anthropic | marked retired by the official page |
| Claude Opus 4Anthropic | marked retired by the official page |
| Claude Sonnet 4.5Anthropic | marked retired by the official page |
| Claude Sonnet 4Anthropic | marked retired by the official page |
| Gemini 3.8 FlashGoogle | the official table lists two prices by date |
| Gemini 3.6 FlashGoogle | the official table lists two prices by date |
| Gemini 3.1 Flash-LiteGoogle | the official table lists several prices by input type |
| Gemini 3 Flash PreviewGoogle | the official table lists several prices by input type |
| Gemini 2.5 Flash-LiteGoogle | the official table lists several prices by input type |
For the prices of these models, see the Claude, OpenAI and Gemini pricing table articles.
FAQ
How is the cost calculated?
This tool uses the official per-million-token prices: cost per request = input tokens ÷ 1,000,000 × input price + output tokens ÷ 1,000,000 × output price, then multiplied by the number of requests.
What does the amount include?
Only the cost of input and output tokens. Other officially listed charges such as cache writes and reads, tools and regional processing uplifts are not calculated.
Why does the input token count change which price tier applies?
Some models are officially priced in tiers by the input length of each request: OpenAI defines short context as up to 272K input tokens and long context as above 272K; Anthropic states that Claude Haiku 5.5 is charged a higher price when the prompt exceeds 100,000 tokens. This tool picks the matching price from the input tokens per request you enter.
Why are some models missing from the list?
Claude models the official page marks as retired, and Gemini models for which the official page lists several prices in one cell by date or input type, are not included. The list is shown below the calculator.
Where do I find the token counts?
This tool does not count the tokens in your text. Enter the token counts you get from each API response or from the official tools.
Sources
The prices the calculator uses come from each of the three companies' own official pricing pages below. The cost figures are calculated by this tool. This site is not an official website of these companies; the official pages and your invoice are authoritative for what you are charged.
- AnthropicPricing (Claude Platform Docs)The Claude input, output, batch input and batch output prices the calculator uses; the official definition of MTok (per million tokens); the prompt-length pricing of Claude Haiku 5.5, with a higher price when the prompt exceeds 100,000 tokens.
- OpenAIPricing (OpenAI API docs)The input and output prices the calculator uses from the Standard and Batch tables under OpenAI's "Flagship models"; that prices are per million tokens; the definition of short context as up to 272K input tokens and long context as above 272K.
- GoogleGemini Developer API pricing (Google AI Studio docs)The Standard and Batch input and output prices the calculator uses for Gemini models; that prices are for the paid tier, per million tokens, in USD.
Sources checked on 2026-12-03