Skip to content

Claude Sonnet 4

Claude Sonnet 4 supports a context window of 1M tokens on Vercel AI Gateway, enabling full codebase analysis of 75,000+ lines or large document sets, while scoring 72.7% on SWE-bench Verified with hybrid extended thinking and enhanced steerability.

File InputReasoningTool UseVision (Image)Explicit Caching
index.ts
import { streamText } from 'ai'
const result = streamText({
model: 'anthropic/claude-sonnet-4',
prompt: 'Why is the sky blue?'
})

Providers

Route requests across multiple providers. Copy a provider slug to set your preference. Visit the docs for more info. Using a provider means you agree to their terms, listed under Legal.

Provider
Context
Latency
Throughput
Input
Output
Cache
Web Search
Per Query
Capabilities
ZDR
No Training
Release Date
Anthropic
Legal:Terms
Privacy
1M
0.9s
48tps
$3.00/M
$15.00/M
Read:
$0.3/M
Write:
$3.75/M
$10.00/K
+ input costs
05/22/2025
Amazon Bedrock
Legal:Terms
Privacy
1M
0.8s
78tps
$3.00/M
$15.00/M
Read:
$0.3/M
Write:
$3.75/M
05/22/2025
Google Vertex AI
Legal:Terms
Privacy
1M
0.7s
51tps
$3.00/M
$15.00/M
Read:
$0.3/M
Write:
$3.75/M
$10.00/K
+ input costs
05/22/2025