Kimi K2.7 Code is Moonshot’s current coding-specific API model. It has a 256K context window and costs less than the K3 flagship, which makes it a sensible match for Aider’s text-based repository workflow.
Install Aider in WSL
If needed, install WSL using the Windows 11 WSL guide. Inside the Linux shell, install Aider with pipx:
sudo apt update
sudo apt install -y pipx
pipx install aider-chat
pipx ensurepath
Close and reopen the shell, then check aider --version.
Configure Moonshot
Create a Moonshot API key, then export the direct API endpoint and key:
export OPENAI_API_BASE="https://api.moonshot.ai/v1"
export OPENAI_API_KEY="YOUR_MOONSHOT_API_KEY"
Run Aider inside a git repository:
cd ~/projects/example
aider --model openai/kimi-k2.7-code
The openai/ prefix tells Aider to use its OpenAI-compatible client. OPENAI_API_BASE redirects that client to Moonshot.
Save the model choice
You can put the non-secret default in .aider.conf.yml:
model: openai/kimi-k2.7-code
Keep the API key in an environment variable or secret manager. Do not add it to this file.
Work from a clean repository
Aider uses git to track its changes. Commit or stash your own work before starting, then review each diff and test result. Keeping the project in the WSL Linux file system, such as ~/projects, usually gives better filesystem performance than working under /mnt/c.
K2.7 Code is text-based. If the task depends on a screenshot or diagram, describe the relevant details or use a separate vision-capable model before asking Aider to edit code.
Troubleshooting
If requests go to OpenAI, OPENAI_API_BASE is missing from the current shell. If authentication fails, check OPENAI_API_KEY. A model-not-found error usually means the ID is misspelled or the key belongs to a service that expects a subscription alias.
If Aider is not found after installation, run pipx ensurepath, reopen WSL, and check again.
Kimi K2.7 Code Aider check
- Install Aider with pipx inside WSL
- Create a Moonshot API key
- Set OPENAI_API_BASE to https://api.moonshot.ai/v1
- Run openai/kimi-k2.7-code
- Start from a clean git tree and review every diff
K2.7 Code is the current lower-cost Kimi model for Aider’s coding workflow. Use K3 instead when a task needs native vision, a larger context window, or Moonshot’s strongest flagship reasoning.