kimi-integrationStep-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.
Install via ClawdBot CLI:
clawdbot install evgyur/kimi-integrationComplete guide for adding Moonshot AI (Kimi) and Kimi Code models to Clawdbot.
Kimi offers two separate model families:
Both require API keys from different sources.
sk-...)sk-...)Note: Moonshot and Kimi Code use separate keys and endpoints.
export MOONSHOT_API_KEY="sk-your-moonshot-key-here"
Or add to .env file:
echo 'MOONSHOT_API_KEY="sk-your-moonshot-key-here"' >> ~/.env
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
}
]
}
}
}
}
clawdbot gateway restart
clawdbot models list
You should see Moonshot models in the list.
Set as default:
clawdbot models set moonshot/kimi-k2.5
Or use model aliases in chat:
/model moonshot/kimi-k2.5
export KIMICODE_API_KEY="sk-your-kimicode-key-here"
Or add to .env:
echo 'KIMICODE_API_KEY="sk-your-kimicode-key-here"' >> ~/.env
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
}
]
}
}
}
}
clawdbot gateway restart
clawdbot models list
You should see kimicode/kimi-for-coding in the list.
Set as default:
clawdbot models set kimicode/kimi-for-coding
Or use model alias in chat:
/model kimi
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)Check config syntax:
clawdbot gateway config.get | grep -A 20 moonshot
Verify API key is set:
echo $MOONSHOT_API_KEY
echo $KIMICODE_API_KEY
sk-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"}]}'
moonshot/kimi-k2.5) - Best for general tasks, 200K contextkimicode/kimi-for-coding) - Specialized for code generationmoonshot/moonshot-v1-128k) - Legacy model, 128K contextGenerated Feb 26, 2026
Development teams can integrate Kimi Code for specialized coding assistance, such as code generation, debugging, and optimization, while using Moonshot AI for general project documentation and planning. This dual-model setup enhances productivity by leveraging domain-specific and general-purpose AI capabilities within Clawdbot.
Businesses can deploy Moonshot AI models to handle customer inquiries, generate responses, and manage support tickets through Clawdbot. The high context window allows for detailed conversation history, improving response accuracy and customer satisfaction in real-time interactions.
Agencies can use Moonshot AI for drafting articles, marketing copy, and creative content, with Kimi Code assisting in technical writing or code snippets for web development projects. This integration streamlines content production by combining creative and technical AI tools in one platform.
Online learning platforms can integrate both models to provide personalized tutoring: Moonshot AI for general subject explanations and Kimi Code for programming exercises and coding tutorials. This enhances student engagement and learning outcomes by offering tailored educational support.
Researchers can utilize Moonshot AI for literature review, hypothesis generation, and report writing, while Kimi Code helps with data processing scripts and statistical analysis code. This accelerates research workflows by integrating AI-driven insights and automation tools.
Offer tiered subscription plans for accessing Kimi models through Clawdbot, with features like priority support, higher usage limits, and advanced configurations. This generates recurring revenue by catering to businesses of different sizes and needs.
Provide consulting services to help organizations integrate and optimize Kimi models within Clawdbot for specific use cases, such as custom workflows or industry applications. Revenue comes from project-based fees and ongoing maintenance contracts.
Resell access to Kimi models by bundling API calls with Clawdbot deployment, offering pay-as-you-go or bulk pricing models. This allows businesses to monetize AI capabilities without managing direct provider relationships, earning margins on usage.
💬 Integration Tip
Start with one provider to simplify setup, then add the second after verifying the first works correctly; use environment variables for API keys to enhance security.
Use CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
Gemini CLI for one-shot Q&A, summaries, and generation.
Research any topic from the last 30 days on Reddit + X + Web, synthesize findings, and write copy-paste-ready prompts. Use when the user wants recent social/web research on a topic, asks "what are people saying about X", or wants to learn current best practices. Requires OPENAI_API_KEY and/or XAI_API_KEY for full Reddit+X access, falls back to web search.
Check Antigravity account quotas for Claude and Gemini models. Shows remaining quota and reset times with ban detection.
Manages free AI models from OpenRouter for OpenClaw. Automatically ranks models by quality, configures fallbacks for rate-limit handling, and updates opencla...
Manages free AI models from OpenRouter for OpenClaw. Automatically ranks models by quality, configures fallbacks for rate-limit handling, and updates openclaw.json. Use when the user mentions free AI, OpenRouter, model switching, rate limits, or wants to reduce AI costs.