AI model pricing explained: input vs output tokens, context & caching (2026)
Every model on our leaderboard lists prices as dollars per million tokens. That format looks cryptic at first, but it hides only three moving parts. Once you understand them, comparing the 28+ models we track becomes simple arithmetic instead of guesswork.
What is a token?
A token is a chunk of text, roughly 0.75 words in English. So 1,000 tokens is about 750 words, and a 40-page contract lands somewhere around 20,000 tokens. Models bill by the token in both directions: what you send counts as input, and what the model writes back counts as output. Code, JSON, and non-English languages often tokenize less efficiently, so the same "amount" of content can cost more than plain English prose.
The three levers that decide your bill
- Input price per 1M tokens. This dominates when you stuff in long documents, big system prompts, or retrieved context. A RAG pipeline that sends 30,000 tokens of context per question is an input-heavy workload.
- Output price per 1M tokens. Usually 3 to 5 times the input price. It matters most when the model generates a lot, like long articles, full code files, or verbose reasoning model traces. Reasoning tokens count as output even though you never read most of them.
- Context window. The maximum tokens a model can hold at once. See the context window entry for details. Bigger is not automatically better; you only pay for what you actually send, but a huge window makes it easy to send far more than you need.
A worked example
Say a model costs $2 input and $10 output per 1M tokens. A typical request sends 10,000 input tokens and gets back 2,000 output tokens. The math: (10,000 divided by 1,000,000, times $2) plus (2,000 divided by 1,000,000, times $10) equals $0.02 plus $0.02, or $0.04 per call. At 100,000 calls a month, that is about $4,000.
Those example numbers are not hypothetical anymore. Claude Sonnet 5, launched June 30, 2026, opened at exactly $2 input and $10 output as introductory pricing. Anthropic's flagship Claude Fable 5 sits at $10 and $50 with a 1M token context window. Run the same 100,000-call workload through Fable 5 and the bill jumps to roughly $20,000. That five-fold gap is why routing matters.
Where the budget models fit
Below the mid-tier there is a whole class of models built to be cheap. DeepSeek V4 Pro, GLM 5.2, and MiniMax M3 lead this bracket on our leaderboard. They will not match a flagship on hard reasoning, but for classification, extraction, summarization, and routine chat they are often indistinguishable, at a fraction of the cost. A common production pattern is a three-tier stack: a budget model for high-volume simple calls, a mid-tier like Sonnet 5 as the workhorse, and a flagship reserved for the requests that genuinely need it.
Don't forget caching
Most providers now offer prompt caching. Repeated context, such as a long system prompt or a document you keep referencing, is billed at around 10% of the input price on cache hits. There is usually a small surcharge to write the cache the first time, so caching pays off when the same prefix is reused several times within the cache lifetime.
For agents and chatbots with stable context, this is a large real-world discount that the sticker price hides. Coding agents are the clearest case: a tool like Claude Code resends the same project context on every turn, so most of its input tokens land as cache hits. When you compare models for agent workloads, compare the cached input price, not just the headline number.
Three realistic scenarios
1. A support chatbot
Short questions, short answers, but a fat system prompt with your product docs. Input-heavy and cache-friendly. A budget model plus caching can bring the per-conversation cost down to fractions of a cent. Browse candidates in our best chatbot tools roundup.
2. A content pipeline
Short briefs in, 1,500-word drafts out. Output-heavy, so the output price dominates. Here the gap between a $10 output model and a $50 output model is the whole game, and a mid-tier model usually wins on cost per usable draft. See our best AI writing tools picks for tools that handle the routing for you.
3. Long-document analysis
You feed in a 200-page report and ask five questions. Without caching, you pay for the full document five times. With caching, you pay full price once and about 10% on each follow-up. This is where a large context window plus caching beats chunking the document yourself, and where Fable 5's 1M window earns its premium.
Subscriptions vs API pricing
One trap worth naming: consumer subscriptions and API pricing are different products. A $20 monthly chatbot plan has usage limits but a fixed cost, which is perfect for individual use. The API bills per token with no ceiling, which is what you want for products but dangerous without spend alerts. Many of the 126 tools in our directory sit on top of these APIs and bundle the token costs into their own plans, so the same logic explains their pricing tiers too.
The shortcut
Pick a cheap workhorse and a flagship for hard cases. Estimate both with the formula above using your real input and output sizes, not guesses. Route easy calls to the cheap model, enable caching for anything with a repeated prefix, and cap output length where you can. Then check your assumptions monthly, because prices keep falling; Sonnet 5's intro pricing undercut models that looked cheap six months ago. To weigh two specific models side by side, start with our Claude Fable 5 vs GPT-5.5 comparison or any matchup on the compare pages.