opendunes
Evaluate and optimise
Copy page ▾

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.

  1. Change the model ID.
  2. Update the request.
  3. Read the answer.
  4. Set the effort.
  5. Compare before you switch.

1. Change the model ID

FromTo
Model IDopenai/gpt-5.2openai/gpt-5.4
Context400 000 tokens1 050 000 tokens
Longest answer128 000 tokens128 000 tokens
Effort levelsnone · low · medium · high · xhighthe same five

Both list the same fields in supported_parameters. GPT-5.4 comes as five IDs.

Model IDForContext
openai/gpt-5.4general work: reasoning, knowledge, code, agents1 050 000 tokens
openai/gpt-5.4-prohard problems, with more reasoning; always reasons, at medium, high or xhigh1 050 000 tokens
openai/gpt-5.4-minihigh-volume coding and agent work400 000 tokens
openai/gpt-5.4-nanospeed and volume first400 000 tokens
openai/gpt-5.4-image-2text and pictures in one answer272 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.

JSON
{
  "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 todayOn GPT-5.4Send instead
temperature or top_pnot in any GPT-5.4 ID's supported_parameters; OpenAI takes them at effort none onlynothing: steer with the prompt
a model from before GPT-5.2—OpenAI's pairing, in the table below
Moving fromOpenAI's advice
GPT-5.2openai/gpt-5.4 at its default settings
o3openai/gpt-5.4 at effort medium, then high if answers fall short
GPT-4.1openai/gpt-5.4 at effort none, then higher if needed
o4-mini or GPT-4.1 miniopenai/gpt-5.4-mini
GPT-4.1 nanoopenai/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.

JSON
{
  "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

RouteField
/v1/chat/completionsreasoning.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.

Good to know

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.

CompareWhere
the answersyour own check: a test suite, a reviewer, the task's pass rate
what each costusage.cost, in DADAThe Algerian dinar, the one currency the docs show.More on Balance and charges →, on every answer
how much each reasonedusage.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.

RunModel
fromMODEL
generalthe general tier of TIERS
minithe mini tier
nanothe 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.

TierModel ID
generalopenai/gpt-5.4
miniopenai/gpt-5.4-mini
nanoopenai/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