AI Gateway

All Models/

Grok 4

Grok 4 by xAI

xAI's latest and greatest flagship model, offering unparalleled performance in natural language, math and reasoning - the perfect jack of all trades.

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