This guide covers two key migration paths to Claude 4.5 models:
Both migrations involve breaking changes that require updates to your implementation. This guide will walk you through each migration path with step-by-step instructions and clearly marked breaking changes.
Before starting your migration, we recommend reviewing What's new in Claude 4.5 to understand the new features and capabilities available in these models, including extended thinking, context awareness, and behavioral improvements.
Claude Sonnet 4.5 is our most intelligent model, offering best-in-class performance for reasoning, coding, and long-running autonomous agents. This migration includes several breaking changes that require updates to your implementation.
Update your model name:
# Before (Claude Sonnet 3.7)
model="claude-3-7-sonnet-20250219"
# After (Claude Sonnet 4.5)
model="claude-sonnet-4-5-20250929"Update sampling parameters
This is a breaking change from the Claude Sonnet 3.7.
Use only temperature OR top_p, not both:
# Before (Claude Sonnet 3.7) - This will error in Sonnet 4.5
response = client.messages.create(
model="claude-3-7-sonnet-20250219",
temperature=0.7,
top_p=0.9, # Cannot use both
...
)
# After (Claude Sonnet 4.5)
response = client.messages.create(
model="claude-sonnet-4-5-20250929",
temperature=0.7, # Use temperature OR top_p, not both
...
)Handle the new refusal stop reason
Update your application to handle refusal stop reasons:
response = client.messages.create(...)
if response.stop_reason == "refusal":
# Handle refusal appropriately
passUpdate text editor tool (if applicable)
This is a breaking change from the Claude Sonnet 3.7.
Update to text_editor_20250728 (type) and str_replace_based_edit_tool (name). Remove any code using the undo_edit command.
# Before (Claude Sonnet 3.7)
tools=[{"type": "text_editor_20250124", "name": "str_replace_editor"}]
# After (Claude Sonnet 4.5)
tools=[{"type": "text_editor_20250728", "name": "str_replace_based_edit_tool"}]See Text editor tool documentation for details.
Update code execution tool (if applicable)
Upgrade to code_execution_20250825. The legacy version code_execution_20250522 still works but is not recommended. See Code execution tool documentation for migration instructions.
Remove token-efficient tool use beta header
Token-efficient tool use is a beta feature that only works with Claude 3.7 Sonnet. All Claude 4 models have built-in token-efficient tool use, so you should no longer include the beta header.
Remove the token-efficient-tools-2025-02-19 beta header from your requests:
# Before (Claude Sonnet 3.7)
client.messages.create(
model="claude-3-7-sonnet-20250219",
betas=["token-efficient-tools-2025-02-19"], # Remove this
...
)
# After (Claude Sonnet 4.5)
client.messages.create(
model="claude-sonnet-4-5-20250929",
# No token-efficient-tools beta header
...
)Remove extended output beta header
The output-128k-2025-02-19 beta header for extended output is only available in Claude Sonnet 3.7.
Remove this header from your requests:
# Before (Claude Sonnet 3.7)
client.messages.create(
model="claude-3-7-sonnet-20250219",
betas=["output-128k-2025-02-19"], # Remove this
...
)
# After (Claude Sonnet 4.5)
client.messages.create(
model="claude-sonnet-4-5-20250929",
# No output-128k beta header
...
)Update your prompts for behavioral changes
Claude Sonnet 4.5 has a more concise, direct communication style and requires explicit direction. Review Claude 4 prompt engineering best practices for optimization guidance.
Consider enabling extended thinking for complex tasks
Enable extended thinking for significant performance improvements on coding and reasoning tasks (disabled by default):
response = client.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=16000,
thinking={"type": "enabled", "budget_tokens": 10000},
messages=[...]
)Extended thinking impacts prompt caching efficiency.
Test your implementation
Test in a development environment before deploying to production to ensure all breaking changes are properly handled.
claude-sonnet-4-5-20250929temperature OR top_p, not bothrefusal stop reason in your applicationtext_editor_20250728 and str_replace_based_edit_tool (if applicable)undo_edit command (if applicable)code_execution_20250825 (if applicable)token-efficient-tools-2025-02-19 beta header (if applicable)output-128k-2025-02-19 beta header (if applicable)model_context_window_exceeded stop reason (Sonnet 4.5 specific)token-efficient-tools-2025-02-19 beta header only works with Claude 3.7 Sonnet and is not supported in Claude 4 models (see step 6)output-128k-2025-02-19 beta header is not supported (see step 7)Both headers can be included in Claude 4 requests but will have no effect.
Claude Haiku 4.5 is our fastest and most intelligent Haiku model with near-frontier performance, delivering premium model quality with real-time performance for interactive applications and high-volume intelligent processing. This migration includes several breaking changes that require updates to your implementation.
For a complete overview of new capabilities, see What's new in Claude 4.5.
Haiku 4.5 pricing $1 per million input tokens, $5 per million output tokens. See Claude pricing for details.
Update your model name:
# Before (Haiku 3.5)
model="claude-3-5-haiku-20241022"
# After (Haiku 4.5)
model="claude-haiku-4-5-20251001"Update tool versions (if applicable)
This is a breaking change from the Claude Haiku 3.5.
Haiku 4.5 only supports the latest tool versions:
# Before (Haiku 3.5)
tools=[{"type": "text_editor_20250124", "name": "str_replace_editor"}]
# After (Haiku 4.5)
tools=[{"type": "text_editor_20250728", "name": "str_replace_based_edit_tool"}]text_editor_20250728 and str_replace_based_edit_toolcode_execution_20250825undo_edit commandUpdate sampling parameters
This is a breaking change from the Claude Haiku 3.5.
Use only temperature OR top_p, not both:
# Before (Haiku 3.5) - This will error in Haiku 4.5
response = client.messages.create(
model="claude-3-5-haiku-20241022",
temperature=0.7,
top_p=0.9, # Cannot use both
...
)
# After (Haiku 4.5)
response = client.messages.create(
model="claude-haiku-4-5-20251001",
temperature=0.7, # Use temperature OR top_p, not both
...
)Review new rate limits
Haiku 4.5 has separate rate limits from Haiku 3.5. See Rate limits documentation for details.
Handle the new refusal stop reason
Update your application to handle refusal stop reasons.
Consider enabling extended thinking for complex tasks
Enable extended thinking for significant performance improvements on coding and reasoning tasks (disabled by default):
response = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=16000,
thinking={"type": "enabled", "budget_tokens": 5000},
messages=[...]
)Extended thinking impacts efficiency.
Explore new capabilities
See What's new in Claude 4.5 for details on context awareness, increased output capacity (64K tokens), higher intelligence, and improved speed.
Test your implementation
Test in a development environment before deploying to production to ensure all breaking changes are properly handled.
claude-haiku-4-5-20251001text_editor_20250728, code_execution_20250825) - legacy versions not supportedundo_edit command (if applicable)temperature OR top_p, not bothrefusal stop reason in your applicationBoth Claude Sonnet 4.5 and Claude Haiku 4.5 are powerful Claude 4 models with different strengths:
Claude 4 models, particularly Sonnet and Haiku 4.5, show significant performance improvements when using extended thinking for coding and complex reasoning tasks. Extended thinking is disabled by default but we recommend enabling it for demanding work.
Important: Extended thinking impacts prompt caching efficiency. When non-tool-result content is added to a conversation, thinking blocks are stripped from cache, which can increase costs in multi-turn conversations. We recommend enabling thinking when the performance benefits outweigh the caching trade-off.
The primary migration paths covered above (Sonnet 3.7 → 4.5 and Haiku 3.5 → 4.5) represent the most common upgrades. However, you may be migrating from other Claude models to Claude 4.5. This section covers those scenarios.
Breaking change: Cannot specify both temperature and top_p in the same request.
All other API calls will work without modification. Update your model ID and adjust sampling parameters if needed:
# Before (Claude Sonnet 4)
model="claude-sonnet-4-20250514"
# After (Claude Sonnet 4.5)
model="claude-sonnet-4-5-20250929"No breaking changes. All API calls will work without modification.
Simply update your model ID:
# Before (Claude Opus 4.1)
model="claude-opus-4-1-20250805"
# After (Claude Sonnet 4.5)
model="claude-sonnet-4-5-20250929"Claude Sonnet 4.5 is our most intelligent model with best-in-class reasoning, coding, and long-running agent capabilities. It offers superior performance compared to Opus 4.1 for most use cases.
No breaking changes. All API calls will work without modification.
Simply update your model ID:
# Before (Claude Opus 4.1)
model="claude-opus-4-1-20250805"
# After (Claude Opus 4.5)
model="claude-opus-4-5-20251101"Claude Opus 4.5 is our most intelligent model, combining maximum capability with practical performance. It features step-change improvements in vision, coding, and computer use at a more accessible price point than Opus 4.1. Ideal for complex specialized tasks and professional software engineering.
For codebases with many model references, a Claude Code plugin is available to automate migration to Opus 4.5.
No breaking changes. All API calls will work without modification.
Simply update your model ID.