Replace manual thinking budgets when moving a CometAPI request to Claude Opus 5

If an older Claude request on CometAPI contains thinking: {"type": "enabled", "budget_tokens": ...}, do not carry that object forward unchanged when moving to Claude Opus 5.

Anthropic’s extended-thinking documentation says manual extended thinking is rejected on Claude 4.7 and later. Its migration direction is adaptive thinking: replace the manual budget with thinking: {"type": "adaptive"} and choose output_config.effort separately when you need to express an effort preference. Keep max_tokens as the overall output ceiling; it is still part of the CometAPI Messages request.

A minimal migration shape is:

message = client.messages.create(
    model="claude-opus-5",
    max_tokens=4000,
    thinking={"type": "adaptive"},
    output_config={"effort": "high"},
    messages=[{"role": "user", "content": prompt}],
)

Treat this as a request-shape migration, not a promise of lower cost or latency. Adaptive thinking can skip thinking on simple inputs, so compare representative responses and revise downstream assumptions about reasoning blocks. Also keep the old-model exception in your compatibility layer: Anthropic documents manual thinking for Claude 4.5 and earlier, and says 4.6 requests still succeed although the mode is deprecated. Verify the exact model configuration exposed through CometAPI before deploying the change.

Sources: Anthropic: Extended thinking; CometAPI: Create a Message.