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: /docs/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 相容工具定義。 |