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

About Grok 4

Grok 4 is xAI's full-scale Grok 4 reasoning model, released July 9, 2025. It represents a generational advancement over Grok 3, with substantial improvements in reasoning depth, instruction following, and scores on published benchmarks. The model builds on xAI's Colossus training infrastructure.

Grok 4 targets tasks that need extended multi-step reasoning, including competition-level mathematics, graduate-level science questions, and complex software engineering challenges. It produces detailed chain-of-thought traces you can inspect, which suits workflows where you need to verify reasoning steps.

The model supports a context window of 256K tokens and up to 256K tokens per response. It's available through Vercel AI Gateway at $3.0 per million input tokens and $15.0 per million output tokens. For lower latency, the Grok 4 Fast variants offer speed-optimized alternatives.