xAI develops Grok chat models. See the xAI model documentation for available model IDs. This guide will help you getting started withDocumentation Index
Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-naomid-1779801766-572e290.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
ChatXAI chat models. For detailed documentation of all ChatXAI features and configurations head to the API reference.
Overview
Integration details
| Class | Package | Serializable | PY support | Downloads | Version |
|---|---|---|---|---|---|
ChatXAI | @langchain/xai | ✅ | ✅ |
Model features
See the links in the table headers below for guides on how to use specific features.| Tool calling | Structured output | Image input | Audio input | Video input | Token-level streaming | Token usage | Logprobs |
|---|---|---|---|---|---|---|---|
| ✅ | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ |
Setup
To accessChatXAI models, create an xAI account, get an API key, and install the @langchain/xai integration package.
Credentials
Head to the xAI website to sign up and generate an API key. Set theXAI_API_KEY environment variable:
Installation
The LangChainChatXAI integration lives in the @langchain/xai package:
Instantiation
Now we can instantiate our model object and generate chat completions:Invocation
API reference
For detailed documentation of allChatXAI features and configurations head to the API reference.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

