Output tokens are the pricey side: where an agent's output bill comes from and how to shrink it
On current Claude, OpenAI and Gemini models, output tokens cost five times what input does, and thinking, tool arguments and replies all bill at that rate. Here's how the output side of an agent run adds up on Claude, OpenAI and Gemini as of November 2026, and the settings that actually cut it.
Some links are affiliate links; we may earn a commission at no extra cost to you. As an Amazon Associate I earn from qualifying purchases. Disclosure
Most agent cost advice is about input. Cache the prefix, trim the history, compact old turns, load fewer tool definitions. All good advice, and we've written plenty of it. But there's a second line on the invoice that gets far less attention, and on current models it's the expensive one. On every Anthropic, OpenAI and Google model on our models page, output tokens cost five times as much as input tokens, and an agent produces a lot more output than the replies you actually read.
This post looks at where that output comes from in an agent loop, works through what it costs on one real price card, and goes through the settings on Claude, OpenAI and Gemini that change it. Prices and parameter names are as of November 26, 2026.
The 5x rule on current price cards
Pull up the price pages and the ratio jumps out. On Anthropic's pricing page, Claude Fable 5.2 is $8 per million input tokens and $40 per million output, Claude Opus 5.5 is $4 and $20, Claude Sonnet 5.5 is $2 and $10, and Claude Haiku 5.5 is $0.10 and $0.50 for prompts up to 100,000 tokens. OpenAI's pricing page lists GPT-6.2 Astra at $8 and $40 and GPT-6.2 Sol at $2 and $10 for short context. Google's Gemini API pricing has Gemini 4 Neon at $3 input and $15 output, and Google labels that output line "Output price (including thinking tokens)."
Every one of those is exactly 5x. So a token the model writes costs as much as five tokens it reads, and on a cached prefix the gap is wider still. Sonnet 5.5 cache hits are $0.10 per million, which makes an output token worth a hundred cached input tokens.
And output means a lot more than the final answer.
Three things your agent writes that you pay for
The first is thinking. All three providers bill reasoning tokens at the output rate, even when you never see them. OpenAI's reasoning guide says reasoning tokens "are not visible via the API" but still take up context and "are billed as output tokens." Google's thinking docs put it as "response pricing is the sum of output tokens and thinking tokens." Anthropic's extended thinking docs point you at usage.output_tokens_details.thinking_tokens, which reports how many of the billed output tokens were internal reasoning.
The second is tool call arguments. Every time the model calls a tool, the JSON it writes for the arguments is output. A search(query) call is a handful of tokens and nobody cares. An edit_file tool that takes the whole new file as an argument is a different story. If the model rewrites a 400-line file to change one function, you're paying output rates for 399 lines it copied.
The third is the text between steps. Plenty of agents narrate what they're about to do before every tool call, recap what they just learned after it, and then write a long final summary. None of that is wrong exactly, but at 5x it adds up fast when it happens on every turn of a 30-turn run.
A worked example
Take a 20-turn coding agent on Claude Sonnet 5.5. The context grows to about 40,000 tokens per turn, and prompt caching is working well, so on a typical turn 36,000 tokens are cache hits and 4,000 are new tokens getting written to the 5-minute cache. Say the model writes 1,500 output tokens per turn, split between some thinking, a tool call and a sentence or two of text. Those turn sizes are illustrative, not measured, but they're in the normal range for a loop like this.
Using Anthropic's Sonnet 5.5 rates, the input side of one turn is 36,000 cache hits at $0.10 per million, which is $0.0036, plus 4,000 cache writes at $2.50 per million, which is $0.01. That's $0.0136. The output side is 1,500 tokens at $10 per million, which is $0.015.
So output is already the bigger half of the bill even though it's under 4% of the tokens. Over 20 turns that's about $0.27 of input and $0.30 of output.
Now let the model think harder. If output grows to 4,000 tokens per turn because of deeper reasoning or chattier tool calls, output per turn is $0.04 and the run's output total is $0.80, while the input side barely moves. The run went from about $0.57 to about $1.07, and every cent of the increase came from what the model wrote.
GPT-6.2 Sol gives you nearly the same math. OpenAI's table lists it at $2 input, $0.10 cached input, $2.50 for a 30-minute cache write and $10 output for short context, so the same turn sizes land on the same numbers. If you want to try your own turn sizes, the run cost calculator does this arithmetic for a whole loop.
Once caching is pulling its weight, the input bill is mostly just a function of how big your context is. The output bill is the one your settings move.
Knob one: effort and thinking level
This is the biggest lever and all three providers have one.
On Claude it's output_config.effort. Anthropic's effort docs say effort affects all tokens in the response, including text, tool calls and function arguments, and thinking when it's active, and that "lower effort also means fewer and terser tool calls." The defaults differ by model, which is worth knowing before you assume anything: most Claude models default to high, while Claude Opus 5.5 and Claude Haiku 5.5 default to medium. Anthropic also says effort "is a behavioral signal, not a strict token budget," so low still thinks on hard problems, just less.
On OpenAI it's reasoning.effort. The reasoning guide lists values that depend on the model, from none and minimal up through xhigh and max, and says lower effort "favors speed and lower token usage." One catch on the newest models: GPT-6.2 Astra and GPT-6.2 Sol reject none, and the GPT-6.2 migration notes tell you to use low if you were on none or minimal before.
On Gemini it's thinking_level. The thinking docs say Gemini 4 Neon and Gemini 4 Hydrogen default to high and also support xhigh, while Gemini 4 Carbon and Gemini 4 Argon default to medium. minimal isn't supported on Gemini 4 models at all.
For an agent, the useful move is not picking one level for the whole run. A planning turn at the start of a hard task might deserve high. The fifteenth "read the next file" turn does not. Anthropic supports changing effort mid-conversation on Claude Fable 5.2, Sonnet 5.5 and Haiku 5.5 through a per-message output_config on supported platforms, and the docs note that it preserves the prompt cache, which matters because you don't want to save on output and then pay to rebuild your cache. On the other providers you set effort per request, so the same idea works: route the cheap mechanical steps at low and save the high levels for the turns that need them. We covered when thinking pays for itself in more depth in our reasoning models piece.
Knob two: reply length
Effort mostly changes how much the model thinks, not how long it talks. Anthropic says this directly for Claude Fable 5.2: "Effort barely changes how long the model's replies are, so use your prompt to change reply length and tone." So if your agent writes three paragraphs of narration around every tool call, turning effort down won't fix it. Tell it not to. Something as plain as "Don't explain tool calls before making them. After the task is done, reply in two sentences or fewer" goes a long way.
OpenAI has a real parameter for this. The Responses API reference documents text.verbosity with values low, medium and high, defaulting to medium, and says lower values "will result in more concise responses." For agent steps whose text nobody reads, low is an easy win. One more thing from the GPT-6.2 notes: GPT-6.2 Astra is "more concise and direct by default," and OpenAI suggests revisiting "be concise" instructions when you migrate. If you stack a verbosity setting, a terse model and an old "be brief" prompt, you can end up with answers that are too thin to be useful, so test before stacking all three.
Knob three: what your tools ask the model to write
No API setting fixes this one. It's on you and your schemas. Look at your tool schemas and ask which ones make the model produce a lot of text.
The classic offender is a file write tool that takes full content. A patch or search-and-replace style tool, where the model sends the old snippet and the new snippet, can turn a few thousand output tokens into a few hundred. Same idea for tools that take long free-text fields like "notes" or "reasoning." If your code never reads that field, you're paying 5x rates for the model to fill it in. Drop it.
The flip side also matters. Tool results are input, and input is cheap, especially cached. So it's often worth returning a little more context from a tool if it saves the model from writing a follow-up call or a long explanation. We went through result design in what an MCP tool should return.
Knob four: max_tokens is a ceiling, not a savings plan
It's tempting to slash max_tokens (or max_output_tokens on OpenAI) and call it cost control. Be careful, because with thinking models the ceiling covers everything the model writes.
OpenAI's reference says max_output_tokens is an upper bound "including visible output tokens and reasoning tokens." The reasoning guide warns that if the limit is hit, the response comes back incomplete with reason max_output_tokens, and this "might occur before any visible output tokens are produced, meaning you could incur costs for input and reasoning tokens without receiving a visible response." OpenAI recommends reserving at least 25,000 tokens for reasoning and outputs when you start out. Anthropic's effort docs say max_tokens is "a hard limit on total output (thinking plus response text)" and, for agentic coding on Claude Sonnet 5.5, suggest setting it to 128,000, the model's maximum, and streaming the response.
So a tight cap doesn't save money. It cuts the model off after you've already paid for most of the thinking, and then your loop retries and pays again. Set the cap high enough that a normal turn never touches it, treat hitting it as a bug worth logging, and control spend with effort and prompts instead. The stop reasons post covers how to handle a truncated turn when it does happen.
Measure the split before you tune it
None of this works if you only log total tokens. All three APIs break out thinking from the rest of the output, so log both per turn.
On OpenAI, the reasoning count is in usage.output_tokens_details.reasoning_tokens. On Claude, it's usage.output_tokens_details.thinking_tokens, and Anthropic notes that when streaming this only shows up on the final message_delta event, so make sure your stream handler actually keeps that last event. On Gemini, the thinking docs show total_thought_tokens and total_output_tokens on the usage object.
Once you have per-turn numbers, the patterns are usually obvious. Maybe 80% of output is thinking on turns that are just reading files, which says drop effort on those steps. Maybe one tool accounts for most of the visible output, which says redesign its arguments. Maybe the final summary is a thousand tokens nobody reads. You can't see any of that from a monthly total.
Batch discounts cover output too
One last thing for work that doesn't need an answer right now. Batch discounts apply to output, not just input. Anthropic's pricing page says the Batch API gives "a 50 percent discount on both input and output tokens," and Google's batch tab for Gemini 4 Neon lists output at $7.50 instead of $15. If your agent does overnight jobs like eval sweeps, document processing or bulk triage, the output-heavy parts are exactly what you want on batch. More on that in our batch API guide.
Where to start
If you only do one thing this week, log thinking tokens and visible output separately for every turn of a real run. Then lower effort on the mechanical steps, tell the model to stop narrating, and fix whichever tool makes it copy the most text. Leave max_tokens generous. On a loop that's already cached well, that's most of what's left to cut.
If you want a broader grounding in how these systems are built and costed, AI Engineering by Chip Huyen is a solid read, though the API specifics above are newer than the book.