Skip to main content
This page makes reference to Grok models provided by xAI - not to be confused with Groq, a separate AI hardware and software company. See the Groq provider page.
xAI offers an API to interact with Grok models. This example goes over how to use LangChain to interact with xAI models.

Installation

Environment

To use xAI, you’ll need to create an API key. The API key can be passed in as an init param xai_api_key or set as environment variable XAI_API_KEY.

Example

See ChatXAI docs for detail and supported features.