Claude Sonnet 4.0
Anthropic logo

Claude Sonnet 4.0

claude-sonnet-4-0
Anthropic
Claude Sonnet 4 is a significant upgrade to Sonnet 3.7, delivering superior performance in coding and reasoning with enhanced precision and control. Achieving a state-of-the-art 72.7% on SWE-bench, the model expertly balances advanced capability with computational efficiency. Key improvements include more reliable codebase navigation and complex instruction following, making it ideal for a wide range of applications, from routine coding to complex software development projects.

Pricing

TierPricingCache ReadWeb SearchCache Write 5 MinutesCache Write 1 Hour
Input<=200K
$3$15
$0.3/M tokens$0.01/request$3.75/M tokens$6/M tokens
200K<Input
$4$15
$0.4/M tokens$0.01/request$5/M tokens$8/M tokens

Input Modalities

  • Text
  • Vision

Output Modalities

  • Text

Capabilities

  • Thinking
  • Tools
  • Tool calling
  • Structured outputs

Providers

Anthropic claude-sonnet-4-20250514
Pricing$3$15
Cache Read$0.3/M tokens
Web Search$0.01/request
Cache Write 5 Minutes$3.75/M tokens
Cache Write 1 Hour$6/M tokens
Pricing$4$15
Cache Read$0.4/M tokens
Web Search$0.01/request
Cache Write 5 Minutes$5/M tokens
Cache Write 1 Hour$8/M tokens
Context1M
Max output64K
Latency2.1S
Throughput63.5TPS
Uptime
0.00% uptime 2 days ago
0.00% uptime yesterday
0.00% uptime today
AWS claude-sonnet-4-20250514
Pricing$3$15
Cache Read$0.3/M tokens
Web Search$0.01/request
Cache Write 5 Minutes$3.75/M tokens
Cache Write 1 Hour$6/M tokens
Pricing$4$15
Cache Read$0.4/M tokens
Web Search$0.01/request
Cache Write 5 Minutes$5/M tokens
Cache Write 1 Hour$8/M tokens
Context1M
Max output64K
Latency2.5S
Throughput72.5TPS
Uptime
0.00% uptime 2 days ago
0.00% uptime yesterday
0.00% uptime today

Performance for claude-sonnet-4-0

Uptime is the percentage of requests that succeeded over the past 72 hours. AIHubMix continuously monitors every provider and automatically retries with the next-best provider when one returns an error or responds too slowly; Latency is total round-trip time (lower is better); Throughput is how fast the model writes (tokens per second, higher is better).

Uptime
Loading...
Latency
Loading...
Throughput
Loading...

Try this model

Python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["AIHUBMIX_API_KEY"],
    base_url="https://shkq.org/v1",
)

response = client.chat.completions.create(
    model="claude-sonnet-4-0",
    messages=[
      {
        "role": "user",
        "content": "Hello, how are you?"
      }
    ],
    max_tokens=1024,
    stream=False,
)

print(response.choices[0].message.content)

Frequently asked questions

What is Claude Sonnet 4.0?

Claude Sonnet 4 is a significant upgrade to Sonnet 3.7, delivering superior performance in coding and reasoning with enhanced precision and control. Achieving a state-of-the-art 72.7% on SWE-bench, the model expertly balances advanced capability with computational efficiency. Key improvements include more reliable codebase navigation and complex instruction following, making it ideal for a wide range of applications, from routine coding to complex software development projects.