Claude Sonnet 5
Claude Sonnet 5 is Anthropic's Sonnet-family model for coding, agent workflows, and long-context software engineering, with a 1M-token context window and 128K maximum output.
🚀Function Overview
Claude Sonnet 5 is designed for production coding and agent tasks where teams need stronger Sonnet-tier quality, long context, high output limits, and practical pricing relative to Opus or Fable-style escalation models.
Key Features
- Official model ID claude-sonnet-5-20260630 with alias claude-sonnet-5-0
- 1M-token context window in Anthropic's model overview
- 128K maximum output for long code, review, and analysis responses
- Text and image input with text output
- Coding, code execution, bash, file editing, and agentic tool-use positioning in official docs
- Available through Anthropic API, Amazon Bedrock, Google Vertex AI, and Microsoft Foundry
- Official Anthropic API pricing of $5 per million input tokens and $25 per million output tokens
Use Cases
- •Coding-agent default model trials in Claude Code and Anthropic API harnesses
- •Long-context codebase analysis and refactoring tasks
- •Tool-using agent workflows that edit files, run commands, or inspect repositories
- •Production assistant routing where Sonnet-tier quality and cost balance matter
- •Migration testing from Sonnet 4.5, Sonnet 4.6, or older Claude 4.x deployments
- •Escalation comparisons against Opus, Fable, GPT-5.6, GLM, and DeepSeek model routes
⚙️Input Parameters
model
stringUse claude-sonnet-5-20260630 for the dated Anthropic API model ID, or claude-sonnet-5-0 when the alias is appropriate for the account and provider surface.
messages
arrayAnthropic Messages API conversation payload for text, vision, coding, and tool-use workflows.
system
stringOptional system instruction for role, tool, coding, and safety constraints.
max_tokens
integerMaximum output tokens to generate, up to the model's documented max-output limit when the account and provider surface allow it.
tools
arrayOptional tool definitions for agent workflows, code execution, file editing, search, and structured tool calls.
thinking
objectReasoning or effort controls where supported by the current Anthropic API contract; validate migration guidance before changing production prompts.
💡Usage Examples
Example 1
Input Parameters
{
"model": "claude-sonnet-5-20260630",
"messages": [
{
"role": "user",
"content": "Review this failing TypeScript feature branch, identify the smallest safe fix, and propose the verification command sequence."
}
],
"max_tokens": 4096
}Output Results
Example 2
Input Parameters
{
"model": "claude-sonnet-5-20260630",
"messages": [
{
"role": "user",
"content": "Compare whether this codebase migration should use Sonnet 5 by default or escalate only failed slices to a higher-tier model."
}
],
"max_tokens": 4096
}Output Results
Quick Actions
Technical Specifications
- Hardware Type
- Anthropic API / Amazon Bedrock / Google Vertex AI / Microsoft Foundry
- Run Count
- 0
- Commercial Use
- Supported
- Pricing
- Anthropic API: $5 per million input tokens and $25 per million output tokens; separate prompt-caching and batch-processing rates apply
- Platform
- Replicate
Related Keywords
Related Models
Bielik 1.5B v3 Instruct
Bielik-1.5B-v3-Instruct is a generative text model featuring 1.6 billion parameters. It is result of collaboration between the open-science/open-souce project SpeakLeash and the High Performance Computing (HPC)
Cordia-A6 Text Generation Model
A model for generating text sequences based on input prompts and adjustable parameters.
Claude Sonnet 4
Claude Sonnet 4 is a significant upgrade to 3.7, delivering superior coding and reasoning while responding more precisely to your instructions