Aider’s commit-every-change workflow and Kimi K2’s reasoning make a solid pair for careful refactors — and on Windows, running it inside WSL gives Aider the clean git-and-shell environment it expects. Moonshot’s OpenAI-compatible API means there’s no proxy: a couple of environment variables and a model flag.
This is the WSL setup. For how Aider compares to other agents, see best cheap Claude Code alternatives.
Step 1: WSL, Python, and Aider
If WSL isn’t installed, start with the WSL install guide. Then install Aider with pipx inside WSL:
sudo apt update && sudo apt install -y pipx
pipx install aider-chat
pipx ensurepath
Reopen the shell so aider is on your PATH.
Step 2: Moonshot key
Sign up on the Moonshot platform and create an API key.
Step 3: Point Aider at Kimi
Moonshot is OpenAI-compatible, so set Aider’s OpenAI client to Moonshot’s endpoint and pick a Kimi model:
export OPENAI_API_BASE="https://api.moonshot.ai/v1"
export OPENAI_API_KEY="sk-your-moonshot-key"
aider --model openai/kimi-k2-thinking
The openai/ prefix tells Aider to use its OpenAI-compatible client against your base URL. Persist the variables in ~/.bashrc so they’re set in every shell.
Step 4: Model choice and a weak model
Kimi with Aider
| openai/kimi-k2-thinking | Reasoning mode; deep refactors |
|---|---|
| openai/kimi-k2-turbo | Faster everyday edits |
| --weak-model | Cheaper model for commit messages |
A cheaper weak model for commit messages and minor calls saves tokens:
aider --model openai/kimi-k2-thinking --weak-model openai/kimi-k2-turbo
Save it in a config file
Put the defaults in .aider.conf.yml:
model: openai/kimi-k2-thinking
weak-model: openai/kimi-k2-turbo
Keep the key and base URL in environment variables, not in this file.
Work in the Linux file system
For speed, keep your project in your Linux home rather than /mnt/c — Aider’s git operations and file reads are faster there. See access your Windows files from WSL.
Pricing
Aider is free; Kimi is pay-per-token with cache-hit discounts and no flat coding plan. Aider’s running cost display lets you watch spend in real time. Confirm rates on Moonshot’s docs — see Kimi K2 pricing explained.
Troubleshooting
- Requests hitting OpenAI —
OPENAI_API_BASEisn’t set to Moonshot. - Auth errors —
OPENAI_API_KEYunset or wrong. aider: command not found— runpipx ensurepathand reopen the shell.- Model errors — confirm the Kimi model ID and the
openai/prefix.
Kimi + Aider (WSL) checklist
- WSL + Aider (pipx) installed
- Moonshot API key created
- OPENAI_API_BASE and OPENAI_API_KEY set to Moonshot
- Run with --model openai/kimi-k2-thinking
- Project in Linux home; clean git tree
Wrapping up
Kimi K2 with Aider in WSL is git-native pair programming on a cheap, reasoning-capable model: install Aider with pipx, point OPENAI_API_BASE/OPENAI_API_KEY at Moonshot’s /v1 endpoint, and run aider --model openai/kimi-k2-thinking. Add a weak model and a config file, work from your Linux home, and every change lands as a revertible commit.
To use Kimi with other tools, see run Kimi K2 Thinking with Claude Code or Kimi K2.5 Turbo + OpenCode.