Long-running GPT-5.4 tool agents should prefer the Responses API, explicitly preserve phase, lazily load large tool definitions with tool search, and set reasoning/verbosity according to the task shape rather than stuffing the full MCP schema into every request.
Suitable tasks: Agents with many functions/MCP tools, computer use, long-context codebases, and cross-tool professional workflows.
Unsuitable tasks: A short answer that only requires one tool but enables a 1M-token context or the full set of tool definitions; high-risk UI operations are also unsuitable for unattended execution.
Applicable model versions: gpt-5.4, snapshot gpt-5.4-2026-03-05.
Applicable clients, agents, or APIs: Responses API, Codex; the model page lists support for web/file search, code interpreter, computer use, MCP, tool search, apply patch, hosted shell, and more.
Recommended reasoning level and parameters: The default is reasoning.effort="none"; start research or multi-step tasks at medium, and use high for complex agents; text.verbosity defaults to medium and should be set to low/medium/high according to the deliverable.
from openai import OpenAI
client = OpenAI()
response = client.responses.create(
model="gpt-5.4",
input="Complete <task>. First state the goal and acceptance criteria, then execute and verify.",
reasoning={"effort": "medium"},
text={"verbosity": "medium"},
)
print(response.output_text)const response = await client.responses.create({
model: "gpt-5.4",
input: [
{
role: "assistant",
phase: "commentary",
content: "I’ll check the logs first, then summarize the root cause and the fix.",
},
{
role: "assistant",
phase: "final_answer",
content: "Root cause: a cache-invalidation race condition.",
},
{ role: "user", content: "Now provide a fix plan that can be safely deployed." },
],
});{
"tool_choice": {
"type": "allowed_tools",
"mode": "auto",
"tools": [
{ "type": "function", "name": "get_weather" },
{ "type": "function", "name": "search_docs" }
]
}
}Integrate the specific hosted/client-executed schema for tool search according to the official tool search documentation; this note retains only the core strategy and does not guess at the complete schema.
First fix the snapshot, reasoning, verbosity, and max_output_tokens in the Responses API.
Register all tools as a searchable collection and load the complete definition only after a tool is selected; for security-sensitive tools, use allowed_tools to restrict the current turn.
When running a long task, mark intermediate updates with phase="commentary" and the final deliverable with phase="final_answer"; when replaying assistant history, preserve the original phase and do not add a phase to user messages.
When using previous_response_id, preferably let the API retain the preceding state; when replaying manually, preserve the complete assistant state and phase.
For inputs over 272K tokens, separately record long-context pricing/limits and use compaction after milestones; test information retrieval with Graphwalks/business long documents rather than looking only at the window size.
Model page: GPT-5.4 has a context window of 1,050,000, a maximum output of 128,000, and reasoning levels none/low/medium/high/xhigh; standard pricing is $2.50 per million input tokens, $0.25 for cached input, and $15 for output.
For inputs over 272K, the model page states that standard/batch/flex pricing is calculated at 2× input and 1.5× output for the entire session; regional processing has an additional 10% uplift.
On the MCP Atlas 250-task average across 36 MCP servers, the official launch page reports that tool search reduced total token usage by 47% while maintaining comparable accuracy.
Official guidance requires long-running/tool-intensive workflows to explicitly preserve phase; omitting or discarding it may cause the preamble to be treated as the final answer.
The model supports text/image input and text output; audio/video are not supported. The Responses tool list supports web search, file search, image generation, code interpreter, computer use, MCP, and tool search.
1M is a context limit, not a guarantee of constant recall at the 1M position; official Graphwalks results already show declining accuracy in the ultra-long range, so business-specific long-context evaluations should be run.
Tool search reduces tool-definition tokens but does not guarantee correct tool selection; tool descriptions, allowed lists, and server-side validation still need to be designed.
phase is a long-running Responses runtime contract, not a regular Chat Completions field; during migration, copying only the prompt is insufficient.
temperature/top_p/logprobs are incompatible with GPT-5.4 reasoning when it is not none; use reasoning, verbosity, and max_output_tokens to adjust behavior.
OpenAI describes tool search as “deferred tool loading” and recommends explicitly using phase in long-running workflows; together, they address an overly broad tool surface and the accidental termination of intermediate messages.
GPT-5.4