Models / Anthropic

Claude Sonnet 5 API

Anthropic's agentic Sonnet that runs close to Opus 4.8

Anthropic's new Sonnet plans, runs tools and checks its own work at close to Opus 4.8 level, but a new tokenizer and a bigger appetite for thinking mean it spends noticeably more tokens per task.

  • Kind: chat
  • Made by: Anthropic
  • Price: 170 credits / M input tokens, 855 / M output (from $1.70; 1 credit = $0.01 on monthly plans, $0.015 as a top-up)
  • Released: 2026-06-30
  • Open weights: no (Proprietary, closed weights; available through the Claude apps, Claude API and cloud partners under Anthropic's terms)
  • Context window: 1,000,000 tokens
  • Max output: 128,000 tokens per reply, reasoning included
  • Inputs: Text and images
  • Output: Text only
  • Knowledge cutoff: January 2026
  • Thinking: Adaptive, on by default; reasoning_effort none or enabled on Unicorn
  • Parameters: Not published
  • Licence: Proprietary, API only
  • Inputs: model, messages, tools, tool_choice, stream, max_tokens, temperature, top_p, stop, response_format, reasoning_effort

Call it with POST https://api.unicornapi.net/v1/chat/completions and model claude-sonnet-5, or try it in the Playground.

Where it shines

  • 63.2% on SWE-bench Pro, up from 58.1% for Sonnet 4.6
  • 80.4% on Terminal-Bench 2.1, up from 67.0%
  • Edges Opus 4.8 on GDPval-AA knowledge work (1,618 Elo)
  • 81.2% on OSWorld-Verified computer use, with new computer and browser toolsets
  • One-million-token context window with image input

Watch out for

  • New tokenizer turns the same text into up to 35% more tokens than Sonnet 4.6
  • Uses about 40% more output tokens per task than Sonnet 4.6 in Artificial Analysis testing
  • Trails Opus 4.8 by six points on SWE-bench Pro and on the hardest reasoning tasks
  • No sampling parameters and no manual thinking limits on Anthropic's API

Claude Sonnet 5 is Anthropic's new mid-tier model and, in the company's words, its most agentic Sonnet yet. It is built to make a plan, pick up tools such as a terminal or a browser, and keep working on its own until a job is done, at a level that, by Anthropic's account, only larger models reached a few months ago. It reads up to a million tokens of text and images, writes up to 128,000 tokens back, and thinks before it answers unless told not to.

The headline is how close it runs to the top of Anthropic's lineup. On the launch figures, Sonnet 5 scores 63.2% on SWE-bench Pro, a test of fixing real issues in real repositories, up from 58.1% for Claude Sonnet 4.6 and six points behind Claude Opus 4.8. On GDPval-AA, which grades the documents and analyses office workers produce, it lands a hair ahead of Opus 4.8.

The catch, which dominated the first days of launch chatter, is tokens. Sonnet 5 ships with a new tokenizer that turns the same text into more tokens, and it spends more of them thinking and calling tools. Knowing when that extra work pays off is the key to using it well.

Anthropic's agentic Sonnet, closed and API-only

Claude Sonnet 5 comes from Anthropic, the San Francisco lab behind the Claude family. Sonnet is the everyday production tier: Haiku sits below it for fast, high-volume work, Opus above it for the hardest long-running tasks, and since early June the Mythos-class Claude Fable 5 sits at the very top. Sonnet 5 replaces Claude Sonnet 4.6 and becomes the default model for Free and Pro users in the Claude apps.

The model is closed. Anthropic does not release weights and has not published a parameter count, architecture or training details. Access runs through the Claude apps, Claude Code and the Claude API as claude-sonnet-5, and through Amazon Bedrock, Microsoft Foundry and Claude Platform on AWS, with Google Cloud listed as coming soon at launch. Anthropic commits to keeping it available on its own platforms until at least June 30, 2027, and it raised rate limits across its apps and API alongside the release.

Anthropic's safety write-up describes a model that cooperates with misuse and deception less often than Sonnet 4.6, resists prompt-injection attacks better, and hallucinates and flatters less. Its rate of misaligned behaviour in automated audits is slightly higher than Opus 4.8's. Sonnet 5 was not specifically trained on cyber tasks: it produced no fully working exploit in Anthropic's browser exploit-development test, and it launches with the same real-time cyber safeguards as Opus 4.7 and 4.8, less strict than those on Fable 5.

What changed from Claude Sonnet 4.6

Anthropic's launch figures, with Sonnet 4.6 and Opus 4.8 for reference:

BenchmarkSonnet 5Sonnet 4.6Opus 4.8
SWE-bench Pro63.2%58.1%69.2%
Terminal-Bench 2.180.4%67.0%n/a
OSWorld-Verified81.2%78.5%83.4%
Humanity's Last Exam, no tools43.2%34.6%49.8%
Humanity's Last Exam, with tools57.4%46.8%57.9%
GDPval-AA v2 (Elo)1,6181,395slightly lower

The Sonnet 4.6 figures in this table differ from those published at Sonnet 4.6's own launch, which gave 72.5% on OSWorld-Verified and 33.2% on Humanity's Last Exam without tools.

Agentic coding. The 13-point jump on Terminal-Bench 2.1, where the model works through tasks in a real shell, is the clearest sign of the new focus. Sonnet 5 also posts 85.2% on SWE-bench Verified. Customers quoted by Anthropic describe the behaviour behind the numbers: one engineer asked it to investigate a bug, and unprompted it wrote a reproducing test, implemented the fix, then stashed the fix to confirm. Kiro calls it "comparable to Opus-class models" in accuracy.

Finishing the job. Testers say Sonnet 5 completes complex tasks where earlier versions stopped short and checks its own output without being asked. Zapier handed it a two-part job, updating Salesforce account tiers and then sending a launch announcement, and it finished end to end.

Knowledge work and reasoning. The GDPval-AA result, more than 200 Elo points above Sonnet 4.6, puts Sonnet 5 level with Opus 4.8 on reports and analyses. Humanity's Last Exam with tools rises more than ten points to sit within half a point of Opus 4.8. Artificial Analysis independently measured a 14-point gain on the CritPt physics test.

Computer use. On the Claude API and Google Cloud, Sonnet 5 supports a new computer-use toolset and a browser-use tool that Sonnet 4.6 does not, and it reads screenshots up to 2,576 pixels on the long edge.

A new tokenizer and thinking by default

Two changes under the hood matter for everyone who migrates.

First, Sonnet 5 adopts the tokenizer Anthropic introduced with Opus 4.7. Anthropic says the same input maps to roughly 1.0 to 1.35 times as many tokens, about 30% more on typical text. One independent test measured 1.42 times for English prose, 1.33 for Spanish, about 1.27 for Python and almost no change for Mandarin. Prompts, context windows and max_tokens limits tuned for Sonnet 4.6 all shrink in effect.

Second, adaptive thinking is on by default. Requests that ran without thinking on Sonnet 4.6 now think, and the model decides how much, steered by an effort setting with five levels: low, medium, high (the API default), xhigh and max. Anthropic's rough mapping is that Sonnet 5 at medium matches Sonnet 4.6 at high, and Sonnet 5 at high matches Sonnet 4.6 at max. On Anthropic's own API, manually set thinking limits now return an error, and so do non-default temperature, top_p and top_k values.

Claude Sonnet 5 specs

Claude Sonnet 5
MakerAnthropic
ReleasedJune 30, 2026
WeightsClosed, API only
Context window1,000,000 tokens
Max output128,000 tokens per reply (300,000 on Anthropic's batch API with a beta header)
InputText and images
OutputText
Knowledge cutoffJanuary 2026
ThinkingAdaptive, five effort levels, on by default
TokenizerNew; about 30% more tokens than Sonnet 4.6 for the same text

Where Sonnet 5 shines

Brownfield code. One early-access engineer put it plainly: Sonnet 5 "is at its best on brownfield code: race conditions, hidden tests, the parts nobody wants to touch." Its readiness to write a failing test first and verify its own fix suits long, open-ended repository work, and CodeRabbit found it at its best on long, open-ended coding tasks.

Shell and tool workflows. The Terminal-Bench score reflects a model that plans, runs commands, reads the output and recovers. Anthropic's prompting guide notes it reaches for tools and self-verification loops more readily than Sonnet 4.6 and gives regular, useful progress updates during long runs.

Office and analysis work. Near-parity with Opus 4.8 on GDPval-AA means briefs, analyses and research write-ups come out at flagship quality. Eve, a legal AI firm, sees its clearest gains in legal research, and ClickHouse says it "reasons in tighter steps" and gets users to answers faster.

Careful reading of data. In one independent comparison, Sonnet 5 caught a planted arithmetic error in a sales table in all four runs, where its predecessor missed it, and when asked to recommend a vendor without the data needed to compare them, it listed what it would need instead of inventing figures.

Predictable pipelines. Anthropic describes Sonnet 5 as more literal than Sonnet 4.6: it does what the prompt says and does not quietly extend an instruction to cases you did not name. For structured extraction and tightly specified API workloads, that precision is a feature.

Weak spots and limits

Token appetite. Artificial Analysis put Sonnet 5 at 53 on its Intelligence Index at max effort, six points above Sonnet 4.6 and fifth overall, two to three points behind GPT-5.5 and Opus 4.8. But it used about 40% more output tokens per task than Sonnet 4.6 and around three times as many agentic turns on knowledge-work tests. On long agent runs, that extra output and those extra turns add up quickly.

Still not Opus. Opus 4.8 leads by six points on SWE-bench Pro and stays ahead on the hardest reasoning problems. Sonnet 5 narrows the gap on tool-heavy tasks; it does not close it on pure reasoning.

Overthinking small jobs. Reviewers found it slower than Sonnet 4.6 on quick edits and prone to overengineer minor tasks. It is also chatty: in one test it wrote the longest answers of the models compared, about 380 output tokens on average against roughly 290 for GPT-5.5, despite being told to be concise.

Code review recall. CodeRabbit measured review precision rising from about 29% to 38-40%, but Sonnet 5 caught around half of the bugs in its test set where Sonnet 4.6 caught 63%, and max effort roughly doubled the token use without finding meaningfully more. Anthropic's explanation is that Sonnet 5 follows "only report high-severity issues" instructions more faithfully, so harnesses tuned for older models need new wording.

Other limits. Some users report more refusals in sensitive domains. The knowledge cutoff is January 2026. Output is text only. And on Anthropic's API there is no temperature for stylistic variety, so on open-ended design briefs the model can settle into a house style.

How to prompt Claude Sonnet 5

Give the whole task up front. Anthropic finds that a clear, complete first message makes Sonnet 5 both more capable and more token-efficient than requirements fed in over several turns.

If it runs long, say so directly, as Anthropic's own guide suggests:

Provide concise, focused responses. Skip non-essential context, and keep examples minimal.

Because it reads instructions literally, state the scope:

Apply this formatting to every section, not just the first one.

For code review, separate finding from filtering so recall does not drop:

Report every issue you find, including ones you are uncertain about or consider low-severity. For each finding, include your confidence level and an estimated severity.

For design or copy where you want variety, ask for options first instead of relying on randomness:

Before building, propose 4 distinct visual directions for this brief, each with a background colour, an accent colour and a typeface, then implement only the one I pick.

Leave headroom in max_tokens: thinking counts toward it, and a tight limit can produce a reply that is nearly all reasoning and a truncated answer.

Sonnet 5 against Opus 4.8, Sonnet 4.6 and rivals

Against Claude Opus 4.8. On knowledge work and computer use the two are within a couple of points. Opus 4.8 remains the pick for the hardest repository fixes and deep reasoning, and on long agent runs it tends to get there with fewer tokens.

Against Claude Sonnet 4.6. Sonnet 5 is the stronger model on every published test. Stay on 4.6 for now if you depend on temperature, need exact thinking limits, or run high-volume, simple prompts where the tokenizer increase and default thinking only add tokens and latency.

Against the rest. Claude Fable 5 is the choice when you need the strongest model available and can wait for its answers. Claude Haiku 4.5 is faster and better suited to classification and routing. Among other labs' models on Unicorn, Gemini 3 Pro and GPT 5.2 are the main general-purpose alternatives.

Getting started

Open Claude Sonnet 5 in the Playground to try it without code. For your own apps, create an API key and send requests with the model id claude-sonnet-5 to the OpenAI-style /v1/chat/completions endpoint or the Anthropic-style /v1/messages endpoint. Images go in as image_url parts, tools as function definitions, and max_tokens goes up to 128,000 with reasoning counted inside it. On Unicorn, reasoning_effort accepts none or enabled; leave it out to use the model default. The docs cover streaming, tools and usage reporting.

Verdict

Claude Sonnet 5 is the Sonnet that behaves like an agent: it plans, uses the terminal and the browser, writes tests before fixes and checks its own work, and on office tasks it matches Opus 4.8. The trade-off is paid in tokens, through a hungrier tokenizer and default thinking. Keep effort at medium or high, give it the whole task up front, and it is a strong everyday default for coding agents and knowledge work.

Best for

  • Agentic coding in real repositories
  • Terminal and multi-step tool workflows
  • Computer and browser use
  • Reports, analyses and other office work
  • Checking data and documents for errors
  • Structured extraction pipelines

Frequently asked questions

Is Claude Sonnet 5 open source?

No. Claude Sonnet 5 is a proprietary Anthropic model with closed weights and no published parameter count. You reach it through the Claude apps, the Claude API, cloud partners and API resellers such as Unicorn API.

What effort levels does Claude Sonnet 5 have?

Five: low, medium, high (the API default), xhigh and max, with adaptive thinking on by default. Anthropic's rough mapping is that Sonnet 5 at medium matches Sonnet 4.6 at high. On Unicorn API, reasoning_effort accepts none or enabled.

What is the Claude Sonnet 5 context window?

One million tokens, with up to 128,000 output tokens per reply. Thinking tokens count toward the output limit, so leave room for reasoning when you set max_tokens.

Claude Sonnet 5 vs Claude Opus 4.8: which should I use?

Sonnet 5 matches or edges Opus 4.8 on knowledge work and comes within about two points on computer use. Opus 4.8 still leads on SWE-bench Pro and the hardest reasoning tasks.

Why does Claude Sonnet 5 use more tokens than Sonnet 4.6?

It uses a new tokenizer that maps the same text to roughly 1.0 to 1.35 times as many tokens, and it thinks by default. Independent testing also found it writes about 40% more output tokens per task.

Can Claude Sonnet 5 read images?

Yes. It accepts images alongside text, including screenshots for computer use. On Unicorn API you send images as image_url parts in the chat messages. It does not generate images.