AI Gateway

All Models/

Claude Sonnet 4

Claude Sonnet 4 by Anthropic

Claude Sonnet 4 significantly improves on Sonnet 3.7's industry-leading capabilities, excelling in coding with a state-of-the-art 72.7% on SWE-bench. The model balances performance and efficiency for internal and external use cases, with enhanced steerability for greater control over implementations. While not matching Opus 4 in most domains, it delivers an optimal mix of capability and practicality.

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