GEO

Grok-1:xAI旗舰大语言模型,提供未经筛选的原始智能与API兼容性

2026/1/26
Grok-1:xAI旗舰大语言模型,提供未经筛选的原始智能与API兼容性
AI Summary (BLUF)

Grok-1 is xAI's flagship LLM offering unfiltered insights and raw intelligence, with API compatibility for easy migration from OpenAI and Anthropic. (Grok-1是xAI的旗舰大语言模型,提供未经筛选的见解和原始智能,其API兼容OpenAI和Anthropic,便于快速迁移。)

Welcome to the xAI Developer Documentation! Our API empowers you to seamlessly integrate the intelligence of Grok into your projects. Grok is our flagship AI model, engineered to deliver truthful and insightful answers. Ready to start building? Proceed to the Hitchhiker's Guide to Grok for a step-by-step introduction.

欢迎使用 xAI 开发者文档!我们的 API 使您能够轻松地将 Grok 的智能集成到您的项目中。Grok 是我们的旗舰 AI 模型,旨在提供真实且有洞察力的答案。准备好开始构建了吗?请前往《Grok 漫游指南》获取分步介绍。

Model Features

xAI offers a suite of powerful models tailored for different tasks.

grok-2-1212

Our flagship Large Language Model (LLM) provides unfiltered insights and raw intelligence for complex reasoning and text generation.

grok-2-1212
我们的旗舰大型语言模型(LLM),为复杂的推理和文本生成提供未经筛选的见解和原始智能。

grok-2-vision-1212

Our latest multimodal LLM excels at understanding and interpreting a wide range of visual inputs, including documents, photographs, and diagrams.

grok-2-vision-1212
我们最新的多模态大型语言模型,擅长理解和解释各种视觉输入,包括文档、照片和图表。

Quick Start Guide

Unlocking the Secrets of the Universe: API Access

To access Grok models via the API, you must first create an xAI account and generate an API key. This key authenticates your requests and manages your usage.

解锁宇宙的秘密:API 访问
要通过 API 访问 Grok 模型,您必须首先创建一个 xAI 帐户并生成一个 API 密钥。此密钥用于验证您的请求并管理您的使用情况。

Migrating from Other LLM Providers?

The xAI API is designed for compatibility with popular SDKs from OpenAI and Anthropic. You can switch to using Grok in just a few lines of code by simply updating the base_url, api_key, and model parameters.

从其他 LLM 提供商迁移?
xAI API 设计为与 OpenAI 和 Anthropic 的流行 SDK 兼容。您只需更新 base_urlapi_keymodel 参数,即可用几行代码切换到使用 Grok。

OpenAI SDK Compatibility

from openai import OpenAI

client = OpenAI(
  api_key="XAI_API_KEY", # Your xAI API key
  base_url="https://api.x.ai/v1",
)

completion = client.chat.completions.create(
  model="grok-2-latest", # Specify your desired Grok model
  messages=[
    {"role": "user", "content": "Explain quantum entanglement."}
  ]
)

OpenAI SDK 兼容性示例
上述代码展示了如何使用 OpenAI Python SDK 的格式来调用 xAI 的 Grok 模型,仅需更改端点、密钥和模型名称。

Anthropic SDK Compatibility

from anthropic import Anthropic

client = Anthropic(
  api_key="XAI_API_KEY", # Your xAI API key
  base_url="https://api.x.ai", # Note the slightly different base URL
)
# Use the client with Grok models as you would with Claude

Anthropic SDK 兼容性示例
此示例展示了如何配置 Anthropic Python SDK 以连接 xAI API,请注意基础 URL 的细微差别。

For more detailed migration instructions and parameter mappings, please refer to the dedicated Migration from Other Providers guide.

有关更详细的迁移说明和参数映射,请参阅专门的 从其他提供商迁移 指南。

Support and Feedback

If you encounter any issues or have feedback to help us improve, please don't hesitate to reach out via email at support@x.ai.

如果您遇到任何问题,或有反馈意见帮助我们改进,请随时通过电子邮件 support@x.ai 与我们联系。

Happy Grokking! 😎

祝您使用愉快!😎

← 返回文章列表
分享到:微博

版权与免责声明:本文仅用于信息分享与交流,不构成任何形式的法律、投资、医疗或其他专业建议,也不构成对任何结果的承诺或保证。

文中提及的商标、品牌、Logo、产品名称及相关图片/素材,其权利归各自合法权利人所有。本站内容可能基于公开资料整理,亦可能使用 AI 辅助生成或润色;我们尽力确保准确与合规,但不保证完整性、时效性与适用性,请读者自行甄别并以官方信息为准。

若本文内容或素材涉嫌侵权、隐私不当或存在错误,请相关权利人/当事人联系本站,我们将及时核实并采取删除、修正或下架等处理措施。 也请勿在评论或联系信息中提交身份证号、手机号、住址等个人敏感信息。