To code with Kimi you need two things: a key from a provider that hosts the model, and a coding agent that lets you pick it. Kimi K3.1 Pro is hosted by NVIDIA and OpenRouter under the name moonshotai/kimi-k3.1-pro, and by Moonshot itself through a Kimi Code membership. In MinniCode you paste the key once and type /model moonshotai/kimi-k3.1-pro. Claude Code and OpenCode can use Kimi too, through Moonshot’s own key.
Where to get a key for Kimi
| From | The key | Model name to ask for | Good to know |
|---|---|---|---|
| NVIDIA | Starts with nvapi-, from build.nvidia.com | moonshotai/kimi-k3.1-pro | NVIDIA gives the key out at no charge and sets a request limit per account. How to get one. |
| OpenRouter | Starts with sk-or-, from openrouter.ai | moonshotai/kimi-k3.1-pro | Paid per token. Older Kimi models (K3, K2.7 Code) are listed there too. |
| Moonshot (Kimi Code) | Created in the Kimi Code Console | Chosen inside the tool, under "Kimi For Coding" | Needs a Kimi membership with Kimi Code turned on. This is the key Claude Code and OpenCode use. |
Read on 6 December 2026 from NVIDIA’s and OpenRouter’s model lists and from Moonshot’s Kimi Code docs. Model names change with each release: the provider’s own list is the record.
Two facts from Moonshot’s docs that affect how it feels to code with: K3.1 Pro has a one million token context window, and it only runs in thinking mode, so it reasons before each answer and that reasoning is billed as output.
Use Kimi in MinniCode
MinniCode is a terminal coding agent built for open LLMs. It takes an NVIDIA key, an OpenRouter key, or both, and you can switch model at any point in a session.
- Install it with the one line for your system (below), then run
minnicodein your project folder. - The first time, it asks how to reach a model. Pick NVIDIA or OpenRouter. It opens the right key page for you; paste the key.
- Type
/model kimito list the Kimi models live on your key, then/model moonshotai/kimi-k3.1-proto switch. - Type your task.
/statusshows which model is answering and what the session has used.
install MinniCode
# Windows, in PowerShell irm https://minniai.com/install | iex # macOS and Linux curl -fsSL https://minniai.com/install | sh inside MinniCode
/model kimi /model moonshotai/kimi-k3.1-pro /status Your key stays on your computer and requests go straight from it to NVIDIA or OpenRouter; Minni never sees the key or your code. Out of auto mode every edit is shown as a diff first, and commands, deletions and pushes need a typed yes. If a turn fails because a model was retired, /models shows what is live and /model default resets. The full command list is in the MinniCode docs.
Use Kimi in Claude Code
Claude Code can be pointed at Kimi with environment variables. Moonshot documents the route: you need a Kimi membership with Kimi Code turned on, an API key from the Kimi Code Console, and a short script of theirs that skips Anthropic’s sign-in before you set the variables. The steps change between Claude Code versions, so follow Moonshot’s Claude Code page and not a copy of it.
What to expect: Claude Code’s own instructions and tool list are written for Claude and are sent on every turn, whichever model answers. If the reason you are moving to Kimi is cost, that fixed part of each turn is worth measuring: see why Claude Code sessions get expensive.
Use Kimi in OpenCode
- Install OpenCode from opencode.ai.
- Run
opencode auth login, choose Kimi For Coding, and paste your Kimi Code key. - Start
opencode, type/models, and pick a model under Kimi For Coding.
These are Moonshot’s steps, from its OpenCode page. OpenCode can also reach Kimi through an OpenRouter key.
Or Moonshot’s own agent, Kimi Code
Moonshot ships its own terminal agent, Kimi Code CLI, and a VS Code extension. It runs on the same Kimi membership. Choose it if Kimi is the only model you plan to use; choose an agent that takes several providers if you want to compare Kimi with DeepSeek, GLM or Qwen on the same task. Install steps are in Moonshot’s getting started page.
Keep the token count down
- A thinking model spends output tokens before it writes a line. Give it one task at a time and say which files matter.
- A million tokens of context is room, not a target. Every turn re-sends the conversation, so a long session costs more per turn than a short one. Start a new session when the task changes.
- Keep your project memory file short. It is sent on every turn: what to do when CLAUDE.md is too long.
The agent’s own overhead counts as well. On the same tasks, a warm MinniCode session wrote 5,286 tokens to the model’s cache against 8,273 for Claude Code, 36% less (both on Claude Sonnet, so the comparison is like for like; the method is on the evidence page). It is not a measurement on Kimi.
Related: how to use DeepSeek for coding, which open LLM to pick for coding and open-LLM coding agents compared.
Try MinniCode
The low-cost, open-model coding agent, in beta. Runs Kimi on your own NVIDIA or OpenRouter key. The product page and the docs cover the rest.
install it (PowerShell on Windows, sh on macOS and Linux)
$ irm https://minniai.com/install | iex $ curl -fsSL https://minniai.com/install | sh First published on minniai.com. Model names and steps were read from the providers on 6 December 2026.