Skip to main content
xAI’s Grok models are frontier reasoning models with strong real-time knowledge, long context windows, and good tool-use performance. Grok 4 is the right pick when you need an alternative to GPT-5.4 or Claude Opus with comparable capability.

Installation

Environment Setup

Get an API key at console.x.ai.

Quick Start

xAI models use the xai/ prefix:

Model Names

Grok 4 — Frontier Reasoning

For your hardest analytical and planning tasks:

Tool Use

Grok supports function calling:

Streaming

Multi-Provider Pipeline

Mix Grok with other models — for example, Grok for research and Claude for synthesis:

Production Defaults

Next Steps