Kimi Code: CLI, Desktop, VS Code, Models, Setup, Quotas, and Safe Workflow

Original guide review: October 12, 2026. Desktop platform and provider clarification: October 16, 2026.

Kimi Code is Moonshot AI’s developer-focused AI coding service. It is available through Kimi Code Desktop, Kimi Code CLI, the Kimi Code VS Code extension, and supported third-party coding tools through Kimi Code API keys. It can read code, edit files, run commands, search project files, use the web, and help with tasks such as debugging, refactoring, tests, documentation, and multi-file changes.

The most important distinction is this: Kimi Code is not the same as Kimi Platform API. Access to the official Kimi Code model service is tied to Kimi membership benefits and quota rules; the Desktop application can also connect to a separately configured model provider. Kimi Platform API is a separate pay-as-you-go developer platform for product integrations and application calls. If you mix their API keys, Base URLs, or billing models, login and model errors are likely.

What is Kimi Code?

Kimi Code is an AI coding agent built for developer workflows. In the official clients, you can open a local project, ask questions about the codebase, request a plan, approve file edits, run tests, inspect diffs, and continue the session until the work is verified.

Use it when you want an agent to work inside a repository, not just answer a coding question in a normal chat. It is especially useful for repo exploration, multi-file edits, test generation, migration tasks, bug diagnosis, and project documentation.

Kimi Code clients at a glance

Kimi Code is not just one interface. Choose the client based on how you work.

The official Desktop download guidance lists separate Apple silicon and Intel Mac builds, a Windows installer, and AppImage, DEB, and RPM packages for x86_64 Linux. These are Kimi Code Desktop packages; they do not establish a general Linux version of Kimi Chat or Kimi Work.

ClientBest forHow it worksMain caveat
Kimi Code DesktopDevelopers who prefer a graphical workspaceOpen a local folder, chat with the agent, review changes, use the built-in terminal and browserOfficial desktop builds are available for macOS, Windows, and x86_64 Linux (AppImage, DEB, or RPM)
Kimi Code CLITerminal-first developers, automation, remote servers, scripted workflowsRun kimi in a project directory and work through an interactive terminal UIOn Windows, Git for Windows is required before first launch
Kimi Code for VS CodeDevelopers who want an AI agent inside the editorUse a sidebar chat, reference files/folders with @, review diffs, and approve changesRequires an open workspace folder
Third-party toolsUsers of Claude Code, OpenCode, Codex, and compatible agent toolsCreate a Kimi Code API key and configure the correct Base URL, protocol, and model IDKimi Code keys and Kimi Platform API keys are not interchangeable

Kimi Code vs Kimi Platform API

This is the most common source of confusion. The official Kimi Code model service has its own membership-based coding platform and endpoints; the Kimi Code column below describes that service. Kimi Platform API is the separate Moonshot/Kimi API platform for developers building applications.

To use another model inside Desktop, follow the official Desktop setup guide: open Settings → Model Providers, add that provider’s API key, base URL, and model details, then select it for the session. Its billing, limits, and data terms are separate from the official Kimi model-service quota. Connecting another provider inside Desktop is different from using a Kimi Code API key inside a third-party coding client. Neither route makes inference automatically free.

ComparisonKimi CodeKimi Platform API
Primary useTerminal, IDE, and agentic programming workflowsProduct integrations, backend calls, apps, and enterprise API usage
Billing modelKimi membership subscription with quota and rate limitsPay-as-you-go API usage
Authentication sourceKimi account login or Kimi Code Console API keyKimi Platform API key
Overseas OpenAI-compatible Base URLhttps://api.kimi.ai/coding/v1https://api.moonshot.ai/v1
Overseas Anthropic-compatible Base URLhttps://api.kimi.ai/coding/Not the same as Kimi Code’s coding endpoint
Best choice whenYou want a coding agent in Desktop, CLI, VS Code, or third-party coding toolsYou are building an app or service that calls Kimi models programmatically

If you see authentication errors, empty model lists, or “model not found” messages, first check that your API key and Base URL come from the same platform.

How to install Kimi Code CLI

Before running any install command from the web, open the official Kimi Code CLI documentation yourself and verify the command is still current. The official install script is the recommended route because it does not require pre-installed Node.js. The npm route is also available if you prefer package-manager installation.

macOS and Linux install script

curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash

Windows PowerShell install script

irm https://code.kimi.com/kimi-code/install.ps1 | iex

On Windows, install Git for Windows before first launch. Kimi Code CLI uses the bundled Git Bash shell environment. If Git Bash is installed in a custom location, set KIMI_SHELL_PATH to the absolute path of bash.exe.

npm or pnpm install

The npm method requires Node.js 22.19.0 or later.

node --version
npm install -g @moonshot-ai/kimi-code

With pnpm:

pnpm add -g @moonshot-ai/kimi-code

First launch

Move into your project folder and start the terminal UI:

cd your-project
kimi

For a one-off instruction without opening the full interactive UI, use -p:

kimi -p "Take a look at this project's directory structure"

On first launch, run /login. The CLI supports Kimi Code OAuth login and Kimi Platform API key mode. For normal Kimi Code membership benefits, use the Kimi Code login flow. For pay-as-you-go platform usage, use the correct Kimi Platform API key and Base URL.

How to use Kimi Code Desktop

Kimi Code Desktop is best if you want the agent workflow in a graphical app. It lets you open a local project, manage sessions, inspect changes, preview files, run commands in the built-in terminal, and review results without living entirely in the terminal.

  1. Download the desktop installer for your system from the official Kimi Code page.
  2. Install and open the app.
  3. Sign in with your Kimi account. The sign-in site depends on your region: kimi.com for mainland China and kimi.ai for other regions.
  4. Create a new session.
  5. Choose a local project folder as the workspace.
  6. Start with a read-only task, such as asking for the project structure and entry points.
  7. For change-making tasks, review approval cards, commands, and file diffs before accepting.
  8. Verify the result using the built-in terminal, browser, or your own local tooling.

A safe first prompt is:

Summarize the directory structure and main entry points of this project. Do not modify files.

How to use Kimi Code in VS Code

Kimi Code for VS Code gives you a native editor workflow. You can ask questions inside the editor, reference files or folders with @, review code diffs visually, roll back changes when needed, and keep the chat panel in the activity bar, sidebar, or a separate tab.

  1. Install the Kimi Code extension from the VS Code Marketplace.
  2. Restart VS Code or run “Developer: Reload Window” if the extension does not appear.
  3. Open a workspace folder. The extension needs a folder to work properly.
  4. Choose Kimi Account Mode or API Key Mode.
  5. Use @ to reference a file or folder.
  6. Ask for a plan before allowing multi-file edits.
  7. Review the diff and approve only the changes you understand.
  8. Run tests or manual checks before committing.

Useful VS Code shortcuts include Ctrl+Shift+K or Cmd+Shift+K to focus the Kimi input box, Alt+K to insert the current file reference, and Ctrl+N or Cmd+N for a new conversation if that shortcut is enabled.

Current Kimi Code models and model IDs

Kimi Code currently uses four model IDs across three model versions. Use the model ID, not the display name. For example, use k3, not “K3”, when a tool asks for a model ID.

Model IDModel versionContext windowReasoningAvailabilityBest forCaveat
k3K31048576 for higher-tier membersreasoning_effort: low / high / max, default highPlus and above; 1M context for Pro and aboveLarge codebases, complex refactors, long-horizon coding, visual inputs1M context consumes more quota than k3-256k
k3-256kK3 256K context version262144reasoning_effort: low / high / max, default highPlus and aboveEveryday coding, routine feature work, smaller repos, single-file or small multi-file editsVideo input is not supported
kimi-for-codingK2.8 Preview1048576reasoning_effort: low / high / max, default maxPlus and aboveRoutine development, code completion, practical coding tasks, efficient thinkingNot the same label as K3 even if performance can be close for many coding tasks
kimi-for-coding-highspeedK2.7 Code HighSpeed262144Thinking onPro and aboveLatency-sensitive coding loops where output speed mattersHighSpeed affects model output speed, not slow tools, scripts, builds, or tests

Which Kimi Code model should you choose?

TaskRecommended starting modelWhy
Understand an unfamiliar repok3-256k or k3Use 256K for normal repos; use 1M when the codebase or context is genuinely large
Large codebase analysisk3The 1M context option is built for larger cross-module work when your plan supports it
Routine feature workkimi-for-codingGood balance for everyday development and code completion
Fast coding outputkimi-for-coding-highspeedBest when response speed matters and your plan includes HighSpeed
Small edits or single-file fixesk3-256k or kimi-for-codingUsually enough without spending more quota on 1M context
Image-based debuggingk3, kimi-for-coding, or HighSpeedThese support image input; k3-256k supports image but not video
Video inputk3, kimi-for-coding, or HighSpeedDo not choose k3-256k for video input

When switching models, consider starting a new session. Kimi’s docs explain that switching model IDs can invalidate the context cache, so the same context may need to be re-prefilled and usage can look higher immediately after switching.

Kimi Code membership, quotas, and Extra Usage

Kimi Code is included in Kimi membership benefits. Under the new membership structure, the Go tier has no coding quota, while Plus and above can use Kimi Code. Existing legacy subscribers keep their old plan names, quota rules, and renewal arrangement unless they choose to upgrade.

RuleNew plansLegacy plans
Kimi Code accessPlus and aboveAndante and above
K3 accessPlus and aboveModerato and above
K3 1M contextPro and aboveAllegretto and above
HighSpeed accessPro and aboveAllegretto and above
Rolling 5-hour rate windowYesYes
Weekly quota windowNoYes
Monthly shared quotaYesYes

When they call the official Kimi model service, requests from Desktop, CLI, VS Code, logged-in devices, and Kimi Code API keys share the same Kimi Code quota. A different provider configured inside Desktop uses that provider’s own billing and limits. Kimi’s broader membership features also share a monthly credit pool. If that monthly pool is exhausted, Kimi Code can be affected even if a separate Kimi Code window still appears to have room.

Extra Usage is available as a fallback for subscribed members when quota runs out. It is shared between Kimi on the web and Kimi Code. Kimi states that subscription quota is deducted first and Extra Usage is used only after time-limited quota is exhausted. For heavy usage, upgrading the subscription may be more cost-effective than relying on top-ups.

A safe first workflow for a real repository

The safest way to use any coding agent is to make it inspect first, plan second, edit third, and verify last.

  1. Create a clean Git branch before you start.
  2. Open the repository in Kimi Code Desktop, CLI, or VS Code.
  3. Ask for a read-only architecture overview.
  4. Ask for a plan before any code changes.
  5. Review the plan and correct the scope.
  6. Ask Kimi Code to make the smallest useful change.
  7. Review every diff before accepting.
  8. Run tests, lint, build, or a manual smoke test.
  9. Ask Kimi Code to explain what changed and what still needs human review.
  10. Commit only after you understand the patch.

A good first prompt is:

Give me an overview of this repository's architecture. Do not modify files. Identify the main entry points, key modules, configuration loading path, test setup, and any risky areas I should understand before making changes.

Kimi Code prompt examples

WorkflowPrompt template
Repository overviewGive me a repository architecture overview. Identify entry points, main modules, dependency flow, config loading, test structure, and the safest files to inspect first. Do not modify files.
Bug investigationFind the likely cause of this bug before editing. Here is the error and reproduction path: [paste details]. List the most suspicious files and propose a fix plan. Wait for my approval before changing files.
Feature implementationAdd [feature] with these acceptance criteria: [criteria]. First create a plan, list files to change, and identify tests to add. After I approve, implement the smallest safe patch.
Refactor safelyCreate a plan for refactoring [module]. Preserve behavior, avoid public API changes, add or update tests, and show the diff before finalizing.
Test generationAdd tests for [behavior]. Follow the existing test style, cover success, failure, and edge cases, then run the relevant test command and report results.
PR reviewReview this pull request for correctness, security risks, missing tests, breaking changes, and unclear code. Report findings by severity and do not modify files.
Dead-code cleanupFind likely dead code in [directory]. Explain why each item appears unused before deleting anything. Wait for approval before making changes.
MigrationMigrate [package/framework] from [old version] to [new version]. Start with a plan, list breaking changes, update code in small steps, and run tests after each major step.

Advanced Kimi Code features

Kimi Code CLI includes advanced customization features for users who want more than a simple coding chat.

FeatureWhat it doesPractical useCaution
MCPConnects external tool servers through the Model Context ProtocolExpose GitHub, databases, file tools, or remote services to the agentProject-level MCP servers can run local commands; trust the repo first
Agent SkillsReusable Markdown instructions with YAML frontmatterCode style rules, PR review checklists, commit message formats, team workflowsPoorly written skills can steer the agent badly; keep them short and specific
Agents and sub-agentsDelegates focused sub-tasks to isolated agent contextsParallel repo exploration, planning, review, or large refactor analysisSub-agents consume their own model tokens; use them for complex tasks, not trivial edits
HooksRuns local scripts when specific events happenBlock risky commands, send notifications, append context, run checksHooks are fail-open and should not be your only security barrier

Safety checklist before letting Kimi Code edit files

  • Work in a clean Git branch.
  • Start with read-only exploration.
  • Ask for a plan before edits.
  • Review file diffs before accepting changes.
  • Run tests, lint, type checks, and builds yourself.
  • Do not approve shell commands you do not understand.
  • Do not paste secrets, tokens, SSH keys, private keys, or production credentials.
  • Do not let the agent modify production systems without human approval.
  • Check license, dependency, and security implications when packages change.
  • Keep backups for important repositories.
  • Redact session exports before sharing them because they may contain prompts, paths, command output, or sensitive traces.

Kimi Code vs Claude Code, Codex, Cursor, Copilot, Windsurf, and OpenCode

Do not compare coding agents only by brand name. Compare the workflow you need: terminal vs editor, local project access, approval controls, model context, multi-file editing, tests, MCP support, third-party tool compatibility, pricing, and quota behavior.

Kimi Code is strongest when you want Kimi’s coding models inside Desktop, CLI, VS Code, or supported third-party coding tools. Claude Code, Codex, Cursor, GitHub Copilot, Windsurf, and OpenCode may fit different teams depending on editor preference, existing subscriptions, enterprise controls, model preference, and integration needs. Use official docs for each tool before making a final decision.

Troubleshooting Kimi Code

ProblemLikely causeWhat to do
Empty model list during /loginInvalid or expired API key, network issue, or platform mismatchCheck the key, confirm the Base URL, and make sure you are not mixing Kimi Code and Kimi Platform credentials
Invalid API keyTypo, revoked key, expired key, or environment variable overrideVerify the key in the console and check variables such as KIMI_API_KEY or OPENAI_API_KEY
401 with the correct model IDYour plan may not include K3, 1M context, or HighSpeedUse a model available to your plan or upgrade to the required tier
HighSpeed is not noticeably fasterWrong model ID or tool/script time dominates the turnUse exactly kimi-for-coding-highspeed and remember that builds, tests, file reads, and tool calls are not sped up by model output speed
Usage rises after switching modelsContext cache no longer hits after model switchStart a new session when changing model IDs or reasoning effort
5-hour quota reachedRolling usage window has been exhaustedWait for the window to reset, check the console, buy Extra Usage, or upgrade
Weekly quota reachedLegacy plan weekly limitWait for the 7-day window, use Extra Usage, or upgrade to a new plan if appropriate
Monthly quota reachedShared membership credit pool is exhaustedWait for the monthly reset, upgrade, or use Extra Usage if enabled
VS Code says no workspace is openNo folder is open in VS CodeOpen a project folder before using the extension
VS Code says CLI not foundExtension cannot find the CLIInstall Kimi Code CLI manually or configure kimi.executablePath in VS Code settings
VS Code shows no responseCLI unavailable, no model configured, or no workspace folderConfirm the CLI is available, choose a model, open a folder, and check logs with “Kimi Code: Show Logs”
Connection timeout in VS CodeRequest did not respond within the timeout windowCheck network status and retry

Sources checked

This article was checked against official Kimi sources: the Kimi Code product page, the Kimi Code documentation overview, the Kimi Code CLI Getting Started guide, the Kimi Code Desktop Quick Start, the Kimi Code for VS Code Quick Start, the Kimi Code model configuration page, the Kimi Code membership benefits page, the Kimi Code FAQ, the Kimi Code error reference, the MCP documentation, the Agent Skills documentation, the Agents and Sub-Agents documentation, and the Hooks documentation.

FAQ

What is Kimi Code?

Kimi Code is an AI coding service from Moonshot AI for developers. It works through Desktop, CLI, VS Code, and supported third-party coding tools, helping with code reading, file editing, command execution, debugging, refactoring, tests, documentation, and repo analysis.

Is Kimi Code free?

Access to the official Kimi Code models is part of eligible Kimi membership benefits. Under the new plan structure, Go has no coding quota, while Plus and above include access. Kimi Code Desktop also supports a separately configured third-party model provider, with that provider’s own costs and limits. Check the current plan and provider before assuming usage is free.

How do I install Kimi Code CLI?

The official recommended install script is curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash for macOS/Linux and irm https://code.kimi.com/kimi-code/install.ps1 | iex for Windows PowerShell. You can also install with npm using npm install -g @moonshot-ai/kimi-code if you have Node.js 22.19.0 or later.

Is there a Kimi Code VS Code extension?

Yes. Kimi Code for VS Code is installed from the VS Code Marketplace. It supports editor chat, file/folder references with @, diff review, rollback support, model configuration, and authentication through Kimi account mode or API key mode.

What models does Kimi Code use?

The current Kimi Code model IDs are k3, k3-256k, kimi-for-coding, and kimi-for-coding-highspeed. They map to K3, K3 256K, K2.8 Preview, and K2.7 Code HighSpeed respectively.

What is the difference between k3 and k3-256k?

k3 is the K3 model with up to 1M context for eligible higher-tier members. k3-256k is the fixed 256K-context version of K3. Use k3 for very large contexts and k3-256k for routine tasks where 256K is enough.

What is kimi-for-coding?

kimi-for-coding is the Kimi Code model ID for K2.8 Preview. It supports up to 1M context and low, high, or max reasoning effort. It is a good starting point for routine development and code-completion workflows.

What is kimi-for-coding-highspeed?

kimi-for-coding-highspeed is the HighSpeed K2.7 Code model ID. It is intended for faster coding output and is available to Pro and above under the new plan structure. It speeds up model output, not external tools, builds, tests, or scripts.

Can Kimi Code edit files and run commands?

Yes. Kimi Code can read files, edit files, and run commands. In the official clients, read-only operations can happen automatically, while file modifications and shell commands may require confirmation depending on your approval settings. You should still review diffs and commands manually.

What is the difference between Kimi Code and Kimi Platform API?

Kimi Code supports coding-agent workflows in Desktop, CLI, VS Code, and compatible third-party coding tools. Its official model service uses membership benefits and quota rules; Desktop can alternatively connect to another model provider under that provider’s terms. Kimi Platform API is a separate pay-as-you-go platform for applications and product integrations.

Is Kimi Code safe for private repositories?

Kimi Code can work with local repositories, but safety depends on how you use it. Avoid pasting secrets, review every shell command, work in a Git branch, inspect diffs, and do not run project-level MCP servers, hooks, or agent overrides from repositories you do not trust.

Can Kimi Code replace a developer?

No. Kimi Code can speed up coding tasks, explore codebases, draft patches, and run checks, but a developer still needs to review architecture choices, security implications, tests, dependencies, performance, and production readiness.