Skip to main content
xAI provides access to Grok logic and vision models through an OpenAI-compatible API.

Setup

Set your API key as an environment variable:
Get your API key from xAI Console.

Usage

Available Models

See the xAI models documentation for a full list.

Provider Options

Customize parameters:

Tool Calling

Tool calling is fully supported:

Streaming