grok-4.6。
核心能力
- 50 万上下文 - 适合大型代码仓库与长程任务
- 多模态输入 - 支持文本与图像输入
- 代理式推理 - 支持可调推理与函数调用
- 结构化输出 - 可按指定结构返回结果
- OpenAI 兼容 - MixRoute 同时支持 Chat Completions 与 Responses
下方示例使用 Chat Completions。MixRoute 也通过 OpenAI 兼容的 Responses 端点提供此模型。
快速示例
- cURL
- Python
- Streaming
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Grok 4.6:xAI 面向编程、代理任务和知识工作的旗舰模型。包含 MixRoute 调用示例与参数。
grok-4.6。
curl "https://api.mixroute.ai/v1/chat/completions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-4.6",
"messages": [
{
"role": "user",
"content": "Explain quantum entanglement in simple terms."
}
],
"max_tokens": 256
}'
from openai import OpenAI
client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.mixroute.ai/v1")
response = client.chat.completions.create(
model="grok-4.6",
messages=[{"role": "user", "content": "Explain quantum entanglement in simple terms."}],
max_tokens=256,
)
print(response.choices[0].message.content)
from openai import OpenAI
client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.mixroute.ai/v1")
stream = client.chat.completions.create(
model="grok-4.6",
messages=[{"role": "user", "content": "Write a short poem about the sea."}],
max_tokens=256,
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 固定为 grok-4.6。 |
messages | array | 是 | 包含 role 与 content 的对话消息。 |
max_tokens | integer | 否 | 最大生成 token 数。 |
stream | boolean | 否 | 启用 SSE 流式输出,默认 false。 |
temperature | number | 否 | 模型支持时用于控制采样随机性。 |
top_p | number | 否 | 模型支持时使用的核采样阈值。 |
stop | string | array | 否 | 触发停止生成的序列。 |
tools | array | 否 | OpenAI 兼容工具定义。 |