opendunes
Evaluate and optimise
Copy page ▾

Sonnet 5

Move an app from Claude Sonnet 4.6 to Claude Sonnet 5: the model IDModel IDThe name a request calls a model by, lab/model, copied from Models.More on Models → changes, three sampling fields go, and reasoning turns on by default.

  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 IDanthropic/claude-sonnet-4.6anthropic/claude-sonnet-5
Context1 000 000 tokens1 000 000 tokens
Longest answer128 000 tokens128 000 tokens
Reasoningoff unless you askon unless you turn it off: default_enabled is true
Effort levelslow · medium · high · maxlow · medium · high · xhigh · max
supported_parametersholds temperature, top_p, top_kholds none of the three

GET /v1/model/{lab}/{model} answers each model's entry: its context, its longest answer, its fields, its reasoning. The request keeps its shape; model changes.

JSON
{
  "model": "anthropic/claude-sonnet-5",
  "reasoning": {
    "effort": "high"
  },
  "messages": [
    {
      "role": "user",
      "content": "Write the product page for a wool burnous."
    }
  ]
}

2. Update the request

You send todayOn Sonnet 5Send instead
temperature, top_p or top_knot taken; Anthropic refuses any value but the defaultnothing: steer with the prompt
a thinking budget: reasoning.max_tokens or thinking.budget_tokensnot honoured: reasoning is adaptive onlyan effort level
no reasoning settingthe model reasonsnothing, or reasoning turned off, as below

To keep Sonnet 4.6's behaviour, turn reasoning off in the request.

RouteReasoning off
/v1/chat/completionsreasoning: {"enabled": false}
/v1/messagesthinking: {"type": "disabled"}
Don't

Keep temperature: 0 to make answers repeat. Sonnet 5 does not take it.

Do

Ask for a fixed shape with Structured outputs, and state in the prompt what must not vary.

3. Read the answer

With reasoning on, every answer carries it, and the reasoning shares the ceiling with the reply.

RouteWhere the reasoning landsChange
/v1/chat/completionschoices[0].message.reasoning, counted in usage.completion_tokens_details.reasoning_tokensraise max_tokens: too low a ceiling ends with no text
/v1/messagesthinking blocks, ahead of the text blockread blocks by type, never content[0]; send thinking blocks back unchanged with tool results

Sonnet 5 counts text differently: Anthropic puts the same text at about 30 % more tokens than on Sonnet 4.6. Recount what your prompts hold, and check your max_tokens. Both routes: Chat · Messages.

4. Set the effort

RouteField
/v1/chat/completionsreasoning.effort, or reasoning_effort
/v1/messagesoutput_config.effort

Anthropic gives high as the default. xhigh is new, between high and max, for the hardest coding and agent work. Set the level in every request: lower it where answers hold.

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

The script sends each prompt three ways and prints one line per run: how the answer ended, what the prompt counted, what the model reasoned, and the charge in DA, then the first words of the answer.

RunModelReasoning
old, offMODELoff
new, offCANDIDATEoff
new, onCANDIDATEon, at effort high
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"
CANDIDATE = "anthropic/claude-sonnet-4.5"
MAX_TOKENS = 4000
PROMPTS = [
    "Write the product page for a wool burnous.",
    "A customer in Oran asks why her parcel is late. Answer her.",
]
OFF = {"reasoning": {"enabled": False}}
ON = {"reasoning": {"enabled": True, "effort": "high"}}
RUNS = [
    ("old, off", MODEL, OFF),
    ("new, off", CANDIDATE, OFF),
    ("new, on", CANDIDATE, ON),
]

client = OpenAI(base_url=BASE_URL, api_key=API_KEY)

for prompt in PROMPTS:
    print(prompt)
    for label, model, fields in RUNS:
        reply = client.chat.completions.create(
            model=model,
            max_tokens=MAX_TOKENS,
            messages=[{"role": "user", "content": prompt}],
            extra_body=fields,
        )
        usage = reply.usage
        details = usage.completion_tokens_details
        thought = details.reasoning_tokens if details else 0
        print(
            f"{label:9} {reply.choices[0].finish_reason:7}",
            f"in {usage.prompt_tokens}",
            f"thought {thought}",
            f"cost {usage.cost}",
        )
        print("   ", (reply.choices[0].message.content or "")[:60])

The samples put anthropic/claude-sonnet-4.5 in both seats, so they run as they stand. Set MODEL to anthropic/claude-sonnet-4.6 and CANDIDATE to anthropic/claude-sonnet-5.

Read the first two lines against each other: the only difference is the model, and in is the recount. The third line is what reasoning adds, in thought and in the charge.

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