A per-token price only becomes a budget once you know how many tokens your product moves. This guide prices three common shapes of LLM application, a support chatbot, a retrieval-augmented (RAG) Q&A tool and a multi-step agent, on every model we track, and shows where the money actually goes in each.
The formula
For one request:
cost = input tokens × input price ÷ 1,000,000
+ output tokens × output price ÷ 1,000,000If part of the input is read from a prompt cache, that part uses the cached price instead. Multiply by requests per day and by 30 for a month. That is all the calculator does too. The hard part is not the arithmetic but the inputs: what really goes into “input tokens”.
What counts as input
Everything the model reads on that call: the system prompt, tool or function definitions, the conversation so far, retrieved documents, tool results, and the user’s message. APIs are stateless by default, so a chat app resends the whole conversation on every turn and pays for it again each time (unless it is cached). Output is everything the model writes, including reasoning or “thinking” tokens on models that bill them as output. See how to count tokens for measuring your own prompts.
Workload 1: support chatbot
3,000 chat turns a day. Each turn sends a 1,500-token system prompt plus about 1,300 tokens of conversation history and the new message (2,800 input tokens in total) and gets a 250-token answer.
On Sonnet 5.5 ($2 in, $10 out per million): input is 2,800 × $2 ÷ 1M = $0.0056, output is 250 × $10 ÷ 1M = $0.0025, so $0.0081 per turn, $24.30 a day and $729 a month. Caching the system prompt (54% of the input) brings that to $472.
The cached column assumes only the system prompt is cached, which is conservative: the earlier turns are also a repeating prefix. It is blank for Gemini because a 1,500-token prefix is below Google’s documented 4,096-token minimum for implicit caching on its larger models (and Google publishes no figure for Flash-Lite, so we do not assume a hit).
Workload 2: RAG over your documentation
1,000 questions a day. Each request carries a 600-token system prompt, five retrieved chunks of 800 tokens and a 50-token question (4,650 input tokens), and returns a 400-token answer.
RAG is input-heavy: the retrieved context dominates. It is also hard to cache, because the chunks differ from question to question and the only stable part, the short system prompt, is under the minimums of OpenAI and Google. So the table prices it uncached. Two levers matter more here than the model’s output price: retrieving fewer or shorter chunks, and a cheaper input rate. Even so, output still matters: on GPT-6 Luna, the 400 output tokens are 30% of each request’s cost, because output costs 5× input.
Workload 3: a multi-step agent
200 tasks a day (a coding or research agent, say). Each task takes 15 model calls. The first call sends 8,000 tokens (instructions, tool definitions, the task); every step adds about 2,150 tokens of tool results and the model’s own previous output, so the context grows to 38,100 by the last call. Average input per call: 23,050 tokens; output per call: 600.
Agents are where costs surprise people: the context is re-read on every step, so a task’s total input grows roughly with the square of the number of steps. They are also where caching pays most, because each call’s input is the previous call’s input plus a little. We assume 90% of each call’s input is a cache hit (only the newest 2,150 tokens are new). On Sonnet 5.5 a task costs $0.781 uncached and $0.190 cached; on GPT-6 Luna, $0.039 and $0.011. One simplification: on Anthropic and OpenAI, the new tokens of each step are usually written to the cache at 1.25× the input rate before the next step reads them, which adds a few percent to the cached figures; we leave writes out. Google’s note on Gemini 4 agent loops is relevant here: a turn must add at least 2,050 tokens for the full previous request to be cached, and these steps add 2,150.
All three workloads on every model (per 30-day month)
| Model | Chatbot | Chatbot, prompt cached | RAG | Agent | Agent, 90% cached |
|---|---|---|---|---|---|
| OpenAI GPT-5 nano | $21.60 | $15.53 | $11.78 | $125 | $41.31 |
| Anthropic Haiku 5.5 | $36.45 | $24.30 | $19.95 | $234 | $66.42 |
| OpenAI GPT-6 Luna | $36.45 | $24.30 | $19.95 | $234 | $66.42 |
| Google Gemini 3.1 Flash-Lite | $96.75 | — | $52.87 | $600 | $180 |
| DeepSeek V4.1 Flash | $103 | $62.91 | $56.25 | $687 | $138 |
| Google Gemini 3.5 Flash-Lite | $132 | — | $71.85 | $757 | $253 |
| Google Gemini 3.8 Flash | $273 | — | $150 | $1,758 | $498 |
| xAI Grok Build 0.1 | $297 | $189 | $164 | $2,183 | $689 |
| DeepSeek V4 Pro | $422 | $249 | $232 | $2,952 | $570 |
| xAI Grok 4.7 | $639 | $437 | $351 | $4,473 | $1,672 |
| Anthropic Sonnet 5.5 | $729 | $472 | $399 | $4,689 | $1,142 |
| OpenAI GPT-6.1 Sol | $729 | $472 | $399 | $4,689 | $1,142 |
| Google Gemini 4 Argon | $729 | — | $399 | $4,689 | $1,142 |
| Google Gemini 3.1 Pro | $774 | — | $423 | $4,797 | $1,436 |
| Anthropic Opus 5.5 | $1,458 | $945 | $798 | $9,378 | $2,283 |
| OpenAI GPT-5.6 Sol | $1,458 | $972 | $798 | $9,378 | $2,657 |
| Anthropic Fable 5.1 | $3,645 | $2,329 | $1,995 | $23,445 | $5,241 |
| OpenAI GPT-6 Astra | $3,645 | $2,430 | $1,995 | $23,445 | $6,642 |
| OpenAI GPT-5.5 Pro | $11,610 | — | $6,345 | $71,955 | — |
List prices from our dataset (DeepSeek at peak-hour rates; off-peak is half). Long-context surcharges are not applied: the largest prompt here is 38,100 tokens, below the 100K–272K thresholds where Haiku 5.5, Gemini 3.1 Pro, Grok and GPT-5.5 Pro start charging more.
Mistakes that make estimates wrong
- Pricing only the user’s message. The system prompt and history are usually most of the input.
- Ignoring reasoning tokens. A model that “thinks” before answering can write several times more output tokens than the visible reply, all billed at the output rate.
- Using averages for limits. Budget with the average, but set rate limits and alerts with a high percentile; one runaway agent loop can cost more than a day of chat.
- Forgetting retries and evaluations. Failed calls that you retry, test suites and prompt experiments all bill at the same rates.
- Copying token counts between models. Tokenizers differ; recount on the model you will actually use.
When this kind of estimate is not enough
These are list prices for pay-as-you-go API use. They do not cover negotiated or committed-use contracts, regional or data-residency surcharges (OpenAI’s regional processing and Anthropic’s US-only inference both cost 10% more), priority or fast tiers (2× on xAI and OpenAI’s Fast tier), tool fees such as web search, or image and audio models. For those, start from the provider’s own page, linked on each comparison row.
Sources
- Claude pricing
- OpenAI API pricing
- Google AI for Developers: Gemini API pricing
- Google AI for Developers: Context caching (minimums, Gemini 4 agent loops)
- xAI Docs: Pricing
- DeepSeek API Docs: Models & Pricing
- Claude Docs: Prompt caching (minimum cacheable length)
- OpenAI API Docs: Prompt caching (minimum prefix)