opendunes
Evaluate and optimise
Copy page ▾

Claude 4.7

Move an app from Claude Opus 4.6 to Claude Opus 4.7: the model IDModel IDThe name a request calls a model by, lab/model, copied from Models.More on Models → changes, three sampling fields and the thinking budget go.

  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

Claude 4.7 is one model, Opus. For Sonnet, see Sonnet 5.

FromTo
Model IDanthropic/claude-opus-4.6anthropic/claude-opus-4.7
Context1 000 000 tokens1 000 000 tokens
Longest answer128 000 tokens128 000 tokens
Reasoningoff unless you askoff unless you ask
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-opus-4.7",
  "reasoning": {
    "enabled": true,
    "effort": "xhigh"
  },
  "max_tokens": 64000,
  "messages": [
    {
      "role": "user",
      "content": "Refactor the payment module and list what changed."
    }
  ]
}

2. Update the request

You send todayOn Opus 4.7Send 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 onlyreasoning on, with an effort level
RouteReasoning on, adaptive
/v1/chat/completionsreasoning: {"enabled": true, "effort": "high"}
/v1/messagesthinking: {"type": "adaptive"} and output_config.effort
Don't

Keep temperature: 0 to make answers repeat. Opus 4.7 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

Anthropic lists four changes in what comes back.

ChangeWhat to do
a new tokenizer: the same text counts up to about 35 % more tokensrecount what your prompts hold, and check max_tokens
on /v1/messages, thinking blocks come back with their text left out unless you asksend thinking.display: "summarized" where you show the reasoning
pictures read up to 2 576 pixels on the long side, where 1 568 was the limitshrink pictures that need no more detail: a larger one counts more tokens
requests on some security topics can be refusedtreat a refusal as an answer, not a failure to retry: see Errors and retries

Opus 4.7 also writes progress notes during long agent runs on its own. Remove any prompt line that forces them. 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, and advises xhigh as the start for coding and agent work, high for most other work. xhigh is new, between high and max.

Good to know

At xhigh or max, Anthropic's advice is a max_tokens of 64 000 to start: the reasoning and the reply both fit.

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 to both IDs at one 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. After each pair it prints the recount: the new ID's prompt tokens over the old one's. Prose, French and code are counted differently, so the three prompts are of the three kinds.

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"
EFFORT = "high"
MAX_TOKENS = 16000
PROMPTS = [
    "Explain in three lines why a parcel can be late on its way to Oran.",
    "Le burnous existe en quelle taille, et en quelle couleur ?",
    "Explain this function:\n"
    "def total(items):\n"
    "    return sum(item.price * item.count for item in items)",
]
RUNS = [("old", MODEL), ("new", CANDIDATE)]
FIELDS = {"reasoning": {"enabled": True, "effort": EFFORT}}

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

for prompt in PROMPTS:
    print(prompt.splitlines()[0])
    counted = {}
    for label, model in RUNS:
        reply = client.chat.completions.create(
            model=model,
            max_tokens=MAX_TOKENS,
            messages=[{"role": "user", "content": prompt}],
            extra_body=FIELDS,
        )
        usage = reply.usage
        counted[label] = usage.prompt_tokens
        details = usage.completion_tokens_details
        thought = details.reasoning_tokens if details else 0
        print(
            f"{label:4} {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])
    print("prompt tokens, new over old:", counted["new"] / counted["old"])

The samples put anthropic/claude-sonnet-4.5 in both seats, so they run as they stand, and the recount reads 1. Set MODEL to anthropic/claude-opus-4.6 and CANDIDATE to anthropic/claude-opus-4.7.

Apply the recount to your own prompts: where it passes 1, raise max_tokens by the same share, and check what a long prompt now counts against the context.

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