Guide
How LLM token pricing works
Every major LLM API bills by the token, a chunk of text of about four characters or three-quarters of an English word. Prices are quoted per million tokens, and input tokens (your system prompt, conversation history, retrieved documents and tool results) are billed separately from output tokens (the text the model generates). Output is almost always the expensive side: on most current models it costs four to five times more per token than input, because generating tokens one at a time uses far more GPU time than reading a prompt in parallel.
That gives a simple formula for any single request: input tokens × input price ÷ 1M + output tokens × output price ÷ 1M. A chatbot request with 2,000 input tokens and 500 output tokens on Claude Sonnet 5.5 ($2.00 input / $10.00 output per 1M) costs about $0.009. At 10,000 requests a day that is roughly $2,738 a month. The calculator above does exactly this for every model at once, so you can see how the same workload prices out across providers.
Comparing OpenAI, Claude and Gemini API pricing
Headline prices are a starting point, not the answer. Two models with the same per-token price can produce very different bills if one writes longer answers, needs a longer prompt to behave, or spends more hidden reasoning tokens. Mid-tier models like Claude Sonnet 5.5, GPT-6.2 Sol, and Gemini 4 Carbon are priced almost identically today, so a fair LLM cost comparison runs your own token counts through each one. For a quick scan of every input, cached and output rate, use the LLM API price table.
Why multi-turn AI agents cost more than chatbots
LLM APIs are stateless. To continue a conversation, your code re-sends the entire history on every call, and an agent adds tool definitions, tool calls and tool outputs to that history on every step. Input tokens therefore grow with each turn, and total input across a session grows roughly with the square of the number of turns.
Take a coding or research agent that starts with 12,000 tokens of context, adds 2,500 tokens of tool output and 500 tokens of its own output each turn, and runs for 25 turns. A naive estimate says 25 × 12,000 = 0.3M input tokens. The real figure is about 1.2M, 4× higher, because turn 25 re-reads everything the first 24 turns produced. Without caching, that single session costs around $2.52 on Claude Sonnet 5.5. An AI agent cost calculator has to model this context growth, which is what Pro / Agent mode above does. Voice agents follow the same pattern on every spoken turn; the AI voice agent cost calculator models it alongside speech-to-text, text-to-speech and telephony.
How prompt caching and Batch API discounts cut your bill
Prompt caching
Because agents re-send the same prefix over and over, providers let you cache it. Cached input tokens on Claude Sonnet 5.5 cost $0.10 per 1M instead of $2.00, a 95% discount. Anthropic charges a premium to write the cache ($2.50 per 1M); OpenAI and Google cache automatically for prompts above a minimum length. With an 85% cache hit rate, the agent session above drops from $2.52 to about $0.677, a 73% saving. To get high hit rates, keep everything stable (system prompt, tool schemas, reference documents) at the start of the prompt and append new content at the end. A timestamp or user ID near the top of the prompt breaks the cache on every request.
Batch API
If you don't need an answer in real time, the Batch API from OpenAI, Anthropic and Google takes 50% off both input and output tokens in exchange for results within 24 hours. Evals, document classification, data extraction, embeddings backfills and nightly summaries are all good fits. Batch and caching discounts can stack, which is why offline pipelines are often the cheapest LLM workloads to run.
How hidden reasoning tokens are billed
Reasoning models think before they answer. Those thinking tokens are generated like any other output and billed at the output rate, but most APIs never show them to you. A visible 500-token answer that needed 1,000 tokens of reasoning bills as 1,500 output tokens: $0.015 instead of $0.005 on Claude Sonnet 5.5. Reasoning usage varies with task difficulty and with effort settings, so measure it from the usage field of real responses, then set the reasoning multiplier in the calculator to match. Reasoning tokens are not carried into the next turn's context, so they raise output cost without inflating the input side of an agent loop.
Practical tips to reduce monthly LLM API spend
- Route by difficulty. Send simple classification, extraction and routing calls to a budget model and reserve flagship models for the hard cases. Many teams cut spend by 60–80% this way.
- Cap output length. Output tokens are the expensive side. Set max_tokens, ask for concise formats such as JSON, and avoid making the model repeat its input.
- Design prompts for caching. Put stable content first, variable content last, and check the cached-token count in API responses to confirm hits.
- Trim agent context. Summarize or drop old tool outputs instead of carrying full file contents and logs through every turn.
- Batch anything that can wait. Half price for the same model is the easiest saving available.
- Tune reasoning effort. Use low or medium effort, or a non-reasoning model, where deep reasoning doesn't improve results.
- Revisit self-hosting at scale. At billions of tokens a month, an open-weight model on a dedicated GPU can be cheaper. Use the API vs self-hosting break-even calculator to find your crossover point, and the LLM VRAM calculator to size the hardware.
Every number in this calculator lives in the page URL, so once you have an estimate you can copy the link and share it with your team or finance lead.