Installation
Install the OpenAI package (xAI uses OpenAI-compatible API):Setup
Set your xAI API key as an environment variable:Initialize Model
Create an xAI model instance:Use with Agent
Pass the model to your agent:Configuration Options
Supported parameters for xAI models:For the full list of available models and parameters, see the xAI API documentation.