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.

533 stars

Best use case

kimi-integration is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using kimi-integration should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/kimi-integration/SKILL.md --create-dirs "https://raw.githubusercontent.com/sundial-org/awesome-openclaw-skills/main/skills/kimi-integration/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/kimi-integration/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How kimi-integration Compares

Feature / Agentkimi-integrationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 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

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

Or add to `.env` file:

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

#### Step 2: Add provider configuration

Edit your `clawdbot.json` config:

```json5
{
  "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

```bash
clawdbot gateway restart
```

#### Step 4: Verify integration

```bash
clawdbot models list
```

You should see Moonshot models in the list.

#### Step 5: Use the model

Set as default:
```bash
clawdbot models set moonshot/kimi-k2.5
```

Or use model aliases in chat:
```bash
/model moonshot/kimi-k2.5
```

### Option 2: Kimi Code (specialized coding model)

#### Step 1: Set environment variable

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

Or add to `.env`:

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

#### Step 2: Add provider configuration

Edit your `clawdbot.json` config:

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

#### Step 3: Restart Clawdbot

```bash
clawdbot gateway restart
```

#### Step 4: Verify integration

```bash
clawdbot models list
```

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

#### Step 5: Use the model

Set as default:
```bash
clawdbot models set kimicode/kimi-for-coding
```

Or use model alias in chat:
```bash
/model kimi
```

## Using Both Providers

You can configure both Moonshot and Kimi Code simultaneously:

```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": "${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:
```bash
clawdbot gateway config.get | grep -A 20 moonshot
```

Verify API key is set:
```bash
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:
```bash
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

- Moonshot AI Docs: https://platform.moonshot.cn/docs
- Kimi Code API: https://api.kimi.com/coding/docs
- Clawdbot Model Providers: /home/eyurc/clawdbot/docs/concepts/model-providers.md

Related Skills

portfolio-watcher

533
from sundial-org/awesome-openclaw-skills

Monitor stock/crypto holdings, get price alerts, track portfolio performance

portainer

533
from sundial-org/awesome-openclaw-skills

Control Docker containers and stacks via Portainer API. List containers, start/stop/restart, view logs, and redeploy stacks from git.

portable-tools

533
from sundial-org/awesome-openclaw-skills

Build cross-device tools without hardcoding paths or account names

polymarket

533
from sundial-org/awesome-openclaw-skills

Trade prediction markets on Polymarket. Analyze odds, place bets, track positions, automate alerts, and maximize returns from event outcomes. Covers sports, politics, entertainment, and more.

polymarket-traiding-bot

533
from sundial-org/awesome-openclaw-skills

No description provided.

polymarket-analysis

533
from sundial-org/awesome-openclaw-skills

Analyze Polymarket prediction markets for trading edges. Pair Cost arbitrage, whale tracking, sentiment analysis, momentum signals, user profile tracking. No execution.

polymarket-agent

533
from sundial-org/awesome-openclaw-skills

Autonomous prediction market agent - analyzes markets, researches news, and identifies trading opportunities

polymarket-5

533
from sundial-org/awesome-openclaw-skills

Query Polymarket prediction markets. Use for questions about prediction markets, betting odds, market prices, event probabilities, or when user asks about Polymarket data.

polymarket-4

533
from sundial-org/awesome-openclaw-skills

Query Polymarket prediction markets. Use for questions about prediction markets, betting odds, market prices, event probabilities, or when user asks about Polymarket data.

polymarket-3

533
from sundial-org/awesome-openclaw-skills

Query Polymarket prediction market odds and events via CLI. Search for markets, get current prices, list events by category. Supports sports betting (NFL, NBA, soccer/EPL, Champions League), politics, crypto, elections, geopolitics. Real money markets = more accurate than polls. No API key required. Use when asked about odds, probabilities, predictions, or "what are the chances of X".

polymarket-2

533
from sundial-org/awesome-openclaw-skills

Query Polymarket prediction markets - check odds, trending markets, search events, track prices.

pollinations

533
from sundial-org/awesome-openclaw-skills

Pollinations.ai API for AI generation - text, images, videos, audio, and analysis. Use when user requests AI-powered generation (text completion, images, videos, audio, vision/analysis, transcription) or mentions Pollinations. Supports 25+ models (OpenAI, Claude, Gemini, Flux, Veo, etc.) with OpenAI-compatible chat endpoint and specialized generation endpoints.