Kimi + Claude Code: the short version
Kimi is served by Moonshot, which publishes an Anthropic-compatible endpoint precisely so Claude Code and similar tools can point at it directly. You supply your own Moonshot key, usage is billed to you, and there's no translating proxy required — Claude Code talks to Kimi as if it were an Anthropic endpoint.
The config
What to set
- ANTHROPIC_BASE_URLPoint it at Moonshot's Anthropic-compatible base URL (the /anthropic endpoint).
- ANTHROPIC_AUTH_TOKENYour Moonshot API key — usage billed to your Moonshot account.
- ModelSelect a Kimi model (e.g. the K2 line). Use the exact name the endpoint exposes.
# Point Claude Code at Moonshot/Kimi's Anthropic-compatible endpoint
export ANTHROPIC_BASE_URL="https://api.moonshot.ai/anthropic"
export ANTHROPIC_AUTH_TOKEN="your-moonshot-key"
# then run claude as usual, selecting a Kimi modelWhy route Claude Code to Kimi
Value
Kimi's K2 line is a strong capability-per-dollar pick for everyday agent coding.
Long context
Kimi is known for large context windows, handy for bigger codebases.
Fallback for Claude limits
Somewhere to route when your Claude plan is rate-limited or capped.
The cleaner option: Kimi as a one-click setting
The endpoint swap works, but Claude Code is single-provider by design, so mixing Kimi and Claude means reconfiguring each time. If you want to run Kimi most of the time and jump to Claude (or a local model) on demand, use an agent where the provider, base URL, key and model are settings you pick from a list.
What that looks like with Wuwei
Kimi in the model list
Pick it in the UI; Claude, GLM, DeepSeek, Qwen and OpenAI-compatible endpoints sit alongside.
One-click switch
Move between Kimi and Claude mid-task without editing config or restarting.
Free, open source, local
MIT-licensed, runs on your machine, reads your real files; you only pay Moonshot's usage.
FAQ
Can Claude Code use Kimi?
Yes. Moonshot exposes an Anthropic-compatible endpoint for Kimi. Set ANTHROPIC_BASE_URL to Moonshot's /anthropic base and ANTHROPIC_AUTH_TOKEN to your Moonshot key, then select a Kimi model — no proxy needed.
Is Kimi good for coding agents?
Kimi's K2 line is a popular value pick for agent coding, with strong capability per dollar and large context windows that help on bigger repos.
How do I switch between Kimi and Claude easily?
Use an agent where the model is a setting. Wuwei is free and open source — Kimi and Claude are both in the model list, so switching is one click rather than an env-var edit and restart.