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.6 / 1M tokens
Output
$13 / 1M tokens
Released
Jun 30, 2026

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.6 / 1M tokens
Output
$13 / 1M tokens
Cached input
$0.26 / 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

Source: Anthropic model card.

Claude Sonnet 5 vs other models

ModelInputOutputContextBest for
$2.6 / 1M tokens
$13 / 1M tokens
1M tokens
Balanced coding + agents
$1.3754 / 1M tokens
$6.5 / 1M tokens
200K tokens
Chat + assistants
$6.877 / 1M tokens
$32.5 / 1M tokens
1M tokens
Chat + assistants
$2.275 / 1M tokens
$18.2 / 1M tokens
400K tokens
Reasoning + agents
$2.6 / 1M tokens
$7.8 / 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.