Back to Models

Claude Sonnet 4

anthropicanthropic/claude-sonnet-4

Claude Sonnet 4 balances impressive performance for coding with the right speed and cost for high-volume use cases: Coding: Handle everyday development tasks with enhanced performance-power code reviews, bug fixes, API integrations, and feature development with immediate feedback loops. AI Assistants: Power production-ready assistants for real-time applicationsβ€”from customer support automation to operational workflows that require both intelligence and speed. Efficient research: Perform focused analysis across multiple data sources while maintaining fast response times. Ideal for rapid business intelligence, competitive analysis, and real-time decision support. Large-scale content: Generate and analyze content at scale with improved quality. Create customer communications, analyze user feedback, and produce marketing materials with the right balance of quality and throughput.

Claude Sonnet 4, released May 22 2025, is Anthropic's mid-tier hybrid reasoning model designed for high-volume production workloads. It delivers frontier-level coding (SWE-bench Verified 72.7 %, 80.2 % with high compute) and balanced reasoning at $3/$15 per million tokens, making it a practical drop-in upgrade from Sonnet 3.7 for everyday development, agentic sub-tasks, and real-time customer-facing applications.

From a TheRouter operator perspective the key operational features are the hybrid instant + extended-thinking modes, the 1 M context window (beta, retiring April 30 2026), and strong instruction-following that makes it reliable as a sub-agent within multi-agent systems. Sonnet 4 is succeeded by Sonnet 4.5 (late 2025) and Sonnet 4.6 (Feb 2026), both of which retain the same price tier while adding deeper long-context and computer-use capabilities.

Best for
  • β€’ High-volume code reviews, bug triage, and incremental feature development where $3/$15 pricing and fast iteration matter
  • β€’ Sub-agent roles inside Claude Code or multi-agent pipelines (search, retrieval, isolated refactors)
  • β€’ Production-grade customer support and internal productivity assistants that need strong instruction following and memory file capabilities
  • β€’ CI/CD automation and background GitHub Actions tasks via the Claude Code SDK
Reach for something else if
  • β€’ Long-horizon single-agent workflows spanning millions of tokens β€” route to Opus 4.x or Sonnet 4.6 for 1 M context + higher sustained coherence
  • β€’ Maximum coding frontier performance (SWE-bench >80 %) β€” Sonnet 4.6 or Opus 4.6/4.7 deliver higher scores at higher cost

How TheRouter serves this differently from the vendor

As the vendor operates it

Anthropic's lifecycle table lists the native Claude API id 'claude-sonnet-4-20250514' as retired on Anthropic-operated platforms after a 2026-04-14 deprecation notice and 2026-06-15 retirement date. Anthropic recommends migrating to 'claude-sonnet-4-6'.

On TheRouter

TheRouter still keeps the public model page and OpenAI-compatible id 'anthropic/claude-sonnet-4' for customers who need a stable reference, but new integrations should route to 'anthropic/claude-sonnet-4.6' because the upstream retirement can affect live availability and support guarantees.

Context Length
1M
Max Output
64K
Input Priceper 1M tokens
$3.24/ 1M tokens
Output Priceper 1M tokens
$16.20/ 1M tokens

Modalities

textimagepdf→text

Capabilities

Vision

Pricing Breakdown

TypeRate
Input$3.24 / 1M tokens
Output$16.20 / 1M tokens

Supported Parameters

temperaturemax_tokenstop_ptoolstool_choiceresponse_formatreasoningstop

Specifications

Release date2025-05-22www.anthropic.com β†—verified
Anthropic model idclaude-sonnet-4-20250514aws.amazon.com β†—verified
Training cutoffNot publicly disclosedunknown
Context window200 k standard; 1 M via context-1m-2025-08-07 beta (retiring 2026-04-30)platform.claude.com β†—verified
Max output tokens64 000www.anthropic.com β†—verified
Reasoning modesInstant responses (default) + extended thinking (up to 64 k tokens)www.anthropic.com β†—verified
DeploymentAnthropic API, Amazon Bedrock, Google Cloud Vertex AIaws.amazon.com β†—verified
LicenseAnthropic Usage Policy (proprietary, API-only)verified

Benchmarks

BenchmarkDistributionScoreSource
SWE-bench Verified
No extended thinking; high-compute parallel sampling reaches 80.2 %.
72.7%%www.anthropic.com β†—
GPQA Diamond
Without extended thinking; higher with extended thinking enabled.
70.0%%www.anthropic.com β†—
MMMLU
Without extended thinking.
85.4%%www.anthropic.com β†—
MMMU
Without extended thinking.
72.6%%www.anthropic.com β†—
AIME
Without extended thinking.
33.1%%www.anthropic.com β†—
OSWorld
Computer-use benchmark; Sonnet 4.5 later improved this to 61.4 %.
42.2%%www.anthropic.com β†—

API Usage Examples

Use the global api.therouter.ai endpoint shown below for new integrations; the legacy China accelerated endpoint is retired.

cURL
curl https://api.therouter.ai/v1/chat/completions   -H "Content-Type: application/json"   -H "Authorization: Bearer $THE_ROUTER_API_KEY"   -d '{
    "model": "anthropic/claude-sonnet-4",
    "messages": [
      {"role": "user", "content": "Summarize the key points from this input."}
    ]
  }'

Chat completion

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"anthropic/claude-sonnet-4","messages":[{"role":"user","content":"Hello"}]}'

More from anthropic

Similar models

Cross-provider sibling models

News & changes

2026-04-14

Anthropic deprecates Claude Sonnet 4 on the Claude API

Anthropic's deprecation table says Claude Sonnet 4 was deprecated on 2026-04-14 and retired on 2026-06-15, with Claude Sonnet 4.6 named as the replacement. Treat TheRouter's page as a compatibility reference, not a recommendation for new deployments.

2025-09-29

Claude Sonnet 4.5 released at the same $3/$15 Sonnet price tier

Anthropic introduced Sonnet 4.5 with stronger coding, computer-use, and long-horizon agent performance while keeping Sonnet 4's input/output price. It became the practical upgrade path before Sonnet 4.6 was named the retirement replacement.

re-authored by TheRouteranthropic.com/news β†—

Recent coverage

Frequently asked

Should I start a new TheRouter integration on Claude Sonnet 4?

No. Anthropic lists the native Sonnet 4 API model as retired and recommends Claude Sonnet 4.6. Keep Sonnet 4 only for compatibility checks, historical comparisons, or controlled migrations where you have already validated live upstream availability.

re-authored by TheRouterplatform.claude.com β†—
What changed since the original Sonnet 4 launch page?

The launch facts remain useful for capability history: Sonnet 4 shipped with hybrid instant plus extended thinking modes, $3/$15 pricing, 64k max output, and 72.7 % SWE-bench Verified. The lifecycle changed later: Anthropic retired the native API model and pointed users to Sonnet 4.6.

re-authored by TheRouterwww.anthropic.com β†—
Does TheRouter's OpenAI-compatible API surface change the Anthropic retirement status?

No. TheRouter can normalize request and response shape, model ids, and routing behavior, but it cannot turn a retired Anthropic-operated upstream into an active Anthropic model. Use the divergence note on this page to separate TheRouter compatibility from vendor lifecycle support.

re-authored by TheRouterplatform.claude.com β†—
Fact ledger β€” every claim on this page traces here
sourceURLretrieved
Release datewww.anthropic.com β†—2026-05-25verified
Anthropic model idaws.amazon.com β†—2026-05-25verified
Training cutoffβ€”β€”unknown
Context windowplatform.claude.com β†—2026-09-10verified
Max output tokenswww.anthropic.com β†—2026-05-25verified
Reasoning modeswww.anthropic.com β†—2026-05-25verified
Deploymentaws.amazon.com β†—2026-05-25verified
Licenseβ€”β€”verified
SWE-bench Verifiedwww.anthropic.com β†—2026-05-25verified
GPQA Diamondwww.anthropic.com β†—2026-05-25verified
MMMLUwww.anthropic.com β†—2026-05-25verified
MMMUwww.anthropic.com β†—2026-05-25verified
AIMEwww.anthropic.com β†—2026-05-25verified
OSWorldwww.anthropic.com β†—2026-05-25verified
Anthropic deprecates Claude Sonnet 4 on the Claude APIplatform.claude.com/model-deprecations β†—2026-09-10verified
Claude Sonnet 4.5 released at the same $3/$15 Sonnet price tieranthropic.com/news β†—2026-09-10verified
Should I start a new TheRouter integration on Claude Sonnet 4?platform.claude.com β†—2026-09-10to verify
What changed since the original Sonnet 4 launch page?www.anthropic.com β†—2026-09-10to verify
Does TheRouter's OpenAI-compatible API surface change the Anthropic retirement status?platform.claude.com β†—2026-09-10to verify
Help & contact