AI Gateway

All Models/

Grok 2

Grok 2 by xAI

Grok 2 is a frontier language model with state-of-the-art reasoning capabilities. It features advanced capabilities in chat, coding, and reasoning, outperforming both Claude 3.5 Sonnet and GPT-4-Turbo on the LMSYS leaderboard.

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