← 返回 Skills 市场
evgyur

Kimi Integration

作者 evgyur · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
3513
总下载
5
收藏
12
当前安装
1
版本数
在 OpenClaw 中安装
/install kimi-integration
功能描述
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.
使用说明 (SKILL.md)

Kimi Model Integration

Complete guide for adding Moonshot AI (Kimi) and Kimi Code models to Clawdbot.

Overview

Kimi offers two separate model families:

  1. Moonshot AI (Kimi K2) - General-purpose models via OpenAI-compatible API
  2. Kimi Code - Specialized coding model with dedicated endpoint

Both require API keys from different sources.

Prerequisites

  • Clawdbot installed and configured
  • API keys (see Getting API Keys section)

Getting API Keys

Moonshot AI (Kimi K2)

  1. Visit https://platform.moonshot.cn
  2. Register an account
  3. Navigate to API Keys section
  4. Create a new API key
  5. Copy the key (starts with sk-...)

Kimi Code

  1. Visit https://api.kimi.com/coding
  2. Register an account
  3. Navigate to API Keys section
  4. Create a new API key
  5. Copy the key (starts with sk-...)

Note: Moonshot and Kimi Code use separate keys and endpoints.

Integration Steps

Option 1: Moonshot AI (Kimi K2 models)

Step 1: Set environment variable

export MOONSHOT_API_KEY="sk-your-moonshot-key-here"

Or add to .env file:

echo 'MOONSHOT_API_KEY="sk-your-moonshot-key-here"' >> ~/.env

Step 2: Add provider configuration

Edit your clawdbot.json config:

{
  "agents": {
    "defaults": {
      "model": {
        "primary": "moonshot/kimi-k2.5"
      }
    }
  },
  "models": {
    "mode": "merge",
    "providers": {
      "moonshot": {
        "baseUrl": "https://api.moonshot.cn/v1",
        "apiKey": "${MOONSHOT_API_KEY}",
        "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
          }
        ]
      }
    }
  }
}

Step 3: Restart Clawdbot

clawdbot gateway restart

Step 4: Verify integration

clawdbot models list

You should see Moonshot models in the list.

Step 5: Use the model

Set as default:

clawdbot models set moonshot/kimi-k2.5

Or use model aliases in chat:

/model moonshot/kimi-k2.5

Option 2: Kimi Code (specialized coding model)

Step 1: Set environment variable

export KIMICODE_API_KEY="sk-your-kimicode-key-here"

Or add to .env:

echo 'KIMICODE_API_KEY="sk-your-kimicode-key-here"' >> ~/.env

Step 2: Add provider configuration

Edit your clawdbot.json config:

{
  "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": "${KIMICODE_API_KEY}",
        "api": "openai-completions",
        "models": [
          {
            "id": "kimi-for-coding",
            "name": "Kimi For Coding",
            "contextWindow": 200000,
            "maxTokens": 8192
          }
        ]
      }
    }
  }
}

Step 3: Restart Clawdbot

clawdbot gateway restart

Step 4: Verify integration

clawdbot models list

You should see kimicode/kimi-for-coding in the list.

Step 5: Use the model

Set as default:

clawdbot models set kimicode/kimi-for-coding

Or use model alias in chat:

/model kimi

Using Both Providers

You can configure both Moonshot and Kimi Code simultaneously:

{
  "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": "${MOONSHOT_API_KEY}",
        "api": "openai-completions",
        "models": [
          { "id": "kimi-k2.5", "name": "Kimi K2.5", "contextWindow": 200000 }
        ]
      },
      "kimicode": {
        "baseUrl": "https://api.kimi.com/coding/v1",
        "apiKey": "${KIMICODE_API_KEY}",
        "api": "openai-completions",
        "models": [
          { "id": "kimi-for-coding", "name": "Kimi For Coding", "contextWindow": 200000 }
        ]
      }
    }
  }
}

Switch between models using aliases:

  • /model k25 - Kimi K2.5 (general)
  • /model kimi - Kimi for Coding (specialized)

Troubleshooting

Model not appearing in list

Check config syntax:

clawdbot gateway config.get | grep -A 20 moonshot

Verify API key is set:

echo $MOONSHOT_API_KEY
echo $KIMICODE_API_KEY

Authentication errors

  • Verify API key starts with sk-
  • Check key is valid on provider dashboard
  • Ensure correct base URL for each provider

Connection issues

Test API endpoint directly:

curl -X POST "https://api.moonshot.cn/v1/chat/completions" \
  -H "Authorization: Bearer $MOONSHOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "kimi-k2.5", "messages": [{"role": "user", "content": "test"}]}'

Model Recommendations

  • Kimi K2.5 (moonshot/kimi-k2.5) - Best for general tasks, 200K context
  • Kimi for Coding (kimicode/kimi-for-coding) - Specialized for code generation
  • Moonshot V1 128K (moonshot/moonshot-v1-128k) - Legacy model, 128K context

References

安全使用建议
Before installing: (1) Understand that this skill needs two secrets (MOONSHOT_API_KEY and KIMICODE_API_KEY) even though the registry metadata doesn't declare them — verify and set them yourself only after confirming the providers and keys are legitimate. (2) Prefer storing API keys in a secure secret store or environment variables rather than echoing them into ~/.env or embedding them in config files. (3) Verify the provider domains (platform.moonshot.cn and api.kimi.com) are correct and trustworthy for your organization. (4) Inspect and run scripts (scripts/test_kimi_connection.sh) in an isolated environment if you're unsure; the script makes live network calls to the provider endpoints. (5) Ask the skill author or registry maintainer to update metadata to declare required env vars and provide a homepage/owner contact; lack of those increases risk. If you cannot verify the provider domains or the skill author, do not install or run the test script with real API keys.
功能分析
Type: OpenClaw Skill Name: kimi-integration Version: 1.0.0 The skill bundle provides clear, step-by-step instructions and a shell script for integrating Moonshot AI (Kimi) and Kimi Code models into Clawdbot. All commands, including `curl` requests to `https://api.moonshot.cn/v1` and `https://api.kimi.com/coding/v1`, are directly related to configuring and testing the integration of these legitimate AI services. The skill handles API keys by instructing users to set them as environment variables or in a `.env` file, and uses them only for authentication with the stated Kimi/Moonshot APIs. There is no evidence of data exfiltration, malicious execution, persistence mechanisms, obfuscation, or prompt injection attempts against the agent to perform unauthorized actions. The instructions are transparent and aligned with the stated purpose.
能力评估
Purpose & Capability
The SKILL.md and other files clearly require two provider API keys (MOONSHOT_API_KEY and KIMICODE_API_KEY) and show provider endpoints; however, the skill's registry metadata lists no required environment variables or primary credential. That mismatch (metadata says 'none' but runtime needs secrets) is an incoherence that should be resolved before trusting the skill.
Instruction Scope
Instructions stay within the expected scope (editing clawdbot.json, exporting environment variables, restarting gateway, and testing endpoints with curl). Points to note: it advises echoing keys into ~/.env and also shows storing keys directly in Clawdbot config (the README acknowledges this is less secure). The connection-test script makes direct network calls to external endpoints (expected for this purpose).
Install Mechanism
No install spec — instruction-only with a small test script. Nothing is downloaded or installed automatically, which lowers risk.
Credentials
Requiring two API keys (one per provider) is reasonable for adding external model providers, but the declared metadata omitted these env vars. Additionally the docs show patterns that encourage placing keys in files/config (echo to ~/.env, or embedding in Clawdbot config) which is less secure and should be discouraged; the skill should declare required env vars in metadata and avoid recommending insecure storage by default.
Persistence & Privilege
The skill is not always-enabled and does not request system-wide privileges; it does not attempt to modify other skills' configs. It runs a benign test script that performs network calls to the declared provider endpoints.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install kimi-integration
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /kimi-integration 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Moonshot AI (Kimi K2.5) and Kimi Code integration guide for Clawdbot
元数据
Slug kimi-integration
版本 1.0.0
许可证
累计安装 12
当前安装数 12
历史版本数 1
常见问题

Kimi Integration 是什么?

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. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 3513 次。

如何安装 Kimi Integration?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install kimi-integration」即可一键安装,无需额外配置。

Kimi Integration 是免费的吗?

是的,Kimi Integration 完全免费(开源免费),可自由下载、安装和使用。

Kimi Integration 支持哪些平台?

Kimi Integration 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Kimi Integration?

由 evgyur(@evgyur)开发并维护,当前版本 v1.0.0。

💬 留言讨论