# Move to Opus 5.5

Move an app from Claude Opus 5 to Claude Opus 5.5: the model ID changes, and three settings with it.

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 |
|---|---|---|
| Model ID | `anthropic/claude-opus-5` | `anthropic/claude-opus-5.5` |
| Context | 1 000 000 tokens | 1 000 000 tokens |
| Longest answer | 128 000 tokens | 128 000 tokens |
| Reasoning | on unless you turn it off | always on: `reasoning.mandatory` is `true` |
| Effort levels | `low` · `medium` · `high` · `xhigh` · `max` | the same five |
| A forced tool call | taken | refused |

[`GET /v1/model/{lab}/{model}`](/docs/reference/model) answers each model's entry: its context, its longest answer, its `reasoning`. The request keeps its shape; `model` changes.

```json
{
  "model": "anthropic/claude-opus-5.5",
  "reasoning": {
    "effort": "medium"
  },
  "messages": [
    {
      "role": "user",
      "content": "Find the bug in this function and propose a fix."
    }
  ]
}
```

## 2. Update the request

| You send today | On Opus 5.5 | Send instead |
|---|---|---|
| `reasoning: {"enabled": false}`, effort `none`, or `thinking: {"type": "disabled"}` | refused: reasoning cannot be turned off | a lower effort |
| a thinking budget: `reasoning.max_tokens` or `thinking.budget_tokens` | not honoured | an effort level |
| `tool_choice` set to `required` or to one tool by name; `any` or `tool` on `/v1/messages` | refused | `auto`, with the prompt naming the tool to use |

`auto` lets the model decide, so check that a call came back and ask again if not: see [Tools and function calling](/docs/tools). Where a forced call only served to get JSON back, ask for it with [Structured outputs](/docs/structured-outputs).

<div class="dont">
<p>Edit an earlier turn, the system prompt or the tool list mid-conversation. Opus 5.5 ties each block of reasoning to the conversation before it, and an edit breaks the tie.</p>
</div>

<div class="do">
<p>Add to the conversation instead: a new instruction goes in a new message after the last one.</p>
</div>

## 3. Read the answer

Every answer now carries reasoning, and the reasoning shares the ceiling with the reply.

| Route | Where the reasoning lands | Change |
|---|---|---|
| `/v1/chat/completions` | `choices[0].message.reasoning`, counted in `usage.completion_tokens_details.reasoning_tokens` | raise `max_tokens`: too low a ceiling ends with no text |
| `/v1/messages` | `thinking` blocks, ahead of the `text` block | read blocks by `type`, never `content[0]`; send `thinking` blocks back unchanged with tool results |

Between tool calls, Opus 5.5 writes its progress notes into `thinking` blocks, where Opus 5 wrote them as text. On `/v1/messages`, `thinking.display` picks what those blocks hold: `summarized` for a summary of the reasoning, `omitted` for nothing.

```json
{
  "model": "anthropic/claude-opus-5.5",
  "max_tokens": 64000,
  "thinking": {
    "type": "adaptive",
    "display": "summarized"
  },
  "output_config": {
    "effort": "medium"
  },
  "messages": [
    {
      "role": "user",
      "content": "Review the open changes to the billing module."
    }
  ]
}
```

Both routes: [Chat](/docs/reference/chat-completions) · [Messages](/docs/reference/messages).

## 4. Set the effort

Effort is the one control left over how long Opus 5.5 thinks, and so over what an answer costs.

| Route | Field |
|---|---|
| `/v1/chat/completions` | `reasoning.effort`, or `reasoning_effort` |
| `/v1/messages` | `output_config.effort` |

Anthropic gives `medium` as Opus 5.5's default, one level under Opus 5's `high`. Set the level in every request rather than carry over the one Opus 5 ran at: start at `medium`, lower it where answers hold, raise it where they fall short.

<div class="good-to-know">
<p>At <code>xhigh</code> or <code>max</code>, Anthropic's advice is a <code>max_tokens</code> of 64 000 to start: the reasoning and the reply both fit.</p>
</div>

## 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 one task to the old ID, then to the new ID at three effort levels, then to the new ID with reasoning turned off. It 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. A refused request prints its status. Effort is the one control left over what an answer costs, so the three levels are the comparison to read.

```python
import os
from openai import APIStatusError, 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 = ["medium", "high", "xhigh"]
MAX_TOKENS = 64000
TASK = (
    "Find the bug in this function and propose a fix.\n\n"
    "def average(values):\n"
    "    return sum(values) / len(values)"
)
OFF = {"reasoning": {"enabled": False}}
RUNS = (
    [("old", MODEL, {})]
    + [
        (effort, CANDIDATE, {"reasoning": {"effort": effort}})
        for effort in EFFORTS
    ]
    + [("off", CANDIDATE, OFF)]
)

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

for label, model, fields in RUNS:
    try:
        reply = client.chat.completions.create(
            model=model,
            max_tokens=MAX_TOKENS,
            messages=[{"role": "user", "content": TASK}],
            extra_body=fields,
        )
    except APIStatusError as error:
        print(f"{label:7} refused, status {error.status_code}")
        continue
    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"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 = ["medium", "high", "xhigh"];
const MAX_TOKENS = 64000;
const TASK =
  "Find the bug in this function and propose a fix.\n\n" +
  "def average(values):\n" +
  "    return sum(values) / len(values)";
const OFF = { reasoning: { enabled: false } };
const RUNS = [
  ["old", MODEL, {}],
  ...EFFORTS.map((effort) => [
    effort,
    CANDIDATE,
    { reasoning: { effort } },
  ]),
  ["off", CANDIDATE, OFF],
];

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

for (const [label, model, fields] of RUNS) {
  let reply;
  try {
    reply = await client.chat.completions.create({
      model,
      max_tokens: MAX_TOKENS,
      messages: [{ role: "user", content: TASK }],
      ...fields,
    });
  } catch (error) {
    if (!(error instanceof OpenAI.APIError)) throw error;
    console.log(label.padEnd(7), "refused, status", error.status);
    continue;
  }
  const { usage, choices } = reply;
  const thought = usage.completion_tokens_details?.reasoning_tokens ?? 0;
  console.log(
    label.padEnd(7),
    choices[0].finish_reason.padEnd(7),
    `thought ${thought}`,
    `cost ${usage.cost}`,
  );
  console.log("   ", (choices[0].message.content ?? "").slice(0, 60));
}
```

```go
package main

import (
	"context"
	"errors"
	"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 = 64000
	task      = "Find the bug in this function and propose a fix.\n\n" +
		"def average(values):\n" +
		"    return sum(values) / len(values)"
)

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

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

	efforts := []string{"medium", "high", "xhigh"}
	runs := []run{{"old", model, map[string]any{}}}
	for _, effort := range efforts {
		fields := map[string]any{
			"reasoning": map[string]any{"effort": effort},
		}
		runs = append(runs, run{effort, candidate, fields})
	}
	off := map[string]any{"reasoning": map[string]any{"enabled": false}}
	runs = append(runs, run{"off", candidate, off})

	client := openai.NewClient(
		option.WithBaseURL(baseURL),
		option.WithAPIKey(apiKey),
	)
	for _, r := range runs {
		params := openai.ChatCompletionNewParams{
			Model:     openai.ChatModel(r.model),
			MaxTokens: openai.Int(maxTokens),
			Messages: []openai.ChatCompletionMessageParamUnion{
				openai.UserMessage(task),
			},
		}
		params.SetExtraFields(r.fields)
		reply, err := client.Chat.Completions.New(context.TODO(), params)
		var apiErr *openai.Error
		if errors.As(err, &apiErr) {
			fmt.Printf("%-7s refused, status %d\n", r.label, apiErr.StatusCode)
			continue
		}
		if err != nil {
			panic(err)
		}
		choice := reply.Choices[0]
		fmt.Printf("%-7s %-7s thought %d cost %v\n",
			r.label, choice.FinishReason,
			reply.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"
TASK="Find the bug in this function and propose a fix. \
def average(values): return sum(values) / len(values)"
OFF='{"reasoning": {"enabled": false}}'

run() {
  jq -n --arg model "$2" --arg task "$TASK" --argjson fields "$3" \
    '{model: $model, max_tokens: 64000,
      messages: [{role: "user", content: $task}]} + $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,
      thought: .usage.completion_tokens_details.reasoning_tokens,
      cost: .usage.cost,
      answer: ((.choices[0].message.content // "") | .[:60]),
      refused: .error.message}'
}

run "old" "$MODEL" '{}'
for EFFORT in medium high xhigh; do
  run "$EFFORT" "$CANDIDATE" \
    '{"reasoning": {"effort": "'"$EFFORT"'"}}'
done
run "off" "$CANDIDATE" "$OFF"
```

The samples put `anthropic/claude-sonnet-4.5` in both seats, so they run as they stand, and the `off` run is taken. Set `MODEL` to `anthropic/claude-opus-5` and `CANDIDATE` to `anthropic/claude-opus-5.5`: the `off` run is then refused, because reasoning cannot be turned off.

Start at `medium`, Anthropic's default for Opus 5.5, and move up only where `high` or `xhigh` answers better on your own check. `max_tokens` is set to 64 000, Anthropic's advice at `xhigh`, so the reasoning and the reply both fit.

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).
