Last verified

Tokens & usage AI glossary

What are max output tokens?

Max output tokens is the request setting that caps how many tokens a model may generate in one response — visible text plus any hidden reasoning — and the model-level ceiling that setting cannot exceed.

At a glance

  • How it works: You pass a number with the request; generation stops when the model finishes or when it reaches that number, whichever comes first.
  • Why it matters: It is the only hard ceiling on output spend per request — and set too low, it cuts answers off mid-sentence.
  • What it costs: Nothing by itself: you pay for tokens actually generated, at the output rate, not for the size of the cap.
  • Related to: Output tokens, reasoning tokens, context window, rate limits.

Two limits with one name

"Max output" means two things. The model's limit is fixed by the vendor: Anthropic documents that a single request to any of its one-million-token Claude models can generate up to 128,000 output tokens. The request parameter is yours: a number at or below the model's limit that caps this particular response. Each model page in our price index lists the vendor's published limit where there is one.

The parameter's name varies. OpenAI's Chat Completions uses max_completion_tokens and its Responses API max_output_tokens; Anthropic uses max_tokens; Gemini uses max_output_tokens. They behave the same way: generation stops at the cap.

Reasoning shares the cap

On reasoning models the cap covers thinking as well as the answer. OpenAI's max_output_tokens limits the total the model generates, including reasoning tokens, visible output and formatting tokens; Anthropic's thinking tokens are a subset of max_tokens; Google counts thinking tokens toward max_output_tokens. A cap sized for the visible answer alone can be consumed entirely by thinking.

When that happens the response comes back incomplete — at OpenAI with status incomplete and reason max_output_tokens, possibly before any visible text — and the tokens already generated are still billed. OpenAI recommends reserving at least 25,000 tokens for reasoning and output when starting with its reasoning models.

Setting it sensibly

Use the cap as a guardrail, not a target. Set it comfortably above the longest legitimate answer for the task — a classification needs a few tokens, a code change might need thousands — so that it only fires on runaway generation. Anthropic recommends max_tokens as the tool for a hard ceiling on spend, describing its effort setting as soft guidance by comparison.

A high cap does not cost throughput at Anthropic: its output-tokens-per-minute rate limit counts only tokens actually generated, and Anthropic notes there is no rate-limit downside to a higher max_tokens. The cap also has to fit the context window alongside the prompt; on Claude 4.5 and newer models a request whose input plus cap exceeds the window is accepted and stops if it actually reaches the limit.

Frequently asked.

Short answers to the questions that come up next.

Q · 01 Does a higher max_tokens cost more? +
No. You pay for the tokens the model actually generates. At Anthropic a higher max_tokens does not even count against the output-tokens-per-minute rate limit.
Q · 02 Why did my response stop mid-sentence? +
It reached the output cap. On reasoning models the cap includes hidden thinking, so the visible answer may have had little room left. Raise the cap or lower the reasoning effort.
Q · 03 What is the difference between max_tokens and max_completion_tokens? +
Naming. Anthropic calls the output cap max_tokens; OpenAI's Chat Completions calls it max_completion_tokens and its Responses API max_output_tokens.