Max output tokens on current models: the cap that cuts your agent off mid-thought
Claude, GPT-6.2, Gemini 4 and DeepSeek all advertise huge context windows, but the output cap is the limit agents actually hit. Here's what each provider allows per response, how thinking eats into it, and how to size the setting.
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
Every model launch leads with the context window. A million tokens is the headline now, and it's true as far as it goes. But an agent rarely dies because it ran out of room to read. It dies because it ran out of room to write. The output cap decides how long one reply can be, and on reasoning models the thinking counts against it too. Set it too low and your agent stops halfway through a tool call. Set it to the max without thinking about it and one bad turn can cost you a few dollars.
This post goes through the output limits on the models agents use most, straight from each provider's docs as of November 30, 2026. Prices match our model price table.
Three numbers, not one
Most spec sheets now give you three limits, and they mean different things. The context window is the total the model can hold in a single request. The max output is the most it will generate in one response. Some providers also list a max input, which is what's left of the window once the output reservation comes out.
OpenAI spells this out best. The GPT-6.2 Astra model page lists a 1,050,000 token context window, a maximum input of 922,000 tokens and 128,000 max output tokens. Do the subtraction and 1,050,000 minus 128,000 is exactly 922,000. The input ceiling is just the window with the output reserve taken out. GPT-6.2 Sol has the same three numbers. So if your agent's history grows to 950,000 tokens, the request doesn't get squeezed to fit. It goes over the input limit.
Google describes it the other way. The Gemini 4 Neon page calls its 1,048,576 tokens a "unified input and output token limit," so input and output share one pool. The more you send, the less room the model has to answer.
What each provider allows per response
Anthropic's models overview lists the same caps for all four current models. Claude Fable 5.2, Opus 5.5, Sonnet 5.5 and Haiku 5.5 each get a 1M token context window and 128K max output. That 128K is the limit for the synchronous Messages API. On the Message Batches API, Opus 5.5, Sonnet 5.5 and Haiku 5.5 (plus a few older models) can go up to 300K output tokens if you send the output-300k-2026-03-24 beta header. Fable 5.2 isn't on that list, so its 128K holds either way.
GPT-6.2 Astra and Sol match Claude at 128,000 output tokens, as covered above.
Gemini 4 is where the defaults bite. The long decode guide says Carbon, Argon, Neon and Hydrogen generate up to 65,536 tokens "of thinking and output per response" by default. You can raise max_output_tokens past that, up to the 1,048,576 window minus your input, but only if you use background execution or let the SDK continue the response for you. Under the hood the long response is split into hops of up to 64K tokens each, or 32K per non-streaming hop on Carbon and Argon. If you're calling REST with automatic continuation off, you have to loop on the continuation_token yourself.
DeepSeek goes biggest on a single reply. Its models and pricing page lists a 1M context length and a maximum output of 384K for both deepseek-flash and deepseek-v4-pro.
xAI's models page lists Grok 4.7 at a 500k context window and prices it, but it doesn't give a separate output cap there. If your agent needs long replies from Grok, test it on your own prompts before you rely on it.
Thinking spends the same budget
This is the part that catches people. On every reasoning model here, the cap covers hidden thinking as well as the text you see.
Anthropic's adaptive thinking docs put it plainly: max_tokens "is a hard cap on total output for the request, thinking and response text combined." They also warn that a value sized for a reply with no thinking "is often too small once Claude starts thinking on hard requests." In a tool loop, each request gets its own max_tokens, so the cap applies per turn, not per task.
OpenAI's reasoning guide describes the bad case. If generation hits the context window or your max_output_tokens, you get a response with status set to incomplete and the reason max_output_tokens. That can happen before any visible text comes out, which means you paid for input and reasoning tokens and got nothing usable back. OpenAI's advice is to reserve at least 25,000 tokens for reasoning and output while you're getting a feel for a model, then adjust once you know how much your prompts actually use.
Google says the same thing in its own words. The long decode troubleshooting table lists "status incomplete with empty text" with the cause "the model used all tokens on thinking." The guide also tells you to check the value set in your agent framework or eval tool, because a low default like 8,192 "stops the model before it finishes thinking." Go check yours.
How truncation shows up in your loop
A cut-off reply looks different on each API, and your loop should check for it explicitly. If it doesn't, a truncated turn just looks like a short answer.
On Claude, the stop reasons page lists max_tokens for when the reply hits your limit and model_context_window_exceeded for when it fills the whole window. The docs say the second one "lets you request the maximum possible tokens without knowing the exact input size," and Claude 4.5 and later models can return it without any beta header. The same page warns that if a truncated response ends in an incomplete tool use block, you need to retry with a higher max_tokens to get the full call. Don't try to run a half-written tool call. On OpenAI you check for incomplete status with incomplete_details.reason. On Gemini you watch for incomplete or requires_continuation. We covered the full branching logic in stop reasons in agent loops.
What a maxed-out reply costs
Output is the expensive side of every price sheet, so the cap is also your worst case per turn. At list prices, a reply that uses all 128,000 tokens on Claude Fable 5.2 ($40 per million output) costs $5.12. The same full reply on Claude Haiku 5.5 ($0.50 per million) is about six cents. On GPT-6.2 Sol ($10 per million) it's $1.28. If that request also had more than 272K input tokens, the Sol page says output bills at 1.5 times the short-context rate for the whole request, so it comes to $1.92.
Gemini 4 Carbon matters this week. Its model page lists output at $10 per million through November 30, 2026 and $20 per million starting December 1. A 500,000-token long decode reply is $5 of output today and $10 tomorrow. And the long decode guide says you pay for every token in every hop, including hops that are only thinking, while the repeated input in each hop gets the implicit cache rate of 5% of the normal input price. If you run long decode in an agent, a runaway reply is a real line item. Our output token cost breakdown goes into how to keep replies short.
Sizing the setting
A few habits hold up across all four providers. Don't leave the cap at a framework default. Look it up and set it on purpose for each model. Give reasoning models real headroom: start near OpenAI's 25,000-token floor and tighten it once your logs show what turns actually use. Handle truncation as its own case. Retry with a bigger cap, or ask for a continuation, instead of passing a cut-off reply along as if it were done.
Keep your limits in data, not scattered through code. Anthropic's Models API returns max_input_tokens and max_tokens for every model, so you can read the real limit at startup instead of hardcoding 128K and finding out the hard way when a model changes. For the input side, our post on counting tokens before you send shows how to check a request against the input ceiling before it goes out.
Use the big caps on purpose. A 384K DeepSeek reply or a 1M Gemini long decode is great for a one-off report or a full code migration. It's a bad default for a tool loop that runs fifty turns. Most agent turns are a tool call or a short answer, and a tight cap with good truncation handling will beat a huge cap that hides runaway thinking. If you want to go deeper on running LLM systems in production, AI Engineering by Chip Huyen covers a lot of this.