Migrating to Claude Opus 5 from Claude Sonnet 5
Claude Opus 5 and Claude Sonnet 5 share the same API surface: both run with adaptive thinking on by default, both default the effort parameter to high on the Claude API and Claude Code, both serve a 1M token context window by default with 128k max output tokens, and neither supports Priority Tier. Manual extended thinking and non-default sampling parameters return a 400 error on both models, as does assistant prefill.
Update your model name
model = "claude-sonnet-5" # Before
model = "claude-opus-5" # AfterWhat changed
Pricing: Claude Opus 5 is priced at $5 USD per million input tokens and $25 USD per million output tokens. Claude Sonnet 5 is priced at $2/$10 USD per million input/output tokens. See Claude pricing for complete pricing.
Disabling thinking is capped at
higheffort: On Claude Sonnet 5,thinking: \{type: "disabled"\}is accepted at any effort level. On Claude Opus 5, it is accepted only at an effort level ofhighor below; a request that combinesthinking: \{type: "disabled"\}with effortxhighormaxreturns a 400 error, enforced on each request. Audit requests that disable thinking before you migrate.Mid-conversation system messages: Claude Opus 5 accepts
role: "system"messages immediately after a user turn in themessagesarray (subject to placement rules). This feature is not available on Claude Sonnet 5. If you maintain code paths that rebuild the full message history to update instructions, you can simplify them and preserve prompt cache hits on earlier turns.Web fetch is not available: The web fetch tool is available on Claude Sonnet 5 but not on Claude Opus 5.
Migration checklist
- Update the model name from
claude-sonnet-5toclaude-opus-5. - Audit requests that disable thinking:
thinking: \{type: "disabled"\}with effortxhighormaxreturns a 400 error on Claude Opus 5. Re-enable thinking or lower the effort tohighor below. - If you use web fetch, plan an alternative: it is not available on Claude Opus 5.
- Re-run token counting against Claude Opus 5 rather than reusing counts measured against Claude Sonnet 5, and re-baseline cost and latency on your own workloads; per-token pricing differs.