Context Window and Maximum Output Limits for GPT-5.4 Models

Published
Checked
Sources
6 listed
In short
3 key points
By
DevDiffs
Title card: Context Window and Maximum Output Limits for GPT-5.4 Models

A context window and a maximum output are separate limits. GPT-5.4 has a 1,050,000 token context window and a maximum output of 128,000 tokens. Most current Claude models have a 1 million token window and can generate up to 128,000 output tokens per request.

In short3 key points

Key points

  • Treat maximum output as a separate limit: a large context window does not mean a large response, and GPT-5.4 outputs up to 128,000 tokens.
  • Count everything toward Claude's window, including system prompt, tool definitions, images and thinking tokens, since cached input still occupies the window.
  • Expect GPT-5.4 prompts over 272K input tokens to be billed at 2x input and 1.5x output for the full session.

Full article: about 3 minutes

What each limit covers

Maximum output is a separate cap from the context window. A Claude model with a 1 million token window can still return only 128,000 tokens in one response.

On Claude, everything in the request counts toward the window. That includes the system prompt, every message, tool results, images, documents and tool definitions.

A secondary guide from Coursiv reports that Anthropic’s documentation describes accuracy and recall falling as token count grows. It calls this effect context rot.

Input and output share the window

On Claude, the model’s own output counts too, including extended thinking tokens.

Cached input still uses window space. Caching changes the price of input but not how much of the window it occupies.

The Claude input count is reported as input_tokens, cache_read_input_tokens and cache_creation_input_tokens. All three count toward the window.

A community answer on the OpenAI Developer Community says the OpenAI context window includes all input, output and control tokens. This is a forum reply, not official documentation.

A forum poster reports that max output tokens are shared between the user prompt and the bot response. The sources do not confirm this.

Reasoning and thinking tokens

On Claude, thinking tokens are part of max_tokens. They bill as output and count toward the window on the turn they are generated.

Thinking cannot be turned off on Opus 5.5. Sending thinking disabled, or enabled with budget_tokens, returns a 400 error.

For GPT-5.4, reasoning effort can be set to none (the default), low, medium, high or xhigh.

The sources do not say whether GPT-5.4 reasoning tokens count toward its 128,000 output limit.

Current limits by model

The table lists the limits stated in the sources. The Claude rows come from secondary sites, not from Anthropic’s own documentation.

Model Context window (tokens) Max output tokens
GPT-5.4 1,050,000 128,000
Claude Opus 5.5, Opus 5, Opus 4.8, Sonnet 5 and Fable 5.1 1 million 128K
Claude Haiku 4.5 200,000 64K
Claude Sonnet 4.5 200,000 The sources do not give this value.

On the Message Batches API, selected Claude models can return up to 300K output tokens. This needs the output-300k-2026-03-24 beta header.

Long-context pricing and access

For GPT-5.4 and GPT-5.4 Pro, prompts with more than 272K input tokens are billed at 2x the input rate and 1.5x the output rate for the full session.

Data residency endpoints for GPT-5.4 and GPT-5.4 Pro carry a 10% uplift on regional processing.

Claude’s 1M window does not need a beta header, and every 1M model bills at standard per-token rates.

The sources do not cover limits for Google, Mistral or Meta-hosted models.

The sources do not compare API limits with the limits in the apps.

What happens when you exceed a limit

On Claude 4.5 and newer models, the API accepts a request where input plus max_tokens is larger than the window. Generation then stops at the limit and reports the stop reason model_context_window_exceeded.

If the input alone is longer than the window, the Claude API returns a 400 invalid_request_error on every model. The error message reads prompt is too long.

The sources do not describe how the OpenAI API behaves when GPT-5.4 limits are exceeded.

Checking limits in code

The Claude Models API returns max_input_tokens and max_tokens for every model. You can read the limits in code instead of hardcoding them.

OpenAI models are available through the Responses API and the OpenAI Client SDKs.

The sources do not give a method for reading OpenAI model limits in code.

Conflicting older OpenAI figures

Community posts give conflicting maximum output figures for OpenAI models. One post gives 4096 for the new models, and another gives 16386.

The sources do not confirm either figure.

Sources

  1. What does "CONTEXT WINDOW" mean in the documentation OpenAI Developer Community. Accessed November 26, 2026.
  2. Models | OpenAI API OpenAI, primary source. Accessed November 26, 2026.
  3. What is the maximum response length (output tokens) for each GPT model? OpenAI Developer Community. Accessed November 26, 2026.
  4. GPT-5.4 Model | OpenAI API OpenAI, primary source. Accessed November 26, 2026.
  5. Claude Context Window: Size, What Counts Toward It, and How to Manage It Coursiv. Accessed November 26, 2026.
  6. Claude Context Window Size (2026): 1M Tokens on Opus 5.5, Opus 5, Opus 4.8 & Sonnet 5 | Morph Morph (morphllm.com). Accessed November 26, 2026.