Claude Sonnet 5 API

anthropic/claude-sonnet-5
Claude Sonnet 5 is Anthropic's high-performance model for coding and agentic workflows, delivering near-Opus quality at Sonnet cost with a 1M token context window and adaptive thinking.
Context
1M tokens
Input
$2 / 1M tokens
Output
$10 / 1M tokens
Released
Jun 30, 2026

Overview

What is Claude Sonnet 5 API?

Claude Sonnet 5 is Anthropic's high-performance language model for coding, agentic workflows, and complex reasoning. It delivers performance approaching Claude Opus quality at Sonnet pricing — with a 1M token context window, adaptive thinking, and high-resolution vision built in.

The model is available via AI/ML API using the model ID anthropic/claude-sonnet-5 and ships under Anthropic's standard commercial terms.

[Model Specifications embed]

[Performance Benchmarks embed]

API Pricing

  • Input: $2.60 per 1M tokens
  • Output: $13.00 per 1M tokens

Where to Use Claude Sonnet 5

Coding and code review
Claude Sonnet 5 is optimized for writing, debugging, and reviewing code across all major languages. The 1M context window means entire codebases can be loaded for refactoring or cross-file analysis in a single prompt.

Agentic and multi-step workflows
Strong tool-calling and reliable instruction following make Claude Sonnet 5 a natural fit for agent loops that require planning, executing tools, evaluating results, and iterating over many steps.

Long-document analysis
A 1M token context window lets you pass full contracts, research papers, technical specs, and annual reports in one prompt — no chunking required.

Vision and multimodal tasks
High-resolution vision enables accurate processing of diagrams, screenshots, charts, and images — suitable for document intelligence, UI analysis, and visual QA workflows.

Complex reasoning tasks
Adaptive thinking routes harder problems through an extended reasoning process, producing more reliable answers for multi-step math, logic, and technical analysis.

Claude Sonnet 5 vs. the Alternatives

  • Claude Sonnet 5: Best balance of quality and cost in the Claude family. Near-Opus performance at Sonnet price. Ideal for production workloads where both quality and cost matter.
  • Claude Opus 4: Maximum reasoning quality. Choose Opus when you need the best possible output on the most challenging tasks.
  • Claude Haiku 4.5: Fastest and most affordable Claude model. Choose Haiku for high-volume tasks where latency and cost are the primary priority.

‍

Uptime and performance

  • Uptime (24h): 100%
  • Uptime (7d): 100%
  • Availability (24h): 100%
  • Error rate (24h): 0%
  • End-to-end latency (24h median): 9.5s
  • Time to first token (24h median): 1.0s
  • Throughput (24h median): 43.4 tok/s

Measured on the AI/ML API gateway across live traffic. Figures are medians unless stated. Last updated 2026-10-12.

Use cases

Claude Sonnet 5 is documented as suited for coding workflows, including initial planning, implementation, debugging, maintenance, and large-scale refactors across complex multi-file codebases.

It is also suited for autonomous AI workflows and production-grade agents, with strong instruction following, tool selection, error correction, and sustained multi-step task handling for customer-facing agents and internal automation.

Another documented use case is browser-based computer use, where it can handle tasks such as competitive analysis, procurement workflows, and customer onboarding.

It is further suited to professional work involving finance, research, content, and business operations, including analyzing financial data, synthesizing information from multiple sources, and generating or editing documents and spreadsheets.

How to use Claude Sonnet 5 API

Install any OpenAI-compatible SDK, point it at api.aimlapi.com/v1, and set the model to anthropic/claude-sonnet-5.

import requests

r = requests.post(
   "https://api.aimlapi.com/v1/chat/completions",
   headers={"Authorization": "Bearer " + AIMLAPI_KEY},
   json={
     "model": "anthropic/claude-sonnet-5",
     "messages": [
       {
         "role": "user",
         "content": "Hello!"
       }
     ]
   },
)
print(r.json())

const r = await fetch("https://api.aimlapi.com/v1/chat/completions", {
 method: "POST",
 headers: {
   Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
   "Content-Type": "application/json",
 },
 body: JSON.stringify({
   "model": "anthropic/claude-sonnet-5",
   "messages": [
     {
       "role": "user",
       "content": "Hello!"
     }
   ]
 }),
});
console.log(await r.json());

curl -X POST https://api.aimlapi.com/v1/chat/completions \
 -H "Authorization: Bearer $AIMLAPI_KEY" \
 -H "Content-Type: application/json" \
 -d '{"model":"anthropic/claude-sonnet-5","messages":[{"role":"user","content":"Hello!"}]}'

OpenAI-compatible — swap the base URL and it works with your existing SDK.

Claude Sonnet 5 API Pricing

TypePrice
Input
$2 / 1M tokens
Output
$10 / 1M tokens
Cached input
$0.2 / 1M tokens

The full 1M context window is included at standard pricing. Free credits on signup.

Claude Sonnet 5 Benchmarks

BenchmarkScoreWhat it measuresSourceRetrieved
GPQA Diamond
96.2%
Google-proof graduate science questions (hardest subset)SourceJuly 8, 2026
OSWorld
81.2%
Computer-use across real desktop applicationsSourceJuly 8, 2026
SWE-bench Verified
85.2%
Resolving verified real GitHub issuesSourceJuly 8, 2026
Intelligence
38.4
Composite score across standardised reasoning, knowledge and problem-solving evaluations, measured independently by Artificial AnalysisSourceSeptember 12, 2026
Coding
71.5
Composite score across standardised coding evaluations, measured independently by Artificial AnalysisSourceSeptember 12, 2026

Use cases

Claude Sonnet 5 is documented as suited for coding workflows, including initial planning, implementation, debugging, maintenance, and large-scale refactors across complex multi-file codebases.

It is also suited for autonomous AI workflows and production-grade agents, with strong instruction following, tool selection, error correction, and sustained multi-step task handling for customer-facing agents and internal automation.

Another documented use case is browser-based computer use, where it can handle tasks such as competitive analysis, procurement workflows, and customer onboarding.

It is further suited to professional work involving finance, research, content, and business operations, including analyzing financial data, synthesizing information from multiple sources, and generating or editing documents and spreadsheets.

Claude Sonnet 5 vs other models

ModelInputOutputContextBest for
$2 / 1M tokens
$10 / 1M tokens
1M tokens
Balanced coding + agents
$1 / 1M tokens
$5 / 1M tokens
200K tokens
Chat + assistants
$5 / 1M tokens
$25 / 1M tokens
1M tokens
Chat + assistants
$1.75 / 1M tokens
$14 / 1M tokens
400K tokens
Reasoning + agents
$2 / 1M tokens
$6 / 1M tokens
500K tokens
Reasoning + agents with long context

Frequently asked questions

GPT-Image-1.5 is 4x Faster than the previous models – DALL-E 3 and GPT-Image-1. Detailed high resolution images now take near 30 seconds to be generated.

TTS-1-HD produces higher-fidelity audio with more natural prosody and tone, while TTS-1 is optimized for speed and lower cost.

GPT-Image-1.5 was released on December 16, 2025. OpenAI made the model available globally to all ChatGPT users and through the API on this date, marking a significant upgrade to their image generation capabilities.

It returns audio in mp3, opus, aac, flac, wav, pcm formats.

1. Register on our platform

2. Verify your account

3. Create an API key

4. Copy the code from this page

5. Paste it in your project

Start building with Claude Sonnet 5

Get API Key
1000+ models, one API.