How to Integrate Kilocode Models in Openclaw
Quick Start
Kilocode is an AI coding assistant platform that provides access to powerful language models. This guide shows you how to integrate Kilocode models into your Openclaw setup in under 5 minutes.
Get Your API Key
- Go to app.kilo.ai
- Sign in or create an account
- Navigate to API Keys and generate a new key
Configure Openclaw
To make Kilocode your primary agent model, edit your ~/.Openclaw/Openclaw.json configuration file:
{
"env": { "KILOCODE_API_KEY": "<your-kilocode-api-key>" },
"agents": {
"defaults": {
"model": { "primary": "kilocode/kilo/auto" }
}
}
}
After saving the configuration, restart your Openclaw gateway to apply the changes:
openclaw gateway restart
For more deployment options, check out our guide on Flyio Deployment. If you are new to Openclaw, you might also want to read about Elevated Mode for advanced permissions.
Testing Your Setup
Once configured, test the integration by sending a prompt:
openclaw message --content "Explain how Kilocode models work"
The response should come from the Kilocode model, confirming your setup is working correctly.
Troubleshooting
- Authentication errors: Verify your API key is correctly copied and the Openclaw.json syntax is valid JSON
- Model not found: Ensure you are using the correct model ID: kilocode/kilo/auto
- Gateway not responding: Check that the gateway restarted successfully with openclaw gateway status
Best Practices
- Store your API key in environment variables for production deployments
- Use kilocode/kilo/auto for automatic model selection based on task complexity
- Monitor API usage in your Kilocode dashboard to track costs