Kilo CLI
Kilo CLI 是 Kilo Code 的命令列用戶端,可以通過隨用隨付、Coding Plan 或 Token Plan 團隊版接入阿里雲百鍊。
安裝 Kilo CLI
-
安裝 Node.js(v18.0 或更高版本)。
-
在終端中執行以下命令安裝 Kilo CLI:
npm install -g @kilocode/cli運行以下命令驗證安裝。若有版本號碼輸出,則表示安裝成功。
kilo --version
配置接入憑證
使用文字編輯器開啟設定檔 ~/.config/kilo/config.json,根據所選方案寫入對應配置:
-
Token Plan 團隊版:按坐席訂閱,按 token 消耗抵扣 Credits。
-
Coding Plan:固定月費訂閱,按模型調用次數計量。
-
隨用隨付:按實際調用量後付費。
Token Plan 團隊版
需先購買 Token Plan 團隊版套餐且套餐處於有效期間內。可在Token Plan 團隊版頁面購買套餐。
將 YOUR_API_KEY 替換為 Token Plan 團隊版專屬 API Key。可用模型請參考 Token Plan 團隊版支援的模型。
{
"$schema": "https://kilo.ai/config.json",
"provider": {
"bailian-token-plan": {
"npm": "@ai-sdk/openai-compatible",
"name": "Alibaba Cloud Model Studio",
"options": {
"baseURL": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
"apiKey": "YOUR_API_KEY"
},
"models": {
"qwen3.7-max": {
"name": "Qwen3.7 Max",
"options": {
"thinking": {
"type": "enabled",
"budgetTokens": 8192
}
}
},
"qwen3.7-plus": {
"name": "Qwen3.7 Plus",
"options": {
"thinking": {
"type": "enabled",
"budgetTokens": 8192
}
}
},
"qwen3.6-plus": {
"name": "Qwen3.6 Plus",
"options": {
"thinking": {
"type": "enabled",
"budgetTokens": 8192
}
}
},
"qwen3.6-flash": {
"name": "Qwen3.6 Flash",
"options": {
"thinking": {
"type": "enabled",
"budgetTokens": 8192
}
}
},
"deepseek-v4-pro": {
"name": "DeepSeek V4 Pro"
},
"deepseek-v4-flash": {
"name": "DeepSeek V4 Flash"
},
"deepseek-v3.2": {
"name": "DeepSeek V3.2"
},
"kimi-k2.7-code": {
"name": "Kimi K2.7 Code",
"options": {
"thinking": {
"type": "enabled",
"budgetTokens": 8192
}
}
},
"kimi-k2.6": {
"name": "Kimi K2.6",
"options": {
"thinking": {
"type": "enabled",
"budgetTokens": 8192
}
}
},
"kimi-k2.5": {
"name": "Kimi K2.5",
"options": {
"thinking": {
"type": "enabled",
"budgetTokens": 8192
}
}
},
"glm-5.2": {
"name": "GLM-5.2",
"options": {
"thinking": {
"type": "enabled",
"budgetTokens": 8192
}
}
},
"glm-5.1": {
"name": "GLM-5.1",
"options": {
"thinking": {
"type": "enabled",
"budgetTokens": 8192
}
}
},
"glm-5": {
"name": "GLM-5",
"options": {
"thinking": {
"type": "enabled",
"budgetTokens": 8192
}
}
},
"MiniMax-M2.5": {
"name": "MiniMax M2.5"
}
}
}
}
}
Coding Plan
將 YOUR_API_KEY 替換為 Coding Plan 專屬 API Key。可用模型請參考 Coding Plan 支援的模型。
{
"$schema": "https://kilo.ai/config.json",
"provider": {
"bailian-coding-plan": {
"npm": "@ai-sdk/anthropic",
"name": "Alibaba Cloud Model Studio",
"options": {
"baseURL": "https://coding-intl.dashscope.aliyuncs.com/apps/anthropic/v1",
"apiKey": "YOUR_API_KEY"
},
"models": {
"qwen3.7-plus": {
"name": "Qwen3.7 Plus",
"options": {
"thinking": {
"type": "enabled",
"budgetTokens": 1024
}
}
},
"qwen3.6-plus": {
"name": "Qwen3.6 Plus",
"options": {
"thinking": {
"type": "enabled",
"budgetTokens": 1024
}
}
},
"qwen3.5-plus": {
"name": "Qwen3.5 Plus",
"options": {
"thinking": {
"type": "enabled",
"budgetTokens": 1024
}
}
},
"qwen3-max-2026-01-23": {
"name": "Qwen3 Max 0123"
},
"qwen3-coder-next": {
"name": "Qwen3 Coder Next"
},
"qwen3-coder-plus": {
"name": "Qwen3 Coder Plus"
},
"MiniMax-M2.5": {
"name": "MiniMax M2.5"
},
"glm-5": {
"name": "GLM-5",
"options": {
"thinking": {
"type": "enabled",
"budgetTokens": 1024
}
}
},
"glm-4.7": {
"name": "GLM-4.7"
},
"kimi-k2.5": {
"name": "Kimi K2.5",
"options": {
"thinking": {
"type": "enabled",
"budgetTokens": 1024
}
}
}
}
}
}
}
隨用隨付
將 YOUR_API_KEY 替換為阿里雲百鍊 API Key。可用模型請參考OpenAI 相容 - 支援的模型。
baseURL 按地區設定,API Key 需與所選地區對應:
-
華北2(北京):
https://dashscope.aliyuncs.com/compatible-mode/v1 -
新加坡:
https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1,請將WorkspaceId替換為真實的擷取Workspace ID -
美國(維吉尼亞):
https://dashscope-us.aliyuncs.com/compatible-mode/v1
{
"$schema": "https://kilo.ai/config.json",
"provider": {
"bailian": {
"npm": "@ai-sdk/openai-compatible",
"name": "Alibaba Cloud Model Studio",
"options": {
"baseURL": "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
"apiKey": "YOUR_API_KEY"
},
"models": {
"qwen3.7-plus": {
"name": "Qwen3.7 Plus",
"options": {
"thinking": {
"type": "enabled",
"budgetTokens": 1024
}
}
},
"qwen3.6-plus": {
"name": "Qwen3.6 Plus",
"options": {
"thinking": {
"type": "enabled",
"budgetTokens": 1024
}
}
}
}
}
}
}
如需添加其他模型,在 models 中以相同格式追加即可。
驗證配置
儲存配置後,重啟 Kilo CLI,輸入 /models,搜尋 Alibaba Cloud Model Studio,選擇需要使用的模型即可開始對話。
更多提示及常見命令請參考 Kilo Code 官方文檔。
常見問題
錯誤碼
配置過程中遇到報錯,請參考對應計費方案的常見問題文檔:
-
隨用隨付:錯誤碼
-
Coding Plan:Coding Plan 常見問題
-
Token Plan 團隊版:Token Plan 團隊版常見問題