Skip to content

Grok 4

Grok 4 is xAI's high-capability Grok 4 reasoning model. It uses chain-of-thought reasoning for mathematics, science, and coding workloads with a context window of 256K tokens.

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