ChatXAI
chat models. For detailed documentation of all ChatXAI
features and configurations head to the API reference.
Overview
Integration details
Class | Package | Local | 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 | JSON mode | Image input | Audio input | Video input | Token-level streaming | Token usage | Logprobs |
---|---|---|---|---|---|---|---|---|
✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ |
Setup
To accessChatXAI
models you’ll need to create an xAI account, get an API key, and install the @langchain/xai
integration package.
Credentials
Head to the xAI website to sign up to xAI and generate an API key. Once you’ve done this set theXAI_API_KEY
environment variable:
Installation
The LangChainChatXAI
integration lives in the @langchain/xai
package: