Step-by-step guide for integrating Moonshot AI (Kimi) and Kimi Code models into Clawdbot. Use when someone asks how to add Kimi models, configure Moonshot AI, or set up Kimi for Coding in Clawdbot.
将 Moonshot AI (Kimi) 和 Kimi Code 模型添加到 Clawdbot 的完整指南。
Kimi 提供两个独立的模型系列:
两者都需要来自不同来源的 API 密钥。
注意: Moonshot 和 Kimi Code 使用不同的密钥和端点。
bash
export MOONSHOTAPIKEY=sk-your-moonshot-key-here
或添加到 .env 文件:
bash
echo MOONSHOTAPIKEY=sk-your-moonshot-key-here >> ~/.env
编辑您的 clawdbot.json 配置:
json5
{
agents: {
defaults: {
model: {
primary: moonshot/kimi-k2.5
}
}
},
models: {
mode: merge,
providers: {
moonshot: {
baseUrl: https://api.moonshot.cn/v1,
apiKey: ${MOONSHOTAPIKEY},
api: openai-completions,
models: [
{
id: moonlight-v1-32k,
name: Moonlight V1 32K,
contextWindow: 32768
},
{
id: moonshot-v1-8k,
name: Moonshot V1 8K,
contextWindow: 8192
},
{
id: moonshot-v1-32k,
name: Moonshot V1 32K,
contextWindow: 32768
},
{
id: moonshot-v1-128k,
name: Moonshot V1 128K,
contextWindow: 131072
},
{
id: kimi-k2.5,
name: Kimi K2.5,
contextWindow: 200000
}
]
}
}
}
}
bash
clawdbot gateway restart
bash
clawdbot models list
您应该会在列表中看到 Moonshot 模型。
设置为默认模型:
bash
clawdbot models set moonshot/kimi-k2.5
或在聊天中使用模型别名:
bash
/model moonshot/kimi-k2.5
bash
export KIMICODEAPIKEY=sk-your-kimicode-key-here
或添加到 .env 文件:
bash
echo KIMICODEAPIKEY=sk-your-kimicode-key-here >> ~/.env
编辑您的 clawdbot.json 配置:
json5
{
agents: {
defaults: {
model: {
primary: kimicode/kimi-for-coding
},
models: {
kimicode/kimi-for-coding: {
alias: kimi
}
}
}
},
models: {
mode: merge,
providers: {
kimicode: {
baseUrl: https://api.kimi.com/coding/v1,
apiKey: ${KIMICODEAPIKEY},
api: openai-completions,
models: [
{
id: kimi-for-coding,
name: Kimi For Coding,
contextWindow: 200000,
maxTokens: 8192
}
]
}
}
}
}
bash
clawdbot gateway restart
bash
clawdbot models list
您应该会在列表中看到 kimicode/kimi-for-coding。
设置为默认模型:
bash
clawdbot models set kimicode/kimi-for-coding
或在聊天中使用模型别名:
bash
/model kimi
您可以同时配置 Moonshot 和 Kimi Code:
json5
{
agents: {
defaults: {
model: {
primary: moonshot/kimi-k2.5
},
models: {
kimicode/kimi-for-coding: {
alias: kimi
},
moonshot/kimi-k2.5: {
alias: k25
}
}
}
},
models: {
mode: merge,
providers: {
moonshot: {
baseUrl: https://api.moonshot.cn/v1,
apiKey: ${MOONSHOTAPIKEY},
api: openai-completions,
models: [
{ id: kimi-k2.5, name: Kimi K2.5, contextWindow: 200000 }
]
},
kimicode: {
baseUrl: https://api.kimi.com/coding/v1,
apiKey: ${KIMICODEAPIKEY},
api: openai-completions,
models: [
{ id: kimi-for-coding, name: Kimi For Coding, contextWindow: 200000 }
]
}
}
}
}
使用别名在模型之间切换:
检查配置语法:
bash
clawdbot gateway config.get | grep -A 20 moonshot
验证 API 密钥是否已设置:
bash
echo $MOONSHOTAPIKEY
echo $KIMICODEAPIKEY
直接测试 API 端点:
bash
curl -X POST https://api.moonshot.cn/v1/chat/completions \
-H Authorization: Bearer $MOONSHOTAPIKEY \
-H Content-Type: application/json \
-d {model: kimi-k2.5, messages: [{role: user, content: test}]}
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 kimi-integration-1776381391 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 kimi-integration-1776381391 技能
skillhub install kimi-integration-1776381391
文件大小: 6.34 KB | 发布时间: 2026-4-17 13:47