返回顶部
k

kimi-integrationKimi集成指南

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.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
3,411
下载量
免费
免费
5
收藏
概述
安装方式
版本历史

kimi-integration

Kimi 模型集成

将 Moonshot AI (Kimi) 和 Kimi Code 模型添加到 Clawdbot 的完整指南。

概述

Kimi 提供两个独立的模型系列:

  1. 1. Moonshot AI (Kimi K2) - 通过兼容 OpenAI 的 API 提供通用模型
  2. Kimi Code - 具有专用端点的专门编码模型

两者都需要来自不同来源的 API 密钥。

前提条件

  • - 已安装并配置 Clawdbot
  • API 密钥(参见获取 API 密钥部分)

获取 API 密钥

Moonshot AI (Kimi K2)

  1. 1. 访问 https://platform.moonshot.cn
  2. 注册账户
  3. 导航至 API 密钥部分
  4. 创建新的 API 密钥
  5. 复制密钥(以 sk-... 开头)

Kimi Code

  1. 1. 访问 https://api.kimi.com/coding
  2. 注册账户
  3. 导航至 API 密钥部分
  4. 创建新的 API 密钥
  5. 复制密钥(以 sk-... 开头)

注意: Moonshot 和 Kimi Code 使用不同的密钥和端点。

集成步骤

选项 1:Moonshot AI (Kimi K2 模型)

步骤 1:设置环境变量

bash
export MOONSHOTAPIKEY=sk-your-moonshot-key-here

或添加到 .env 文件:

bash
echo MOONSHOTAPIKEY=sk-your-moonshot-key-here >> ~/.env

步骤 2:添加提供商配置

编辑您的 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
}
]
}
}
}
}

步骤 3:重启 Clawdbot

bash
clawdbot gateway restart

步骤 4:验证集成

bash
clawdbot models list

您应该会在列表中看到 Moonshot 模型。

步骤 5:使用模型

设置为默认模型:
bash
clawdbot models set moonshot/kimi-k2.5

或在聊天中使用模型别名:
bash
/model moonshot/kimi-k2.5

选项 2:Kimi Code(专门编码模型)

步骤 1:设置环境变量

bash
export KIMICODEAPIKEY=sk-your-kimicode-key-here

或添加到 .env 文件:

bash
echo KIMICODEAPIKEY=sk-your-kimicode-key-here >> ~/.env

步骤 2:添加提供商配置

编辑您的 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
}
]
}
}
}
}

步骤 3:重启 Clawdbot

bash
clawdbot gateway restart

步骤 4:验证集成

bash
clawdbot models list

您应该会在列表中看到 kimicode/kimi-for-coding。

步骤 5:使用模型

设置为默认模型:
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 }
]
}
}
}
}

使用别名在模型之间切换:

  • - /model k25 - Kimi K2.5(通用)
  • /model kimi - Kimi for Coding(专门)

故障排除

模型未出现在列表中

检查配置语法:
bash
clawdbot gateway config.get | grep -A 20 moonshot

验证 API 密钥是否已设置:
bash
echo $MOONSHOTAPIKEY
echo $KIMICODEAPIKEY

身份验证错误

  • - 验证 API 密钥以 sk- 开头
  • 在提供商仪表板上检查密钥是否有效
  • 确保每个提供商的 base URL 正确

连接问题

直接测试 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}]}

模型推荐

  • - Kimi K2.5 (moonshot/kimi-k2.5) - 最适合通用任务,200K 上下文
  • Kimi for Coding (kimicode/kimi-for-coding) - 专门用于代码生成
  • Moonshot V1 128K (moonshot/moonshot-v1-128k) - 旧版模型,128K 上下文

参考

  • - Moonshot AI 文档:https://platform.moonshot.cn/docs
  • Kimi Code API:https://api.kimi.com/coding/docs
  • Clawdbot 模型提供商:/home/eyurc/clawdbot/docs/concepts/model-providers.md

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 kimi-integration-1776381391 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 kimi-integration-1776381391 技能

通过命令行安装

skillhub install kimi-integration-1776381391

下载

⬇ 下载 kimi-integration v1.0.0(免费)

文件大小: 6.34 KB | 发布时间: 2026-4-17 13:47

v1.0.0 最新 2026-4-17 13:47
Initial release: Moonshot AI (Kimi K2.5) and Kimi Code integration guide for Clawdbot

Archiver·手机版·闲社网·闲社论坛·智能体自动化市场· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2026 闲社网·AI智能体论坛·AI自动化解决方案·http://xianshe.com

p2p_official_large
返回顶部