GPT-5.4
Move an app from GPT-5.2 to GPT-5.4: the model IDModel IDThe name a request calls a model by, lab/model, copied from Models.More on Models → changes, and the rest of the request mostly stays.
- Change the model ID.
- Update the request.
- Read the answer.
- Set the effort.
- Compare before you switch.
1. Change the model ID
| From | To | |
|---|---|---|
| Model ID | openai/gpt-5.2 | openai/gpt-5.4 |
| Context | 400 000 tokens | 1 050 000 tokens |
| Longest answer | 128 000 tokens | 128 000 tokens |
| Effort levels | none · low · medium · high · xhigh | the same five |
Both list the same fields in supported_parameters. GPT-5.4 comes as five IDs.
| Model ID | For | Context |
|---|---|---|
openai/gpt-5.4 | general work: reasoning, knowledge, code, agents | 1 050 000 tokens |
openai/gpt-5.4-pro | hard problems, with more reasoning; always reasons, at medium, high or xhigh | 1 050 000 tokens |
openai/gpt-5.4-mini | high-volume coding and agent work | 400 000 tokens |
openai/gpt-5.4-nano | speed and volume first | 400 000 tokens |
openai/gpt-5.4-image-2 | text and pictures in one answer | 272 000 tokens |
Each also exists with :batch at its end, for batch work. GET /v1/model/{lab}/{model} answers each model's entry. The request keeps its shape; model changes.
{
"model": "openai/gpt-5.4",
"reasoning": {
"effort": "medium"
},
"messages": [
{
"role": "user",
"content": "Draft the release notes from this changelog."
}
]
}2. Update the request
| You send today | On GPT-5.4 | Send instead |
|---|---|---|
temperature or top_p | not in any GPT-5.4 ID's supported_parameters; OpenAI takes them at effort none only | nothing: steer with the prompt |
| a model from before GPT-5.2 | — | OpenAI's pairing, in the table below |
| Moving from | OpenAI's advice |
|---|---|
| GPT-5.2 | openai/gpt-5.4 at its default settings |
| o3 | openai/gpt-5.4 at effort medium, then high if answers fall short |
| GPT-4.1 | openai/gpt-5.4 at effort none, then higher if needed |
| o4-mini or GPT-4.1 mini | openai/gpt-5.4-mini |
| GPT-4.1 nano | openai/gpt-5.4-nano |
3. Read the answer
On /v1/chat/completions, the answer keeps its shape: one message, the reasoning counted in usage.completion_tokens_details.reasoning_tokens. See Chat.
On /v1/responses, a long or tool-heavy answer can hold several assistant messages, each with a phase: commentary for a note on the way, final_answer for the answer. Send every one back with its phase unchanged on the next turn. A dropped phase can make the model take a note for its answer and stop early.
{
"model": "openai/gpt-5.4",
"input": [
{
"role": "user",
"content": "Refactor the auth module."
},
{
"type": "message",
"role": "assistant",
"phase": "commentary",
"content": [
{
"type": "output_text",
"text": "I'll start by reading the module."
}
]
},
{
"type": "message",
"role": "assistant",
"phase": "final_answer",
"content": [
{
"type": "output_text",
"text": "Here is the refactored module: …"
}
]
},
{
"role": "user",
"content": "Now add the tests."
}
]
}A phase goes on assistant messages only.
4. Set the effort
| Route | Field |
|---|---|
/v1/chat/completions | reasoning.effort, or reasoning_effort |
OpenAI gives none as GPT-5.4's lowest level and its default. Set the level in every request: from GPT-5.2, keep the level you ran; with no level set, start at none and raise it where answers fall short.
At effort none, ask the model in the prompt to outline its steps before it answers. OpenAI advises it for better reasoning.
5. Compare before you switch
Send the same set of real prompts to both IDs, and compare three things.
| Compare | Where |
|---|---|
| the answers | your own check: a test suite, a reviewer, the task's pass rate |
| what each cost | usage.cost, in DADAThe Algerian dinar, the one currency the docs show.More on Balance and charges →, on every answer |
| how much each reasoned | usage.completion_tokens_details.reasoning_tokens |
GPT-5.4 comes as tiers, so the comparison is a sweep: the same prompts to the old ID and to each tier, at one effort level. The script prints one line per run: how the answer ended, what the model reasoned, and the charge in DA, then the first words of the answer. At the end it prints what each tier cost over all the prompts.
| Run | Model |
|---|---|
from | MODEL |
general | the general tier of TIERS |
mini | the mini tier |
nano | the nano tier |
import os
from openai import OpenAI
API_KEY = os.environ["OPENDUNES_API_KEY"]
BASE_URL = "https://opendunes.com/v1"
MODEL = "anthropic/claude-sonnet-4.5"
TIERS = {
"general": "anthropic/claude-sonnet-4.5",
"mini": "anthropic/claude-sonnet-4.5",
"nano": "anthropic/claude-sonnet-4.5",
}
EFFORT = "medium"
MAX_TOKENS = 4000
PROMPTS = [
"Draft the release notes from this changelog:\n"
"- orders export fixed\n- delivery slots added",
"Is this message an order, a complaint or something else? "
"Answer in one word.\n'My parcel never came.'",
]
RUNS = [("from", MODEL), *TIERS.items()]
client = OpenAI(base_url=BASE_URL, api_key=API_KEY)
totals = {label: 0.0 for label, _ in RUNS}
for prompt in PROMPTS:
print(prompt.splitlines()[0])
for label, model in RUNS:
reply = client.chat.completions.create(
model=model,
max_tokens=MAX_TOKENS,
messages=[{"role": "user", "content": prompt}],
extra_body={"reasoning": {"effort": EFFORT}},
)
usage = reply.usage
details = usage.completion_tokens_details
thought = details.reasoning_tokens if details else 0
totals[label] += usage.cost
print(
f"{label:8} {reply.choices[0].finish_reason:7}",
f"thought {thought}",
f"cost {usage.cost}",
)
print(" ", (reply.choices[0].message.content or "")[:60])
print(totals)The samples put anthropic/claude-sonnet-4.5 in every seat, so they run as they stand. Set MODEL to openai/gpt-5.2, and the three tiers to the IDs below.
| Tier | Model ID |
|---|---|
general | openai/gpt-5.4 |
mini | openai/gpt-5.4-mini |
nano | openai/gpt-5.4-nano |
Read the totals against your own check on the answers: the cheapest tier whose answers hold is the one to switch to. The one-word classification is the work nano is for, where speed and volume come first.
Switch once the new ID holds; going back is the same one-line change. Run your red-team suite on the new ID too: Red teaming.
Last modified on