# Claude 4.6

Move an app from Claude Opus 4.5 or Sonnet 4.5 to Claude 4.6: the model ID changes, and the model now decides how long it thinks.

1. [Change the model ID](#1-change-the-model-id).
2. [Update the request](#2-update-the-request).
3. [Read the answer](#3-read-the-answer).
4. [Set the effort](#4-set-the-effort).
5. [Compare before you switch](#5-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}`](/docs/reference/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-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](/docs/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` |

<div class="dont">
<p>End the conversation on an <code>assistant</code> turn to force how the answer opens. Claude 4.6 refuses it.</p>
</div>

<div class="do">
<p>End on a <code>user</code> turn, and say in the system prompt how the answer must open.</p>
</div>

## 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](/docs/reference/chat-completions) · [Messages](/docs/reference/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 DA, 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.

```python
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])
```

```javascript
import OpenAI from "openai";

const API_KEY = process.env.OPENDUNES_API_KEY;
const BASE_URL = "https://opendunes.com/v1";
const MODEL = "anthropic/claude-sonnet-4.5";
const CANDIDATE = "anthropic/claude-sonnet-4.5";
const EFFORTS = ["low", "medium", "high", "max"];
const MAX_TOKENS = 16000;
const 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?",
};
const RUNS = [
  ["old", MODEL, {}],
  ...EFFORTS.map((effort) => [
    effort,
    CANDIDATE,
    { reasoning: { enabled: true, effort } },
  ]),
];

const client = new OpenAI({ baseURL: BASE_URL, apiKey: API_KEY });

for (const [kind, prompt] of Object.entries(PROMPTS)) {
  console.log(kind);
  for (const [label, model, fields] of RUNS) {
    const reply = await client.chat.completions.create({
      model,
      max_tokens: MAX_TOKENS,
      messages: [{ role: "user", content: prompt }],
      ...fields,
    });
    const { usage, choices } = reply;
    const thought = usage.completion_tokens_details?.reasoning_tokens ?? 0;
    console.log(
      label.padEnd(7),
      choices[0].finish_reason.padEnd(7),
      `in ${usage.prompt_tokens}`,
      `thought ${thought}`,
      `cost ${usage.cost}`,
    );
    console.log("   ", (choices[0].message.content ?? "").slice(0, 60));
  }
}
```

```go
package main

import (
	"context"
	"fmt"
	"os"
	"strconv"

	"github.com/openai/openai-go/v3"
	"github.com/openai/openai-go/v3/option"
)

const (
	baseURL   = "https://opendunes.com/v1"
	model     = "anthropic/claude-sonnet-4.5"
	candidate = "anthropic/claude-sonnet-4.5"
	maxTokens = 16000
)

type run struct {
	label  string
	model  string
	fields map[string]any
}

func main() {
	apiKey := os.Getenv("OPENDUNES_API_KEY")

	efforts := []string{"low", "medium", "high", "max"}
	prompts := [][2]string{
		{"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 := []run{{"old", model, map[string]any{}}}
	for _, effort := range efforts {
		fields := map[string]any{
			"reasoning": map[string]any{"enabled": true, "effort": effort},
		}
		runs = append(runs, run{effort, candidate, fields})
	}

	client := openai.NewClient(
		option.WithBaseURL(baseURL),
		option.WithAPIKey(apiKey),
	)
	for _, prompt := range prompts {
		fmt.Println(prompt[0])
		for _, r := range runs {
			params := openai.ChatCompletionNewParams{
				Model:     openai.ChatModel(r.model),
				MaxTokens: openai.Int(maxTokens),
				Messages: []openai.ChatCompletionMessageParamUnion{
					openai.UserMessage(prompt[1]),
				},
			}
			params.SetExtraFields(r.fields)
			reply, err := client.Chat.Completions.New(
				context.TODO(), params)
			if err != nil {
				panic(err)
			}
			choice := reply.Choices[0]
			usage := reply.Usage
			fmt.Printf("%-7s %-7s in %d thought %d cost %v\n",
				r.label, choice.FinishReason, usage.PromptTokens,
				usage.CompletionTokensDetails.ReasoningTokens,
				charge(reply))
			fmt.Printf("    %.60s\n", choice.Message.Content)
		}
	}
}

func charge(reply *openai.ChatCompletion) float64 {
	cost := reply.Usage.JSON.ExtraFields["cost"].Raw()
	value, _ := strconv.ParseFloat(cost, 64)
	return value
}
```

```bash cURL
ADDRESS="https://opendunes.com/v1/chat/completions"
MODEL="anthropic/claude-sonnet-4.5"
CANDIDATE="anthropic/claude-sonnet-4.5"
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?"

run() {
  jq -n --arg model "$2" --arg prompt "$PROMPT" --argjson fields "$3" \
    '{model: $model, max_tokens: 16000,
      messages: [{role: "user", content: $prompt}]} + $fields' |
    curl -s "$ADDRESS" \
      -H "Authorization: Bearer $OPENDUNES_API_KEY" \
      -H "Content-Type: application/json" \
      -d @- |
    jq -c --arg label "$1" '{label: $label,
      finish: .choices[0].finish_reason,
      in: .usage.prompt_tokens,
      thought: .usage.completion_tokens_details.reasoning_tokens,
      cost: .usage.cost,
      answer: ((.choices[0].message.content // "") | .[:60])}'
}

for PROMPT in "$EASY" "$HARD"; do
  echo "$PROMPT"
  run "old" "$MODEL" '{}'
  for EFFORT in low medium high max; do
    run "$EFFORT" "$CANDIDATE" \
      '{"reasoning": {"enabled": true, "effort": "'"$EFFORT"'"}}'
  done
done
```

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](/docs/cookbook/red-teaming).
