xai/grok-4.6
xAI 於 2026 年 8 月 12 日發布的 Grok 4.6,已由 Grok 4.7 接替。推理、Agent 編碼與工具呼叫能力強,500K token 上下文,透過 OpenAI 相容協定接入。
快取讀取 $0.075/M · 快取寫入 —/M
| 檔位 | 輸入 | 快取讀取 | 快取寫入 | 輸出 |
|---|---|---|---|---|
| Standard ≤200K | $0.3 | $0.075 | — | $0.9 |
| Standard >200K | $0.6 | $0.15 | — | $1.8 |
API 呼叫時用任一 ID 都可以。
xai/grok-4.6把 ONEHOP_KEY 佔位符替換為你的 API Key。 建立 →
from openai import OpenAI
client = OpenAI(
base_url="https://api.onehop.ai/v1",
api_key="<ONEHOP_KEY>",
)
completion = client.chat.completions.create(
model="xai/grok-4.6",
messages=[{"role": "user", "content": "What is the meaning of life?"}],
)
print(completion.choices[0].message.content)