Moonshot AI
Moonshot 提供 Kimi API,其端點與 OpenAI 相容。設定
提供者並將預設模型設定為 moonshot/kimi-k2.6,或使用
Kimi Coding 與 kimi/kimi-for-coding。
內建模型目錄
Section titled “內建模型目錄”| 模型參照 | 名稱 | 推理 | 輸入 | 語境 | 最大輸出 |
|---|---|---|---|---|---|
moonshot/kimi-k2.6 | Kimi K2.6 | 否 | 文字、圖片 | 262,144 | 262,144 |
moonshot/kimi-k2.5 | Kimi K2.5 | 否 | 文字、圖片 | 262,144 | 262,144 |
moonshot/kimi-k2-thinking | Kimi K2 Thinking | 是 | 文字 | 262,144 | 262,144 |
moonshot/kimi-k2-thinking-turbo | Kimi K2 Thinking Turbo | 是 | 文字 | 262,144 | 262,144 |
moonshot/kimi-k2-turbo | Kimi K2 Turbo | 否 | 文字 | 256,000 | 16,384 |
目前 Moonshot 託管的 K2 模型的組合成本估計採用 Moonshot 發布的隨付費率:Kimi K2.6 為快取命中 $0.16/MTok,輸入 $0.95/MTok,輸出 $4.00/MTok;Kimi K2.5 為快取命中 $0.10/MTok,輸入 $0.60/MTok,輸出 $3.00/MTok。除非您在設定中覆寫,否則其他舊版目錄項目會保留零成本的預留位置。
選擇您的供應商並依照設定步驟操作。
最適用於: 透過 Moonshot 開放平台使用的 Kimi K2 模型。
選擇您的端點區域
Auth choice Endpoint Region moonshot-api-keyhttps://api.moonshot.ai/v1International moonshot-api-key-cnhttps://api.moonshot.cn/v1China 執行入門設定
Terminal window openclaw onboard --auth-choice moonshot-api-key或是針對中國端點:
Terminal window openclaw onboard --auth-choice moonshot-api-key-cn設定預設模型
{agents: {defaults: {model: { primary: "moonshot/kimi-k2.6" },},},}驗證模型是否可用
Terminal window openclaw models list --provider moonshot執行即時冒煙測試
當您想要驗證模型存取和成本追蹤,而又不想影響您正常的工作階段時,請使用獨立的狀態目錄:
Terminal window OPENCLAW_CONFIG_PATH=/tmp/openclaw-kimi/openclaw.json \OPENCLAW_STATE_DIR=/tmp/openclaw-kimi \openclaw agent --local \--session-id live-kimi-cost \--message 'Reply exactly: KIMI_LIVE_OK' \--thinking off \--jsonJSON 回應應該會回報
provider: "moonshot"和model: "kimi-k2.6"。當 Moonshot 回傳使用量中繼資料時,助理抄錄條目會在usage.cost下儲存標準化的 token 使用量加上估計成本。
{ env: { MOONSHOT_API_KEY: "sk-..." }, agents: { defaults: { model: { primary: "moonshot/kimi-k2.6" }, models: { // moonshot-kimi-k2-aliases:start "moonshot/kimi-k2.6": { alias: "Kimi K2.6" }, "moonshot/kimi-k2.5": { alias: "Kimi K2.5" }, "moonshot/kimi-k2-thinking": { alias: "Kimi K2 Thinking" }, "moonshot/kimi-k2-thinking-turbo": { alias: "Kimi K2 Thinking Turbo" }, "moonshot/kimi-k2-turbo": { alias: "Kimi K2 Turbo" }, // moonshot-kimi-k2-aliases:end }, }, }, models: { mode: "merge", providers: { moonshot: { baseUrl: "https://api.moonshot.ai/v1", apiKey: "${MOONSHOT_API_KEY}", api: "openai-completions", models: [ // moonshot-kimi-k2-models:start { id: "kimi-k2.6", name: "Kimi K2.6", reasoning: false, input: ["text", "image"], cost: { input: 0.95, output: 4, cacheRead: 0.16, cacheWrite: 0 }, contextWindow: 262144, maxTokens: 262144, }, { id: "kimi-k2.5", name: "Kimi K2.5", reasoning: false, input: ["text", "image"], cost: { input: 0.6, output: 3, cacheRead: 0.1, cacheWrite: 0 }, contextWindow: 262144, maxTokens: 262144, }, { id: "kimi-k2-thinking", name: "Kimi K2 Thinking", reasoning: true, input: ["text"], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 262144, maxTokens: 262144, }, { id: "kimi-k2-thinking-turbo", name: "Kimi K2 Thinking Turbo", reasoning: true, input: ["text"], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 262144, maxTokens: 262144, }, { id: "kimi-k2-turbo", name: "Kimi K2 Turbo", reasoning: false, input: ["text"], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 256000, maxTokens: 16384, }, // moonshot-kimi-k2-models:end ], }, }, },}最適合用於: 透過 Kimi Coding 端點處理程式碼相關任務。
執行引導設定
Terminal window openclaw onboard --auth-choice kimi-code-api-key設定預設模型
{agents: {defaults: {model: { primary: "kimi/kimi-for-coding" },},},}驗證模型是否可用
Terminal window openclaw models list --provider kimi
{ env: { KIMI_API_KEY: "sk-..." }, agents: { defaults: { model: { primary: "kimi/kimi-for-coding" }, models: { "kimi/kimi-for-coding": { alias: "Kimi" }, }, }, },}Kimi 網路搜尋
Section titled “Kimi 網路搜尋”OpenClaw 也隨附 Kimi 作為 web_search 提供者,並由 Moonshot 網路
搜尋提供支援。
執行互動式網路搜尋設定
Terminal window openclaw configure --section web在網路搜尋區段中選擇 Kimi 以儲存
plugins.entries.moonshot.config.webSearch.*。設定網路搜尋區域與模型
互動式設定會提示輸入:
設定 選項 API 區域 https://api.moonshot.ai/v1(國際) 或https://api.moonshot.cn/v1(中國)網路搜尋模型 預設為 kimi-k2.6
設定位於 plugins.entries.moonshot.config.webSearch 之下:
{ plugins: { entries: { moonshot: { config: { webSearch: { apiKey: "sk-...", // or use KIMI_API_KEY / MOONSHOT_API_KEY baseUrl: "https://api.moonshot.ai/v1", model: "kimi-k2.6", }, }, }, }, }, tools: { web: { search: { provider: "kimi", }, }, },}原生思考模式
Moonshot Kimi 支援二元的原生思考模式:
thinking: { type: "enabled" }thinking: { type: "disabled" }
請透過 `agents.defaults.models.
.params` 針對每個模型進行設定:
```json5{ agents: { defaults: { models: { "moonshot/kimi-k2.6": { params: { thinking: { type: "disabled" }, }, }, }, }, },}```
OpenClaw 也會為 Moonshot 對應執行階段的 `/think` 等級:
| `/think` 等級 | Moonshot 行為 || -------------------- | -------------------------- || `/think off` | `thinking.type=disabled` || 任何非 off 等級 | `thinking.type=enabled` |Kimi K2.6 也接受一個選用的 thinking.keep 欄位,用於控制
reasoning_content 的多輪保留。將其設定為 "all" 以在對話輪次之間保留完整的
推理過程;省略該欄位(或將其保留為 null)則使用伺服器
的預設策略。OpenClaw 僅會對
moonshot/kimi-k2.6 轉發 thinking.keep,並會從其他模型中移除該欄位。
{ agents: { defaults: { models: { "moonshot/kimi-k2.6": { params: { thinking: { type: "enabled", keep: "all" }, }, }, }, }, },}Tool call id 淨化
Moonshot Kimi 提供的 tool_call id 格式類似於 `functions.
:
`。OpenClaw 會原封不動地保留它們,以便多輪工具呼叫能正常運作。
若要在自訂的 OpenAI 相容供應商上強制執行嚴格的淨化,請設定 `sanitizeToolCallIds: true`:
```json5{ models: { providers: { "my-kimi-proxy": { api: "openai-completions", sanitizeToolCallIds: true, }, }, },}```串流使用量相容性
原生 Moonshot 端點(https://api.moonshot.ai/v1 和
https://api.moonshot.cn/v1)宣稱在共用的
openai-completions 傳輸上相容串流使用量。OpenClaw 會關閉端點功能,
因此指向相同原生 Moonshot 主機的相容自訂供應商 ID
會繼承相同的串流使用量行為。
透過隨附的 K2.6 定價,包含輸入、輸出
和快取讀取 Token 的串流使用量也會轉換為
/status、/usage full、/usage cost 和逐字稿備份會話
帳務的本地預估美元成本。
端點與模型參考參照
| 供應商 | 模型參考前綴 | 端點 | 認證環境變數 |
|---|---|---|---|
| Moonshot | moonshot/ | https://api.moonshot.ai/v1 | MOONSHOT_API_KEY |
| Moonshot CN | moonshot/ | https://api.moonshot.cn/v1 | MOONSHOT_API_KEY |
| Kimi Coding | kimi/ | Kimi Coding endpoint | KIMI_API_KEY |
| Web search | N/A | Same as Moonshot API region | KIMI_API_KEY 或 MOONSHOT_API_KEY |
- Kimi 網路搜尋使用
KIMI_API_KEY或MOONSHOT_API_KEY,並預設為https://api.moonshot.ai/v1且搭配模型kimi-k2.6。 - 如有需要,請在
models.providers中覆寫定價與內容中繼資料。 - 如果 Moonshot 發布了模型的不同內容限制,請相應調整
contextWindow。
選擇提供者、模型參考和故障轉移行為。
設定網路搜尋供應商,包括 Kimi。
供應商、模型和外掛程式的完整設定架構。
Moonshot API 金鑰管理與文件。