Claude Sonnet 5 is the most agentic AI model in Anthropic's Sonnet family. It can plan tasks, use tools like a browser or a terminal, and operate autonomously on complex missions that, just a few months ago, required far larger and more expensive models. Its performance approaches that of Opus 4.8, but at a significantly lower price.
In this article, we'll explore in detail what Claude Sonnet 5 brings to the table, its concrete use cases, its pricing, its safety guardrails, and how to integrate it into your projects via the Claude API. Whether you're a developer, a product creator, or simply curious about AI advances, this guide will give you a complete picture.
What is Claude Sonnet 5?
Claude Sonnet 5 is the latest iteration of the Sonnet line, positioned by Anthropic as an optimal balance between power and cost. Where the Opus models aim for maximum performance and the Haiku models for economical speed, Sonnet occupies the middle ground: smart enough for demanding tasks, affordable enough for everyday use at scale.
What sets this version apart is its agentic orientation. An agentic model doesn't just answer a question: it breaks an objective down into steps, chooses the right tools, performs actions, checks its results, and course-corrects if needed. This is precisely what Sonnet 5 does better than its predecessors.
For many developers, the agentic AI era began with the Sonnet-class models (3.5, 3.6, 3.7), the first to demonstrate real skills in coding and tool use. Sonnet 5 extends this legacy by narrowing the gap with the Opus models.
A step up from Sonnet 4.6
Sonnet 5 represents a substantial improvement over its direct predecessor, Sonnet 4.6, across several key axes of agentic performance:
- Reasoning: tighter, more reliable chains of thought.
- Tool use: a better ability to chain together browser, terminal, and API.
- Coding: cleaner code, especially on existing and complex codebases.
- Knowledge work: faster research, analysis, and document synthesis.
Close to Opus 4.8, at a lower cost
Sonnet 5's central argument fits in one sentence: it delivers performance close to the high-end Opus 4.8 model, but at a far more accessible price. For tasks requiring maximum precision, Opus 4.8 remains the go-to choice. But for the vast majority of everyday use cases, Sonnet 5 offers value for money that's hard to beat.
Claude Sonnet 5's new agentic capabilities
Feedback from early-access partners converges on one point: Sonnet 5 is noticeably more autonomous than previous versions. Where an older Sonnet model would stop halfway, Sonnet 5 sees the task through to the end.
Multi-step execution, all the way through
One of the most visible changes is the model's ability to finish a complex task end-to-end. For example, you hand it a two-part mission: update account tiers in a CRM (customer relationship management software), then send a launch announcement to enterprise contacts. Previous models often stalled halfway. Sonnet 5, on the other hand, completes the whole thing without intervention.
Spontaneous self-checking
A remarkable trait: Sonnet 5 checks its own work without being explicitly asked. One tester recounts asking it to investigate a bug. With no further instruction, the model:
- wrote a test that reproduces the bug,
- implemented the fix,
- then set its change aside to confirm that the bug reappeared without the correction.
All in a single pass. This rigorous-engineer behavior illustrates the qualitative leap of this generation.
Excelling on existing code (brownfield)
Sonnet 5 shines in particular on brownfield code, meaning old and tricky codebases: race conditions (when two processes run at the same time and interfere with each other), hidden tests, modules nobody dares touch. Instead of masking a symptom, it traces a failure to its root cause and ships a durable fix.
Several partners ran Sonnet 5 on their most complex pull requests (proposed code changes): the model carried each one through to a tested, verified result on its own, freeing engineers for the final judgment and sign-off.
Performance and benchmarks
Anthropic positions Sonnet 5 as a strict improvement over Sonnet 4.6 on agentic evaluations. Two benchmarks illustrate this gain well.
BrowseComp and OSWorld-Verified
On BrowseComp (agentic web search) and OSWorld-Verified (computer use), Sonnet 5 consistently outperforms Sonnet 4.6, regardless of the effort level. Opus 4.8 keeps the edge for maximum precision, but Sonnet 5 now offers a far higher-quality option at a reduced price.
| Criterion | Sonnet 4.6 | Sonnet 5 | Opus 4.8 |
|---|---|---|---|
| Agentic reasoning | Solid | Improved | Reference |
| OSWorld-Verified | 78.5% | Higher | Highest |
| Tool use | Good | Strengthened | Excellent |
| Cost | Moderate | Low | High |
The adjustable effort level
A key feature: between Sonnet 5 and Opus 4.8, you can adjust the effort level to find the right balance between cost and performance. On a simple task, a low effort is enough and costs less; on a critical task, you raise the effort to maximize precision. Anthropic has in fact raised the rate limits to accommodate the increased consumption of tokens (the units of text the model reads and bills for, roughly fragments of words) at high effort levels.
Sonnet 5 uses an updated tokenizer (the component that splits text into tokens) that changes how text is processed. The same content can generate roughly 1.0 to 1.35 times more tokens depending on the content type. The introductory pricing is calibrated so that the transition stays roughly cost-neutral.
Claude Sonnet 5 pricing
Anthropic is launching Sonnet 5 with an attractive introductory price, valid until August 31, 2026, before moving to standard pricing.
| Period | Input tokens | Output tokens |
|---|---|---|
| Introductory (until 08/31/2026) | $2 / million | $10 / million |
| Standard (afterward) | $3 / million | $15 / million |
Availability across plans
Sonnet 5 is available everywhere from launch:
- Default model for the Free and Pro plans.
- Available to Max, Team, and Enterprise users.
- Available in Claude Code and on the Claude Platform.
- Usable via the Claude API under the identifier
claude-sonnet-5.
How to use Claude Sonnet 5 via the API
Integrating Sonnet 5 into your projects happens through the Claude API (the interface that lets your own programs talk to the model), simply by referencing the model identifier. Here's a minimal example in Python.
import anthropic
client = anthropic.Anthropic(api_key="YOUR_API_KEY")
message = client.messages.create(
model="claude-sonnet-5",
max_tokens=1024,
messages=[
{"role": "user", "content": "Analyze this bug and propose a tested fix."}
],
)
print(message.content)Example of an agentic call with tools
Sonnet 5's strength lies in tool use. You declare the available tools, and the model decides when and how to call them.
tools = [
{
"name": "run_terminal",
"description": "Execute a shell command and return the output",
"input_schema": {
"type": "object",
"properties": {
"command": {"type": "string"}
},
"required": ["command"]
}
}
]
response = client.messages.create(
model="claude-sonnet-5",
max_tokens=2048,
tools=tools,
messages=[
{"role": "user", "content": "Run the tests and fix the ones that fail."}
],
)
Calling via cURL
For a quick test on the command line, you can query the API directly.
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-5",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Hello Claude!"}
]
}'
Claude Sonnet 5 safety and guardrails
Anthropic conducted safety evaluations before deployment. Overall, Sonnet 5 shows a lower rate of undesirable behaviors than Sonnet 4.6, and proves safer in agentic contexts.
Better resistance to attacks
On the agentic safety front, the model refuses malicious requests better and is more resistant to hijacking attempts, in particular prompt injection attacks (which slip booby-trapped instructions into the content the model reads in order to hijack its behavior). It also shows lower rates of hallucination (when the model invents false information and presents it as true) and sycophancy (excessive flattery, telling users what they want to hear) than its predecessor.
As one partner put it: a model that knows how to say no is as important as a model that knows how to build. Sonnet 5 refuses dangerous requests cleanly and consistently.
Limited cyber capabilities and active guardrails
Sonnet 5 was not specifically trained on offensive cybersecurity tasks. On evaluations testing potentially dangerous skills, such as developing software exploits (programs that take advantage of a security flaw), it performs markedly worse than Opus 4.8. In a test of developing exploits for vulnerabilities in the Firefox browser (conducted with Mozilla, flaws since patched), Sonnet 5 never managed to produce a fully working exploit.
Since it remains slightly more capable than Sonnet 4.6 on these tasks, Anthropic launched it with cyber guardrails enabled by default. These protections detect and block dangerous cyber usage in real time. For cybersecurity work that requires reduced guardrails, Anthropic recommends Opus 4.8 instead.
Who is Claude Sonnet 5 for?
Sonnet 5 is aimed at a broad audience, but some profiles will benefit immediately.
Developers and engineering teams
This is the core target. For sustained coding, debugging, tool use, and clean multi-step changes, Sonnet 5 provides a solid execution layer. It stays on the defined plan, follows your conventions, and ships tested changes, all at a controlled cost.
Business automation agents
For everyday automation (updating a CRM, sending communications, processing insurance workflows, receiving and handling case files), Sonnet 5 takes the right action and executes it quickly. Its ability to chain tasks without stalling makes it an obvious choice for operations.
Knowledge and analysis work
Legal research, live data analysis, document synthesis: Sonnet 5 reasons in shorter steps and gets users to answers faster. Its price-performance ratio makes migrating from more expensive models easy.
Best practices to get the most out of Sonnet 5
To fully tap the model's agentic potential, keep these recommendations in mind.
- Define a clear objective rather than a rigid sequence of instructions: let the model plan the steps.
- Provide the right tools (browser, terminal, API) and describe them precisely in their schemas.
- Adjust the effort level based on how critical the task is, to optimize cost and quality.
- Let it check its work: encourage writing tests and autonomous validation.
- Monitor token consumption, since the new tokenizer can increase the volume processed.
- Keep Opus 4.8 in reserve for tasks demanding maximum precision or reduced cyber guardrails.
Frequently asked questions
What's the difference between Claude Sonnet 5 and Opus 4.8?
Opus 4.8 remains the most capable model for tasks demanding maximum precision. Sonnet 5 comes very close, but at a much lower price. You can adjust the effort level between the two models to find the right balance between cost and performance for each project.
How much does Claude Sonnet 5 cost?
Until August 31, 2026, the introductory price is $2 per million input tokens and $10 per million output tokens. After that, standard pricing moves to $3 input and $15 output per million tokens.
Is Claude Sonnet 5 available for free?
Yes. Sonnet 5 is the default model on the Free and Pro plans. It's also available to Max, Team, and Enterprise users, in Claude Code, and via the Claude API.
Which identifier should I use to call Sonnet 5 via the API?
The model identifier to use in the Claude API is claude-sonnet-5. Just provide it in the model parameter of your request.
Is Sonnet 5 safe for autonomous agentic uses?
Yes. Safety evaluations show a lower rate of undesirable behaviors than Sonnet 4.6, better resistance to prompt injection, and reduced hallucination rates. Cyber guardrails are enabled by default to block dangerous uses in real time.
How can I get trained on Claude Code?
With our complete Claude Code course!




