Menu

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

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

Vercel News·Walter Korman·5 months ago
#I4iZU5Z0
#vercel#gateway#anthropic#model#claude
Reading 0:00
15s threshold

You can now leverage Claude Sonnet 4's updated 1 million-token context window with Vercel's AI Gateway with no other provider accounts required. This release from Anthropic enables significantly larger inputs such as full codebases (~75,000+ lines) or large document sets.

AI Gateway lets you call the model with a consistent unified API and just a single string update, track usage and cost, and configure performance optimizations, retries, and failover for higher than provider-average uptime.

To use it with the AI SDK v5 , start by installing the package:

Then set the model to anthropic/claude-4-sonnet :

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.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.