GPT-5.4 Migration Guide
Support the phase field for GPT-5.3 Codex, GPT-5.4, and GPT-5.4 Pro
What’s New
GPT-5.4, GPT-5.4 Pro, and GPT-5.3 Codex introduce the
phase field on
assistant messages. This field is critical for multi-turn
agentic workflows — it tells the model whether an assistant
message is intermediate commentary or the final answer.
OpenRouter supports phase in the
Responses API.
phase is not available in the Chat Completions API.
The Chat Completions format cannot represent multiple
output items with distinct phases in a single response.
Use the Responses API for full phase support.
The phase Field
phase appears on assistant output messages and has three
possible values:
phase is only valid on assistant messages.
Do not add phase to user or system messages.
Why It Matters
For models like gpt-5.3-codex, gpt-5.4, and
gpt-5.4-pro, correctly
preserving phase on assistant messages is required
for optimal performance. If phase metadata is dropped
when reconstructing conversation history, significant
performance degradation can occur — including early
stopping on longer-running tasks.
Usage
Responses API
When using the Responses API, assistant output items
include phase. You must persist these items verbatim
and pass them back in subsequent requests.
The response will include phase on assistant output
messages:
For follow-up requests, include the assistant output
items with their phase intact:
Chat Completions API
The Chat Completions API does not support phase in
responses. A single chat completion response can only
contain one message per choice, so there is no way to
represent the separate commentary and final answer output
items that models like GPT-5.4 produce.
If you need phase support for multi-turn agentic
workflows, use the
Responses API
instead.
Implementation Pattern
When building an integration with the Responses API,
persist your output items verbatim, including phase
on assistant messages:
Key Rules
- Preserve phase on assistant messages — When you
receive a response with
phase, store it and send it back on subsequent requests. - Do not add phase to user messages —
phaseis only valid on assistant messages. The Responses API will reject requests withphaseon user messages. - Do not drop phase — Omitting
phasefrom assistant messages in multi-turn conversations will degrade model performance. - Use the Responses API —
phaserequires the Responses API. The Chat Completions API cannot represent multi-phase output.
Supported Models
Passing phase to OpenAI models that don’t support it
(like gpt-4o) is safe — OpenAI silently ignores the
field. You do not need to filter phase based on the
model.
Breaking Changes
None. The phase field is additive:
- Existing requests without
phasecontinue to work on all models - Models that don’t support
phasesilently ignore it - No changes are required unless you want to take advantage of improved multi-turn performance with GPT-5.3 Codex, GPT-5.4, and GPT-5.4 Pro
Resources
- Prompt Guidance for GPT-5.4 — OpenAI’s official guide covering prompt patterns and migration tips for GPT-5.4, including completeness checks, verification loops, tool persistence, and structured outputs.
- OpenAI Responses API Reference
- Codex CLI Integration Guide
- OpenRouter API Documentation
- OpenRouter Codex Models