Claude Sonnet 5 API Overview
Claude Sonnet 5 API is Anthropic's newest Sonnet-class model for coding agents, tool-using workflows, long-context document reasoning, and everyday professional work. On CometAPI, the model ID is claude-sonnet-5, exposed through both the native Anthropic Messages endpoint and an OpenAI-compatible chat endpoint, so developers can choose between Claude-specific controls and a portable multi-model integration layer.
Technical Specifications
| Item | Specification |
|---|---|
| Model name | Claude Sonnet 5 |
| API model ID | claude-sonnet-5 |
| Provider | Anthropic |
| CometAPI provider code | anthropic |
| Input types | Text and image input; PDF/document input is listed in CometAPI catalog features |
| Output type | Text |
| Context window | 1M tokens, default and maximum on Claude Sonnet 5 |
| Maximum output tokens | 128k tokens on the synchronous Messages API |
| Adaptive thinking | Yes; on by default |
| Extended thinking | Manual thinking: {type: "enabled", budget_tokens: N} is removed and returns a 400 error |
| Effort control | Supported through the effort parameter; Anthropic notes the API and Claude Code default to high effort |
| Sampling parameters | Non-default temperature, top_p, or top_k return a 400 error |
| Reliable knowledge cutoff | January 2026 |
| Training data cutoff | January 2026 |
What Is Claude Sonnet 5?
Claude Sonnet 5 is Anthropic's next-generation Sonnet model and a direct upgrade from Claude Sonnet 4.6. Claude Sonnet 5 API is Anthropic's newest Sonnet-class model for coding agents, tool-using workflows, long-context document reasoning, and everyday professional work.
The model narrows the capability gap between Sonnet and Opus. Anthropic's launch notes state that Sonnet 5 is close to Claude Opus 4.8 on agentic performance while retaining the Sonnet class's faster, more efficient role. It is designed for developers who need stronger follow-through than Sonnet 4.6 without moving every workflow to an Opus-tier model.
For API users, Sonnet 5 also changes how generation is controlled. Adaptive thinking is enabled by default, manual extended thinking budgets are no longer accepted, and non-default sampling parameters are rejected. Production migrations from Sonnet 4.6 should therefore retest token budgets, remove manual thinking budgets, and avoid temperature/top-p/top-k overrides.
Features and Highlights of Claude Sonnet 5
1. Stronger Agentic Coding and Terminal Work
Anthropic positions Claude Sonnet 5 as its most agentic Sonnet model yet. In the system card, Claude Sonnet 5 reaches 85.2% on SWE-bench Verified, 63.2% on SWE-bench Pro, 78.3% on SWE-bench Multilingual, and 80.4% on Terminal-Bench 2.1. These results make the Claude Sonnet 5 API well suited to code review, bug investigation, migration planning, test generation, and autonomous engineering agents.
2. 1M-Token Long-Context Reasoning
Claude Sonnet 5 supports a 1M-token context window by default. Anthropic notes that the model uses a new tokenizer that produces approximately 30% more tokens for the same text than Claude Sonnet 4.6, so developers should recount prompts and revisit max_tokens settings when migrating. The large context window is still a major advantage for repository-scale tasks, policy review, financial workbooks, multi-document research, and long customer-support histories.
3. Multimodal Document and Computer-Use Capability
Anthropic's current Claude model overview states that current Claude models support text and image input with text output, multilingual capabilities, and vision.Sonnet 5 scores 67.5% without tools and 81.6% with tools on GDP.pdf, 81.2% on OSWorld-Verified, and 86.7% with tools on ChartMuseum, indicating practical strength on dense documents, GUI-style tasks, and chart reasoning.
4. Claude-Specific Controls Through CometAPI
CometAPI exposes Claude Sonnet 5 through /v1/messages for Anthropic-style integrations and /v1/chat/completions for OpenAI-compatible routing. Use the native Messages endpoint when you need Claude-specific features such as adaptive thinking, effort control, prompt caching, server tools, or Anthropic response shapes. Use the OpenAI-compatible endpoint when your app already standardizes around OpenAI-style chat calls and you want to compare Claude Sonnet 5 against GPT, Gemini, or other CometAPI catalog models.
Benchmark Performance
Anthropic's launch materials and Claude Sonnet 5 system card report broad gains over Claude Sonnet 4.6, especially in coding, agentic search, multimodal reasoning, and professional-task performance.
| Capability | Benchmark | Claude Sonnet 5 result | Notes |
|---|---|---|---|
| Coding repair | SWE-bench Verified | 85.2% | 500 verified software-engineering tasks |
| Harder coding repair | SWE-bench Pro | 63.2% | Larger multi-file diffs and harder repository issues |
| Multilingual coding | SWE-bench Multilingual | 78.3% | 300 tasks across 9 programming languages |
| Terminal coding agents | Terminal-Bench 2.1 | 80.4% | Mean reward over 445 trials |
| Agentic coding | FrontierCode v1 | 38.8% | Real pull-request style tasks from Cognition |
| Cursor production coding tasks | CursorBench | 61.2% | Independently measured by Cursor; Sonnet 4.6 scored 49% |
| Agentic web search | BrowseComp | 84.7% | Adaptive thinking at maximum effort with 10M-token limit and context compaction |
| Computer use | OSWorld-Verified | 81.2% | First-attempt success rate, averaged over five runs |
| Professional PDF reasoning | GDP.pdf | 67.5% without tools, 81.6% with tools | Mean criteria pass rate on 100 professional PDF prompts |
| Chart understanding | ChartMuseum | 70.1% without tools, 86.7% with tools | Strong improvement over Sonnet 4.6 |
| Office document reasoning | OfficeQA / OfficeQA Pro | 73.3% / 59.4% | Exact-match scores in an agentic harness |
| Economic work tasks | GDPval-AA v2 | ELO 1618 | Independent Artificial Analysis evaluation; ranked second behind Claude Fable 5 in the system-card summary |

Claude Sonnet 5 vs Sonnet 4.6 vs Opus 4.8 vs Claude Fable 5
| Model | Same-type role | Best fit | Selection note |
|---|---|---|---|
| Claude Sonnet 5 | Fast, high-intelligence Sonnet model for agents and coding | Coding agents, long-context work, document analysis, production automation | Choose when Sonnet 4.6 is not strong enough but an Opus-tier model is not required for every request. |
| Claude Sonnet 4.6 | Previous Sonnet production model | Existing Sonnet workflows, lower migration risk, established prompts | Upgrade to Sonnet 5 for stronger agentic coding and professional-task performance, but retest token budgets and API parameters. |
| Claude Opus 4.8 | More capable Opus-tier model | Complex reasoning, high-autonomy work, hardest long-horizon agent tasks | Use when the task demands higher peak reasoning; Sonnet 5 can match or approach it on some agentic tasks at selected effort levels. |
| Claude Fable 5 | Anthropic's most capable widely released model | Highest capability workloads and demanding long-horizon agentic work | Use as the upper-end benchmark when quality matters more than using the Sonnet class. |
How to Use Claude Sonnet 5 API on CometAPI
Claude Sonnet 5 API is Anthropic's newest Sonnet-class model for coding agents, tool-using workflows, long-context document reasoning, and everyday professional work. On CometAPI, the model ID is claude-sonnet-5, exposed through both the native Anthropic Messages endpoint and an OpenAI-compatible chat endpoint, so developers can choose between Claude-specific controls and a portable multi-model integration layer.
Preparation: Sign Up for API Key
Log in to cometapi.com. If you are not our user yet, please register first. Sign into your CometAPI console. Get the access credential API key of the interface. Click “Add Token” at the API token in the personal center, get the token key: sk-xxxxx and submit.
Step 1: Use the Native Anthropic Messages Endpoint
Use /v1/messages when you want the closest Claude API behavior through CometAPI. This is the better path for adaptive thinking, effort control, prompt caching, server tools, streaming, and Claude-style response content blocks.
For Claude Sonnet 5, do not send manual extended thinking budgets such as thinking: {"type": "enabled", "budget_tokens": 32000}. Anthropic recommends adaptive thinking and effort control instead.
Step 2: Use the OpenAI-Compatible Endpoint for Portable Routing
Use /v1/chat/completions when your application already uses OpenAI-style chat calls or when you want to compare Claude Sonnet 5 with other CometAPI catalog models behind the same client pattern.
Step 3: Retest Prompts Before Production
When migrating from Claude Sonnet 4.6, recount prompts under the new tokenizer, remove non-default sampling parameters, and review output limits. Sonnet 5 produces more tokens for the same text than Sonnet 4.6, and adaptive thinking tokens share the max_tokens budget with final response text.
Why Use CometAPI for Claude Sonnet 5?
CometAPI gives developers a single model marketplace for Claude Sonnet 5, Claude Opus-class models, GPT-class models, Gemini-class models, and other frontier AI systems. That is useful when teams want one API key, model comparison, staged rollouts, fallback routing, and easier migration between providers.
For Claude Sonnet 5 specifically, CometAPI's value is the dual endpoint strategy. Teams can use the Anthropic Messages endpoint for Claude-native features and use the OpenAI-compatible endpoint for apps that already standardize on chat-completions style requests. This lets engineering teams test the Claude Sonnet 5 API in realistic coding, document, and agent workflows without rebuilding the entire integration layer first.
Recommended CometAPI Use Cases for Claude Sonnet 5
Claude Sonnet 5 is a strong default candidate for:
- Coding agents that read repositories, generate patches, and explain changes.
- Code review assistants that prioritize bugs and regression risk.
- Long-context document analysis across PDFs, policies, contracts, and research packets.
- Customer-support investigation workflows that combine tickets, logs, docs, and account history.
- Security review and defensive vulnerability triage.
- Data-analysis copilots that explain tables, charts, and business metrics.
- Agentic research workflows that browse, summarize, compare, and cite sources.
- Internal operations assistants that need reliable multi-step execution.
For CometAPI customers, a good starting policy is:
| Workload | Recommended model strategy |
|---|---|
| High-value coding and agent tasks | Default to claude-sonnet-5 with higher effort |
| Long document synthesis | Use claude-sonnet-5 with careful context packing |
| Simple classification or extraction | Use a cheaper fast model unless quality requires Sonnet 5 |
| Sensitive security tasks | Use Sonnet 5 with logging, intent checks, and policy-aware UX |
| Legacy Sonnet workflows | Run A/B evals before replacing Sonnet 4.6 |
| Multi-model applications | Use CometAPI routing and fallback logic |
What Does Claude Sonnet 5 Actually Cost?
Claude Sonnet 5 uses token-based API pricing.
| Pricing | Input Tokens | Output Tokens |
|---|---|---|
| Introductory (until Aug. 31, 2026) | $2 / 1M tokens | $10 / 1M tokens |
| Standard (from Sept. 1, 2026) | $3 / 1M tokens | $15 / 1M tokens |
Anthropic also offers discounted rates for prompt caching and batch processing. One important change is that Sonnet 5 uses a new tokenizer, which typically produces around 30% more tokens for the same text than Sonnet 4.6, so real-world costs may be somewhat higher even though the per-token price is unchanged.
Claude Sonnet 5 API Performance on CometAPI
Claude Sonnet 5 is designed to balance speed, reasoning quality, and cost.
Major improvements include:
- Stronger coding performance
- Better agentic workflows (planning and executing multi-step tasks)
- Native support for 1 million token context windows
- Up to 128K output tokens
- Improved tool use (browser, terminal, APIs)
- Adaptive thinking enabled by default
Compared with Sonnet 4.6, Anthropic reports notable gains in:
- Software engineering
- Complex reasoning
- Autonomous task completion
- Long-context understanding
The model is intended as a drop-in replacement for Sonnet 4.6 with minimal API changes.
What Developers Build with Claude Sonnet 5
Developers commonly use Claude Sonnet 5 for:
AI Coding Assistants
- Code generation
- Refactoring
- Debugging
- Test generation
AI Agents
- Browser automation
- Research assistants
- Customer support agents
- Task automation
Enterprise Applications
- Knowledge search
- Internal documentation assistants
- Workflow automation
- Business analytics
Content Generation
- Technical writing
- Marketing copy
- Reports
- Documentation
Data Processing
- Information extraction
- Document summarization
- Classification
- Structured JSON generation
Because Sonnet 5 combines strong reasoning with relatively low API costs, it is well suited for production applications that need both quality and scalability.