Skip to main content
xAI provides the Grok family of large language models. See their list of models here. We recommend experimenting to find the best-suited model for your use-case. The default grok-4-1-fast-non-reasoning-latest model is good for most use-cases.

Installation

Authentication

Set your XAI_API_KEY environment variable. You can get one from xAI here.

Example

Use xAI with your Agent:
xAI models support live search capabilities that can access real-time information:
View more examples here.

Parameters

xAI also supports the params of OpenAI.