- Claude Sonnet 3.7 → Claude Sonnet 4.5: Our most intelligent model with best-in-class reasoning, coding, and long-running agent capabilities
- Claude Haiku 3.5 → Claude Haiku 4.5: Our fastest and most intelligent Haiku model with near-frontier performance for real-time applications and high-volume intelligent processing
Migrating from Claude Sonnet 3.7 to Claude Sonnet 4.5
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.Migration steps
-
Update your model name:
-
Update sampling parameters
Use onlyThis is a breaking change from the Claude Sonnet 3.7.
temperatureORtop_p, not both: -
Handle the new
refusalstop reason Update your application to handlerefusalstop reasons: -
Update text editor tool (if applicable)
Update toThis is a breaking change from the Claude Sonnet 3.7.
text_editor_20250728(type) andstr_replace_based_edit_tool(name). Remove any code using theundo_editcommand.See Text editor tool documentation for details. -
Update code execution tool (if applicable)
Upgrade to
code_execution_20250825. The legacy versioncode_execution_20250522still 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 in Claude 3.7. 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-19beta header from your requests: -
Remove extended output beta header
The
output-128k-2025-02-19beta header for extended output is only available in Claude Sonnet 3.7. Remove this header from your requests: - 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):
Extended thinking impacts prompt caching efficiency.
- Test your implementation
Sonnet 3.7 → 4.5 migration checklist
- Update model ID to
claude-sonnet-4-5-20250929 - BREAKING: Update sampling parameters to use only
temperatureORtop_p, not both - Handle new
refusalstop reason in your application - BREAKING: Update text editor tool to
text_editor_20250728andstr_replace_based_edit_tool(if applicable) - BREAKING: Remove any code using the
undo_editcommand (if applicable) - Update code execution tool to
code_execution_20250825(if applicable) - Remove
token-efficient-tools-2025-02-19beta header (if applicable) - Remove
output-128k-2025-02-19beta header (if applicable) - Review and update prompts following Claude 4 best practices
- Consider enabling extended thinking for complex reasoning tasks
- Handle
model_context_window_exceededstop reason (Sonnet 4.5 specific) - Consider enabling memory tool for long-running agents (beta)
- Consider using automatic tool call clearing for context editing (beta)
- Test in development environment before production deployment
Features removed from Claude Sonnet 3.7
- Token-efficient tool use: The
token-efficient-tools-2025-02-19beta header is not supported (see step 6) - Extended output: The
output-128k-2025-02-19beta header is not supported (see step 7)
Migrating from Claude Haiku 3.5 to Claude Haiku 4.5
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 5 per million output tokens. See Claude pricing for details.
Migration steps
-
Update your model name:
-
Update tool versions (if applicable)
Haiku 4.5 only supports the latest tool versions:This is a breaking change from the Claude Haiku 3.5.
- Text editor: Use
text_editor_20250728andstr_replace_based_edit_tool - Code execution: Use
code_execution_20250825 - Remove any code using the
undo_editcommand
- Text editor: Use
-
Update sampling parameters
Use onlyThis is a breaking change from the Claude Haiku 3.5.
temperatureORtop_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
refusalstop 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):
Extended thinking impacts prompt caching 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.
Haiku 3.5 → 4.5 migration checklist
- Update model ID to
claude-haiku-4-5-20251001 - BREAKING: Update tool versions to latest (e.g.,
text_editor_20250728,code_execution_20250825) - legacy versions not supported - BREAKING: Remove any code using the
undo_editcommand (if applicable) - BREAKING: Update sampling parameters to use only
temperatureORtop_p, not both - Review and adjust for new rate limits (separate from Haiku 3.5)
- Handle new
refusalstop reason in your application - Consider enabling extended thinking for complex reasoning tasks (new capability)
- Leverage context awareness for better token management in long sessions
- Prepare for larger responses (max output increased from 8K to 64K tokens)
- Review and update prompts following Claude 4 best practices
- Test in development environment before production deployment
Choosing between Sonnet 4.5 and Haiku 4.5
Both Claude Sonnet 4.5 and Claude Haiku 4.5 are powerful Claude 4 models with different strengths:Choose Claude Sonnet 4.5 (most intelligent) for:
- Complex reasoning and analysis: Best-in-class intelligence for sophisticated tasks
- Long-running autonomous agents: Superior performance for agents working independently for extended periods
- Advanced coding tasks: Our strongest coding model with advanced planning and security engineering
- Large context workflows: Enhanced context management with memory tool and context editing capabilities
- Tasks requiring maximum capability: When intelligence and accuracy are the top priorities
Choose Claude Haiku 4.5 (fastest and most intelligent Haiku) for:
- Real-time applications: Fast response times for interactive user experiences with near-frontier performance
- High-volume intelligent processing: Cost-effective intelligence at scale with improved speed
- Cost-sensitive deployments: Near-frontier performance at lower price points
- Sub-agent architectures: Fast, intelligent agents for multi-agent systems
- Computer use at scale: Cost-effective autonomous desktop and browser automation
- Tasks requiring speed: When low latency is critical while maintaining near-frontier intelligence
Extended thinking recommendations
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.Other migration scenarios
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.Migrating from Claude Sonnet 4 → Sonnet 4.5
Breaking change: Cannot specify bothtemperature 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:
Migrating from Claude Opus 4.1 → Sonnet 4.5
No breaking changes. All API calls will work without modification. Simply update your model ID:Need help?
- Check our API documentation for detailed specifications
- Review model capabilities for performance comparisons
- Review API release notes for API updates
- Contact support if you encounter any issues during migration