xAI is an artificial intelligence company that develops Large Language Models (LLMs). Their flagship model, Grok, is trained on real-time X (formerly Twitter) data and aims to provide witty, personality-rich responses while maintaining high capability on technical tasks. 本指南将帮助你开始使用Documentation Index
Fetch the complete documentation index at: https://nvd-54.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
ChatXAI chat models。有关所有 ChatXAI 功能和配置的详细文档,请前往 API 参考。
概述
集成详情
| Class | Package | Serializable | PY support | Downloads | Version |
|---|---|---|---|---|---|
ChatXAI | @langchain/xai | ✅ | ❌ |
模型功能
请参阅下表标题中的链接,了解如何使用特定功能。| Tool calling | Structured output | Image input | Audio input | Video input | Token-level streaming | Token usage | Logprobs |
|---|---|---|---|---|---|---|---|
| ✅ | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ |
设置
要访问ChatXAI models,你需要create an xAI account, get an API key, and install the @langchain/xai integration package.
凭证
前往 the xAI website 注册 xAI 并生成 API 密钥。完成后设置XAI_API_KEY 环境变量:
安装
LangChain 的ChatXAI 集成位于 @langchain/xai 包中:
实例化
现在我们可以实例化模型对象并生成聊天补全:调用
API 参考
有关所有ChatXAI 功能和配置的详细文档,请前往 API 参考。
将这些文档连接到 Claude、VSCode 等工具,通过 MCP 获取实时答案。

