Input tokens (your prompt) and output tokens (the model's completion) are billed separately, and output tokens typically cost 4-5x more per token than input tokens across major providers. Because generation is also slower and less predictable in length than the prompt you control, the "return trip" — the completion — usually dominates your bill, even when your prompt is huge.
Quick Answer: You're charged once for what you send (input) and again — at a much higher per-token rate — for what comes back (output). A verbose completion format, like formatted prose instead of compact JSON, can double your cost without changing your prompt at all.
Why do output tokens cost more than input tokens?
Output tokens cost more because generating each one requires a full forward pass through the model, while input tokens can be processed in parallel and cached. On Claude models, for example, output pricing runs roughly 5x input pricing per token — a pattern that holds, with varying ratios, across Anthropic, OpenAI, and Google's frontier models.
Input tokens are compute-cheap in a specific way: the model reads your entire prompt in one parallelized pass, and — with prompt caching — repeated prefixes can be reused across requests at a fraction of the cost. Output tokens are generated autoregressively, one at a time, each one requiring its own pass through the network conditioned on everything before it. There's no shortcut for generation the way there is for reading.
This isn't a Claude-specific quirk. It reflects how transformer-based large language models work at the architecture level — a fact well documented in Anthropic's own Claude API pricing documentation and echoed across every major lab's pricing pages. For a broader primer on why tokens (not words or characters) are the billing unit in the first place, see tokens, not words: the actual unit of AI billing.
The typical ratio, by rough order of magnitude
| Token type | Relative cost | Why |
|---|---|---|
| Input (prompt) | 1x baseline | Parallelized read; cacheable across repeated calls |
| Output (completion) | ~4-5x input | Autoregressive generation, one token at a time, no caching |
Exact multiples vary by model and shift over time — check current published rates before modeling costs precisely. The direction of the gap (output costs meaningfully more per token) has been stable across model generations from every major lab.
How do input and output tokens actually get counted?
Input tokens are everything you send in a single API call — system prompt, conversation history, retrieved documents, tool definitions, and the user's message. Output tokens are everything the model generates in response, including any internal reasoning tokens the model produces before its final answer.
A subtlety PMs often miss: conversation history counts as input tokens on every single turn. In a multi-turn chat, you re-send the full transcript each time (the API is stateless), so a long conversation's cost grows on the input side even though nothing "new" is being typed. This is one reason context-window management matters — see context windows: what they really mean for your product for how that budget actually gets consumed.
- Input tokens include: system instructions, few-shot examples, RAG-retrieved chunks, tool/function schemas, prior turns, the current user message.
- Output tokens include: the visible completion text, structured output (JSON, code), and — on models with extended or adaptive thinking — internal reasoning tokens, which are billed as output even when hidden from the end user.
That last point matters for unit-economics modeling: a reasoning-heavy request can generate thousands of output tokens the user never sees rendered, but every one of them appears on the invoice.
Why does the "return trip" usually dominate the bill?
The completion usually costs more in total dollars than the prompt because output's per-token price is higher and its length is harder to bound — a chatty model can produce 3-4x the tokens needed to answer correctly. Input, by contrast, is something you fully control and can compress.
Think of it as an asymmetric round trip. You choose exactly what to send — you can trim, summarize, or cache your input. You do not fully choose what comes back. A model asked an open-ended question may write three paragraphs where three sentences would do; a model asked to "list the fields" may pad each field with a full sentence of explanation.
Two levers that inflate the return trip
- Verbosity of the response format. Prose costs more tokens than structured data for the same information — see the worked example below.
- Unbounded generation length. Without a ceiling or a tight prompt, models often over-explain, especially on reasoning-capable models where thinking tokens add up before the visible answer even starts.
Both levers are addressable at the prompt-engineering layer, which is exactly the discipline this cost model rewards investing in.
Worked example: JSON vs prose can roughly halve your bill
Cutting response verbosity — trading a prose explanation for compact structured output — can cut total token cost by 40-60% on extraction-style tasks, because output tokens are the expensive side of the ledger and JSON is a denser encoding of the same information than sentences.
Consider a task: extract five fields (name, company, role, email, and one summary sentence) from a piece of unstructured text, for 1,000 records.
Prose-style completion (a natural-sounding paragraph per record):
"The person's name is Jane Doe, and she works at Acme Corporation in the role of VP of Engineering. Her email address is jane.doe@acme.com. In summary, she is a senior technical leader focused on platform reliability."
Roughly 55-65 output tokens per record once you count the connective language.
JSON-style completion (same information, compact):
{"name":"Jane Doe","company":"Acme Corporation","role":"VP of Engineering","email":"jane.doe@acme.com","summary":"Senior technical leader focused on platform reliability."}
Roughly 30-35 output tokens per record — the facts are identical, but the connective tissue ("the person's name is...", "in summary, she is...") is gone.
The math, at illustrative rates
| Format | Output tokens/record | Output tokens (1,000 records) | Relative output cost |
|---|---|---|---|
| Prose paragraph | ~60 | ~60,000 | 1.0x (baseline) |
| Compact JSON | ~32 | ~32,000 | ~0.53x |
Input tokens (the source text plus instructions) are roughly the same in both cases, since you're extracting from the same source. The savings live almost entirely on the output side — and because output is priced at that ~4-5x multiplier, a 47% cut in output tokens translates to a larger cut in output dollars, and a meaningful cut in total request cost.
The general principle: any time you can specify a tighter output contract — a schema, an enum, a fixed set of fields — instead of leaving format open-ended, you're pulling on the more expensive lever in the pricing model.
Why is "just set max tokens" a guardrail, not a fix?
Setting a max_tokens cap protects you from runaway generation costs and timeouts, but it does not reduce your average cost per request — it only bounds the worst case. A model that would naturally generate 2,000 tokens still generates roughly 2,000 tokens whether or not a 4,000-token cap exists above it; the cap just prevents a 10,000-token outlier from blowing your budget.
This distinction trips up PMs building cost models. A max_tokens parameter is a safety rail, not a cost-reduction lever. It stops the tail-risk case — a model stuck in a repetition loop, or a prompt that accidentally invites an essay — from becoming a five-figure surprise on a monthly invoice. It does nothing to make a normally-verbose response shorter.
Setting
max_tokenstoo low creates its own failure mode: truncated output. A response cut off mid-JSON-object or mid-sentence is often worse than a slightly longer one, because downstream parsing breaks. This is a documented gotcha in Anthropic's own API guidance onmax_tokensand streaming — hitting the cap doesn't gracefully summarize; it just stops.
What actually reduces average cost vs. what guards against worst case
| Technique | Reduces average cost? | Guards against worst case? |
|---|---|---|
| Tighter output format (JSON, schema) | Yes | No |
| Prompting for brevity explicitly | Yes, partially | No |
Setting max_tokens | No | Yes |
| Prompt caching on repeated input | Yes (input side only) | No |
For teams building actual per-request cost projections, treat max_tokens as insurance you always carry, and treat output-format discipline as the thing you actually tune to move the average down.
How does this change what a PM should ask before shipping an AI feature?
Before shipping any LLM-powered feature, a PM should ask: what's the expected output length under normal use, and can the output contract be made tighter without losing what the user needs? These two questions surface most of the avoidable cost in a feature before it ships.
This is really a prompt engineering and product-scoping question, not just a finance question. The same model, same input, same underlying task can cost meaningfully different amounts depending on whether you asked for "a helpful explanation" or "a JSON object with these five fields." Framing the output contract is a product decision, made early, with real cost consequences downstream — the same way choosing a database schema has consequences for query performance later.
- Ask: does the user actually need prose, or would structured data (which your UI then renders as prose) work just as well at a third of the cost?
- Ask: is there a reasoning-capable model in the loop generating invisible thinking tokens, and does the task actually need that depth?
- Ask: what's the
max_tokensceiling, and is it sized to the worst realistic case rather than left at a provider default?
Answering these before launch is cheaper than discovering the answer in a usage-based billing spike three weeks after shipping.
Where Prodinja fits into this
Modeling the input/output split isn't a one-time exercise — it shifts every time a prompt changes. Prodinja's Context Engineering practice is designed to walk through exactly this: how a given prompt's structure shapes the balance between what you send and what comes back, so the trade-off between response quality, format, and token spend is visible as you iterate rather than discovered on an invoice. As a prototype experience, it's intended to make that shift legible, not to run a live cost simulation against your production traffic.
For the foundational vocabulary this article builds on — what a token actually is, why LLMs bill in tokens rather than characters or API calls — see the complete guide to LLM fundamentals and tokens, not words: the actual unit of AI billing. And because token cost is only one input into a broader unit-economics model, understanding how meaning gets represented and retrieved is also worth grounding — see embeddings explained for PMs for the adjacent piece of that picture.
Key Takeaways
- Output tokens cost roughly 4-5x more per token than input tokens across major LLM providers, because generation is sequential and uncacheable while prompt processing is parallelized and cacheable.
- The completion is usually the expensive half of a request, not the prompt — even a short question can produce a costly, verbose answer.
- Tightening the output format (JSON vs. prose) can cut output tokens by roughly 40-60% on extraction-style tasks, with no loss of information.
max_tokensis a safety rail against runaway or looping generations, not a lever for reducing your average cost per request — don't confuse capping the worst case with lowering the mean.- Reasoning/thinking tokens on extended-thinking models are billed as output even when hidden from the user, so a "simple" question can carry a large invisible cost.
- Conversation history re-sends as input tokens on every turn in a multi-turn chat, since the API is stateless — long conversations grow expensive on the input side too.
- Output-format discipline is a product and prompt-engineering decision, best made before a feature ships, not discovered afterward in a billing dashboard.
Frequently Asked Questions
Why do input and output tokens have different prices?
Input and output tokens are priced differently because they require fundamentally different computation: input is processed in one parallelized pass (and can be cached across repeated prompts), while output is generated one token at a time, sequentially, with no equivalent caching shortcut. That structural difference is why output tokens run roughly 4-5x the price of input tokens on most frontier models.
Does a longer prompt or a longer response cost more?
It depends on the actual token counts, but a longer response typically costs disproportionately more than a longer prompt of the same token length, because output tokens are priced at a multiple of input tokens. A 500-token prompt and a 500-token completion are not equal in cost — the completion is the pricier half.
Can I reduce output token cost without losing information?
Yes — the most reliable way is tightening the output contract: ask for structured formats like JSON or a fixed schema instead of open-ended prose, which removes connective language ("the answer is...", "in summary...") without removing any facts. This commonly cuts output tokens by 40% or more on structured-extraction tasks.
Is setting maxtokens enough to control my AI costs?
No — max_tokens caps the worst-case length of a single response, but it does not lower the average cost of a typical request, since a normally-verbose model still generates roughly the same number of tokens under the cap. Pair a sensible max_tokens ceiling (for safety) with output-format tightening (for actual average-cost reduction).
Do "thinking" or reasoning tokens count as output tokens?
Yes — on models with extended or adaptive thinking, the internal reasoning tokens the model produces before its visible answer are billed as output tokens, even when that reasoning is hidden or only shown as a summary. A task that looks simple to the end user can still carry a nontrivial reasoning-token cost behind the scenes.