How to Integrate Moonshot AI Models in Openclaw
Want to use Kimi K2.5 in Openclaw? Moonshot AI (Kimi Open Platform) offers powerful models with OpenAI-compatible endpoints. This guide shows you how to integrate Moonshot AI models into your Openclaw setup in under 5 minutes.
Quick Start
Moonshot AI provides both global and China endpoints. Choose the one that fits your location. You'll need a MOONSHOT_API_KEY from the Moonshot platform.
Interactive Setup
Run the onboarding wizard to configure Moonshot AI:
For global endpoint:
openclaw onboard --auth-choice moonshot-api-key
For China endpoint:
openclaw onboard --auth-choice moonshot-api-key-cn
Manual Configuration
If you prefer manual setup, add this to your ~/.openclaw/openclaw.json:
{
"env": { "MOONSHOT_API_KEY": "sk-..." },
"agents": {
"defaults": {
"model": { "primary": "moonshot/kimi-k2.5" }
}
},
"models": {
"mode": "merge",
"providers": {
"moonshot": {
"baseUrl": "https://api.moonshot.ai/v1",
"apiKey": "${MOONSHOT_API_KEY}",
"api": "openai-completions",
"models": [
{
"id": "kimi-k2.5",
"name": "Kimi K2.5",
"reasoning": false,
"contextWindow": 256000,
"maxTokens": 8192
}
]
}
}
}
}
For more deployment options, check out our guide on Deploy Flyio Openclaw.
Available Models
All Moonshot models must be prefixed with moonshot/:
moonshot/kimi-k2.5moonshot/kimi-k2-0905-previewmoonshot/kimi-k2-turbo-previewmoonshot/kimi-k2-thinkingmoonshot/kimi-k2-thinking-turbo
Native Thinking Mode
Moonshot Kimi supports binary native thinking. Openclaw maps runtime /think levels to toggle this feature. To permanently disable thinking for a model:
"params": {
"thinking": { "type": "disabled" }
}
Note: When thinking is enabled, tool choice must be set to auto or none. Openclaw automatically normalizes incompatible tool choices.
If you're new to Openclaw, you might also want to read about Elevated Mode Openclaw for advanced permissions.
Example Usage
Once configured, use Moonshot models in your prompts:
@moonshot/kimi-k2.5 Explain quantum computing in simple terms
Troubleshooting
- Invalid API key: Verify your
MOONSHOT_API_KEYis correctly set in environment or config - Endpoint errors: Use moonshot-api-key-cn for China region
- Tool choice errors: When using thinking mode, ensure tool choice is auto
- Model not found: Always prefix model IDs with moonshot/
Best Practices
- Use
kimi-k2.5for general tasks with 256K context window - Enable thinking mode for complex reasoning tasks
- Store API keys in environment variables, not hardcoded in config
- Test with openclaw status to verify model connectivity