Skip to content
Dashboard

Claude Sonnet 4 now supports 1M token context in Vercel AI Gateway

, Sam Chitgopekar,
pnpm i ai

import { streamText } from 'ai';
import { largePrompt } from './largePrompt.ts';
const result = streamText({
headers: {
'anthropic-beta': 'context-1m-2025-08-07',
},
model: 'anthropic/claude-4-sonnet',
prompt: `You have a big brain. Summarize into 3 sentences: ${largePrompt}`,
providerOptions: {
gateway: { only: ['anthropic'] },
},
});

AI Gateway: Track top AI models by usage

The AI Gateway model leaderboard tracks the most popular models over time, ranking them by the total volume of tokens processed across all Gateway traffic.

View the leaderboard

Ready to deploy?