Skip to main content
xAI is a new AI company founded by Elon Musk that develops large language models, including Grok. Grok is trained on real-time data from X (formerly Twitter) and aims to provide accurate, up-to-date responses with a touch of wit and humor. In order to use LLMs from xAI, go to their platform and get the API key. Set the API key as XAI_API_KEY environment variable to use the model as given below in the example. You can also optionally set XAI_API_BASE to use a different API endpoint (defaults to https://api.x.ai/v1).

Usage

Config

All available parameters for the xai config are present in Master List of All Params in Config.