LLM API Cost Calculator
Price a real workload across Claude, GPT, Gemini, DeepSeek, Grok and Qwen side by side, with prompt caching, batch discounts and exact token counts.
Updated · By Niraj Kumar · 6 sources
https://checkpre.com/ai/llm-api-cost-calculator
Model
Each request
System prompt, conversation history, documents and tool definitions are all resent on every call.
The visible answer.
Count tokens from a prompt or JSON payloadShowHide
Plain text, OpenAI Chat or Responses JSON, or Anthropic Messages JSON. A final assistant message or a response body counts as output. Counted in your browser; nothing is uploaded.
Loading the tokenizer…
Counts use OpenAI's o200k tokenizer, so they are exact for GPT-6 and GPT-5 models, plus a few tokens of message framing. Other providers' tokenizers count the same text differently and do not publish a conversion factor; Anthropic says Claude models from 4.7 on produce about 30% more tokens than earlier Claude models. For an exact count on another model, paste one of its API responses: the usage it reports is shown above.
Thinking tokens are billed as output. Leave at 0 for models or settings that do not reason.
Volume
30,000 requests over 30 days.
Discounts
The share of input that repeats exactly at the start of every request, such as a fixed system prompt. The prompt caching calculator prices cache writes and expiry in detail.
- Per 1,000 requests
- $11.00
- Input
- $180.00
- Output
- $150.00
- Price rank
- 15th cheapest of 24
- Cheapest listed model
- Claude Haiku 5.5
- $16.50 a month, $313.50 less
- Input55%
- Output45%
- 1Claude Haiku 5.5Anthropic$16.50
- 2GPT-6 LunaOpenAI$16.50
- 3Qwen3.8 FlashAlibaba$20.55
- 4GPT-5.6 LunaOpenAI$36.00
- 5DeepSeek V4.1 FlashDeepSeek$45.00
- 6Qwen3.7 PlusAlibaba$60.00
- 7Gemini 3.5 Flash-LiteGoogle$64.50
- 8Gemini 3.8 FlashGoogle$123.75
- 9Grok 4.3xAI$150.00
- 10Claude Haiku 4.5Anthropic$165.00
- 11DeepSeek V4 ProDeepSeek$178.20
- 12Grok 4.7xAI$270.00
- 13Qwen3.8 MaxAlibaba$270.00
- 14Claude Sonnet 5.5Anthropic$330.00
- 15Claude Sonnet 5Anthropic$330.00
- 16GPT-6.1 SolOpenAI$330.00
- 17GPT-6 SolOpenAI$330.00
- 18GPT-5.6 TerraOpenAI$360.00
- 19Gemini 3.1 ProGoogle$360.00
- 20Claude Opus 5.5Anthropic$660.00
- 21GPT-5.6 SolOpenAI$660.00
- 22Claude Opus 5Anthropic$825.00
- 23Claude Fable 5.1Anthropic$1,650
- 24GPT-6 AstraOpenAI$1,650
How the LLM API Cost Calculator works
Multiply a request's input tokens by the model's input price and its output tokens, reasoning included, by the output price, each per million tokens, then multiply by requests per month. Cached input bills at a fraction of the input rate, and most providers' batch APIs halve both. Prices below were checked October 13, 2026.
Every provider bills per million tokens, with separate rates for input and output. Output costs four to eight times as much as input on every model listed, and reasoning or thinking tokens are billed as output. Input served from a prompt cache is billed at a tenth of the input rate or less. The batch API halves every rate in exchange for results within 24 hours, and a few models move the whole request to higher rates once the prompt passes a long-context threshold.
cost = (fresh input × input rate + cached input × cache rate + (output + reasoning) × output rate) ÷ 1,000,000- input
- Everything sent: system prompt, history, documents, tool definitions
- output
- The generated answer
- reasoning
- Thinking tokens the model generates before answering
- cache rate
- The rate for input served from a prompt cache
- 1 token
- About 4 characters, or ¾ of a word, in English
| Model | Input | Cached input | Output |
|---|---|---|---|
| Claude Fable 5.1 | $10 | $0.25 | $50 |
| Claude Opus 5.5 | $4 | $0.20 | $20 |
| Claude Opus 5 | $5 | $0.50 | $25 |
| Claude Sonnet 5.5 | $2 | $0.10 | $10 |
| Claude Sonnet 5 | $2 | $0.20 | $10 |
| Claude Haiku 5.5 | $0.10 | $0.01 | $0.50 |
| Claude Haiku 4.5 | $1 | $0.10 | $5 |
| GPT-6 Astra | $10 | $1 | $50 |
| GPT-6.1 Sol | $2 | $0.10 | $10 |
| GPT-6 Sol | $2 | $0.20 | $10 |
| GPT-6 Luna | $0.10 | $0.01 | $0.50 |
| GPT-5.6 Sol | $4 | $0.40 | $20 |
| GPT-5.6 Terra | $2 | $0.20 | $12 |
| GPT-5.6 Luna | $0.20 | $0.02 | $1.20 |
| Gemini 3.1 Pro | $2 | $0.20 | $12 |
| Gemini 3.8 Flash | $0.75 | $0.075 | $3.75 |
| Gemini 3.5 Flash-Lite | $0.30 | $0.03 | $2.50 |
| DeepSeek V4 Pro | $1.32 | $0.044 | $3.96 |
| DeepSeek V4.1 Flash | $0.30 | $0.006 | $1.20 |
| Grok 4.7 | $2 | $0.50 | $6 |
| Grok 4.3 | $1.25 | $0.20 | $2.50 |
| Qwen3.8 Max | $2 | $2 | $6 |
| Qwen3.7 Plus | $0.40 | $0.04 | $1.60 |
| Qwen3.8 Flash | $0.15 | $0.15 | $0.47 |
Worked example
A chat feature on Claude Sonnet 5 sending 3,000 input tokens and getting 500 back, 1,000 times a day.
- 1Input: 3,000 × $2 ÷ 1,000,000 = $0.006
- 2Output: 500 × $10 ÷ 1,000,000 = $0.005
- 3Per request: $0.011
- 4Per month: $0.011 × 1,000 × 30 = $330.00
$330.00 a month. Caching a fixed system prompt that makes up 80% of the input would bring it to about $200.40, and the batch API would halve either figure.
Frequently asked questions
Which LLM API is cheapest?
For raw price per token, the small models: GPT-6 Luna and Claude Haiku 5.5 at $0.10 per million input tokens, then Qwen3.8 Flash, GPT-5.6 Luna and DeepSeek V4.1 Flash. The ranking changes with the shape of the workload, though. Output-heavy work favours models with cheap output, long cached prompts favour models with cheap cache hits, and very long prompts can push some models onto long-context rates. Enter your own numbers and the chart ranks every model on that workload.
How do I estimate tokens per request?
Use about 4 characters or three-quarters of a word per token for English prose, so a 1,500-word document is roughly 2,000 tokens. Code and non-English text usually take more. Count the whole request, not just the user's message: the system prompt, conversation history and tool definitions are resent on every call. For exact figures, every provider returns token counts in the API response, and some offer a token-counting endpoint.
Are token counts the same across providers?
No. Each model family has its own tokenizer, so identical text can produce noticeably different counts. Anthropic notes that Claude models from 4.7 onward use a tokenizer that produces about 30% more tokens for the same text than earlier ones. For a fair comparison, run a sample of real prompts through each provider and read the usage figures they return.
When should I use the batch API?
Whenever nobody is waiting on the answer: nightly summaries, back-filling tags, evaluations, bulk extraction. Anthropic, OpenAI and Google take 50% off input and output for batch requests, which return within 24 hours and often much sooner, and the discount stacks with caching. xAI takes 20% off Grok 4.3 and does not batch Grok 4.7. DeepSeek has no batch API but halves every rate off-peak, and Alibaba's Qwen models listed here have no batch discount.
Do long prompts cost more per token?
On some models. OpenAI bills the whole request at twice the input and cache rates and 1.5× the output rate once the prompt passes 272,000 tokens. Gemini 3.1 Pro and both Grok models charge more from 200,000, Qwen3.7 Plus from 256,000, and Claude Haiku 5.5 from 100,000. Other Claude models, DeepSeek and Qwen3.8 bill their whole window at one rate. The calculator switches rates automatically and flags the models affected.
What else affects the bill?
Server-side tools such as web search carry per-use fees, Anthropic's US-only inference costs 1.1× the standard rate, and fast or priority modes cost more. Negotiated and committed-use discounts lower it. This calculator covers the standard rates, which are the right baseline for comparing models.
Sources
- Anthropic, Claude API pricing · checked
- OpenAI, API pricing · checked
- Google, Gemini API pricing · checked
- DeepSeek, Models and pricing · checked
- xAI, Models and pricing · checked
- Alibaba Cloud Model Studio, Model pricing · checked
Related calculators
- Prompt Caching ROI CalculatorSee whether caching your system prompt or documents pays off: cache writes, reads, expiry and break-even for Claude, GPT and Gemini.
- Claude Sonnet 5 vs GPT-6 Sol API CostClaude Sonnet 5 and GPT-6 Sol list at the same $2 in and $10 out. See where they still differ: long prompts, cache lifetimes and token counts.
- LLM Cost per Million Words CalculatorWhat it costs to have Claude, GPT or Gemini read or write a million words, with words converted to tokens for you.
- AI Chatbot Cost CalculatorWhat a customer support or assistant chatbot costs to run on Claude, GPT or Gemini per month, with the system prompt cached.
More in AI, Cloud & Developer
- RAG Cost Calculator
- AI Coding Agent Cost Calculator
- LLM Summarization Cost Calculator
- LLM Classification Cost Calculator
- Claude Sonnet 5 vs GPT-5.6 Terra API Cost
- Claude Sonnet 5 vs Gemini 3.1 Pro API Cost
- Claude Sonnet 5 vs Claude Opus 5.5 API Cost
- Claude Opus 5.5 vs GPT-6 Astra API Cost
- All 99 AI, Cloud & Developer calculators