Kilo Code Setup Guide
An open-source AI coding agent for VS Code, JetBrains, and CLI, with 500+ models through Xiaomai API.
Website: https://kilo.ai | GitHub: https://github.com/Kilo-Org/kilocode | Docs: https://kilo.ai/docs
Overview
Kilo Code is an open-source AI coding agent for VS Code, JetBrains IDEs, and the command line. It supports custom APIs through an OpenAI-compatible interface. After configuring Xiaomai API, you can use Claude, GPT, Gemini, and other model families for code generation, debugging, and refactoring.
Supported Environment
- VS Code: installed through extension
- JetBrains: installed through plugin
- CLI: command-line usage
Features
- Multiple modes: Architect, Code, Debug, and other dedicated modes
- Orchestrator mode: splits complex tasks and coordinates sub-agents
- 500+ models: access many models through an OpenAI-compatible interface
- Custom agents: define dedicated agents with
.kilo/agents/*.md - Cross-platform: VS Code, JetBrains, and CLI share the same configuration style
Install Kilo Code
VS Code
- Open VS Code and press
Ctrl + Shift + X - Search for
Kilo Code - Click Install
JetBrains
- Open Settings -> Plugins -> Marketplace
- Search for
Kilo Code - Click Install and restart the IDE
CLI
npm install -g @anthropic-ai/kiloGet a Xiaomai API Key
- Sign in to the Xiaomai API console
- Create a new key and choose the auto token group
- Copy and save the key, such as
sk-xxxx
Tip
If you do not have an account, register first, then create a key.
Configure Xiaomai API
Kilo Code supports both UI and configuration-file setup. The UI path is recommended first.
Method 1: UI Configuration (Recommended)
- Open the Kilo Code panel and choose Use your own API key
- In the Provider dropdown, choose OpenAI Compatible
- Fill in:
| Field | Value |
|---|---|
| Base URL | https://xiaomai.win/v1 |
| API Key | Your Xiaomai API key, such as sk-xxxx |
| Model | Model ID, such as claude-sonnet-4-20250514 |
- Save
Common Model IDs
claude-sonnet-4-20250514- Claude Sonnet 4claude-opus-4-20250514- Claude Opus 4gemini-2.5-pro- Gemini 2.5 Progpt-5.4- GPT-5.4
Method 2: Configuration File
Kilo Code uses kilo.jsonc.
Configuration File Locations
- Global config:
~/.config/kilo/kilo.jsonc - Windows:
C:\Users\用户名\.config\kilo\kilo.jsonc - Project config:
kilo.jsoncin the project root, with higher priority
Security
Do not commit a configuration file that contains an API key to Git. Environment variables are recommended for secrets.
Start Using
After configuration:
- Open the Kilo Code panel in VS Code
- Choose a working mode, such as Code, Architect, or Debug
- Enter your request. Kilo Code can read and write files and run commands
Working Modes
- Code: daily coding and direct file edits
- Architect: architecture design with planning before execution
- Debug: analyze errors and fix them
- Orchestrator: split complex tasks and coordinate multiple agents
FAQ
API key is invalid
- Confirm the key was copied correctly, in
sk-xxxxformat - Confirm account balance is sufficient
- Confirm Base URL is
https://xiaomai.win/v1
Model request failed
- Check whether the network can access
https://xiaomai.win - Confirm the model ID is spelled correctly
- Try another model