供应商简介: xAI — xAI 的 Grok 系列模型专为速度与现实推理任务打造,提供专用推理变体,专注于低延迟、高吞吐量的生产工作负载。
← 全部供应商
xAI
美国6 个模型Grok — 实时推理与 X 平台深度集成
xAI 的 Grok 系列模型专为速度与现实推理任务打造,提供专用推理变体,专注于低延迟、高吞吐量的生产工作负载。
- ✓Grok 4 和 3 系列,含专用推理和快速推理变体
- ✓低延迟、高吞吐量设计,适用于生产工作负载
- ✓Grok 4、Grok 4.1 Fast 支持视觉能力(图像理解)
- ✓全系列模型支持工具调用和 JSON 模式
推理视觉理解极速推理工具调用
快速开始
from openai import OpenAI
client = OpenAI(
base_url="https://api.therouter.ai/v1",
api_key="YOUR_THEROUTER_KEY",
)
response = client.chat.completions.create(
model="xai/grok-4",
messages=[{"role": "user", "content": "核聚变能源的当前进展如何?"}],
max_tokens=512,
)
print(response.choices[0].message.content)模型
Grok 3xAI's previous flagship model with 131K context window. Strong general-purpose performance with function calling and structured output support.Grok 3 MiniCost-efficient reasoning model from xAI with 131K context window. Ideal for tasks requiring reasoning at lower cost with function calling and structured output support.Grok 4xAI's most powerful reasoning model with 256K token context window. Excels at complex reasoning, coding, and multi-step problem solving with function calling and structured outputs.Grok 4.1 FastxAI's fastest model with 2M token context window. Optimized for speed without reasoning overhead, supporting text and image inputs with function calling and structured outputs.Grok 4.1 Fast ReasoningxAI's latest fast reasoning model with 2M token context window. Combines speed with strong reasoning capabilities, supporting text and image inputs with function calling and structured outputs.Grok Code Fast 1xAI's specialized coding model with reasoning capabilities. Optimized for code generation, analysis, and debugging tasks with function calling and structured outputs.
常见问题
TheRouter 提供哪些 xAI Grok 模型?
TheRouter 提供 Grok 4、Grok 3、Grok 3 Mini、Grok Code Fast 1、Grok 4.1 Fast Reasoning 和 Grok 4.1 Fast Non-Reasoning,均通过标准的 xai/模型名称 格式访问。
Grok 与 GPT-4o 相比,成本如何?
Grok 4.1 Fast 系列输入仅需 $0.20/百万 Token,远低于 GPT-4o。Grok 4 的定价与 Claude Sonnet 和 GPT-4o 相近。请查看定价页面获取最新费率。
TheRouter 是否支持 Grok 的推理模式?
支持。Grok 4.1 Fast Reasoning 和 Grok 3 Mini 具备推理能力。可传递标准 reasoning 参数,或直接使用专用推理模型变体。
TheRouter 如何连接 xAI?
TheRouter 通过专用的 xAI 供应商服务直接调用 xAI API。适配器采用原生 fetch(无 SDK 依赖),以最小化开销。