Claude 4.6
Move an app from Claude Opus 4.5 or Sonnet 4.5 to Claude 4.6: the model IDModel IDThe name a request calls a model by, lab/model, copied from Models.More on Models → changes, and the model now decides how long it thinks.
- Change the model ID.
- Update the request.
- Read the answer.
- Set the effort.
- Compare before you switch.
1. Change the model ID
| From | To | |
|---|---|---|
| Opus | anthropic/claude-opus-4.5 | anthropic/claude-opus-4.6 |
| Sonnet | anthropic/claude-sonnet-4.5 | anthropic/claude-sonnet-4.6 |
| Context, Opus | 200 000 tokens | 1 000 000 tokens |
| Context, Sonnet | 1 000 000 tokens | 1 000 000 tokens |
| Longest answer | 64 000 tokens | 128 000 tokens |
| Effort levels | none listed | low · medium · high · max |
supported_parameters added | — | reasoning_effort; Opus adds top_p, Sonnet adds verbosity |
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.
{
"model": "anthropic/claude-opus-4.6",
"reasoning": {
"enabled": true,
"effort": "high"
},
"messages": [
{
"role": "user",
"content": "Compare these two supplier quotes and pick one."
}
]
}2. Update the request
| You send today | On Claude 4.6 | Send instead |
|---|---|---|
a last assistant turn that starts the answer for the model | refused | the instruction in the system prompt, or Structured outputs for a fixed shape |
a thinking budget: reasoning.max_tokens or thinking.budget_tokens | still taken; Anthropic marks it deprecated | reasoning on, with an effort level |
| tool arguments read as a raw string | the escaping can differ | read them with a JSON parser |
| Route | Adaptive reasoning |
|---|---|
/v1/chat/completions | reasoning: {"enabled": true}, with reasoning.effort |
/v1/messages | thinking: {"type": "adaptive"}, with output_config.effort |
End the conversation on an assistant turn to force how the answer opens. Claude 4.6 refuses it.
End on a user turn, and say in the system prompt how the answer must open.
3. Read the answer
With adaptive reasoning, the model spends more on a hard question and less on an easy one. The reasoning shares the ceiling with the reply.
| Route | Where the reasoning lands |
|---|---|
/v1/chat/completions | choices[0].message.reasoning, counted in usage.completion_tokens_details.reasoning_tokens |
/v1/messages | thinking blocks, ahead of the text block |
Read blocks by type, never content[0], and send thinking blocks back unchanged with tool results. Both routes: Chat · Messages.
4. Set the effort
Effort is new on Claude 4.6, and max is its top level.
| Route | Field |
|---|---|
/v1/chat/completions | reasoning.effort, or reasoning_effort |
/v1/messages | output_config.effort |
Set the level in every request rather than rely on a default. Start at high; lower it where answers hold, and keep max for work where your checks show a gain.
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 |
The script sends an easy question and a hard one, each to the old ID and then to the new ID at every effort level, 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. Adaptive reasoning shows in thought: more on the hard question, less on the easy one.
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"
EFFORTS = ["low", "medium", "high", "max"]
MAX_TOKENS = 16000
PROMPTS = {
"easy": "What is the capital of Algeria?",
"hard": (
"Three trucks leave Oran for Constantine, which is 430 km "
"away, at 06:00, 07:30 and 09:00, at 60, 72 and 90 km/h. "
"Which arrives first, and when does each arrive?"
),
}
RUNS = [("old", MODEL, {})] + [
(effort, CANDIDATE, {"reasoning": {"enabled": True, "effort": effort}})
for effort in EFFORTS
]
client = OpenAI(base_url=BASE_URL, api_key=API_KEY)
for kind, prompt in PROMPTS.items():
print(kind)
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:7} {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-opus-4.5 and CANDIDATE to anthropic/claude-opus-4.6, or the same pair of Sonnet IDs.
Read thought down each question. Where high and max cost more and the answers hold no better, keep the lower level: Anthropic's advice is to start at high and keep max for work where your checks show a gain.
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