Kimi Code hub
K2.7 Code updated June 12, 2026
Open-weight model

Kimi Code: use Kimi K2.7 Code in CLI, IDE agents and API workflows

Kimi Code is the developer-facing path for Kimi K2.7 Code: a coding-focused K2 model for long-context codebase work, debugging, refactoring, test generation and agent workflows.

Use this as a practical map for the official Kimi Code CLI, Claude Code-compatible setup, Cline and RooCode, the kimi-k2.7-code API model ID, open-weight evaluation, pricing caveats and safe long-running agent work.

Kimi Code quick facts
Model ID
kimi-k2.7-code

Use this model ID in the Kimi API and compatible coding tools.

Context window
262,144 tokens

Enough room for project files, logs, requirements and multi-turn plans.

Thinking mode
Always on

K2.7 Code requires Thinking On; disabled thinking routes away or errors depending on the surface.

Release status
Released and open-sourced

Official Kimi Code docs list K2.7 Code as the latest coding model.

Choose the right Kimi Code entry point

Pick the route that matches how you code: a managed CLI, an existing IDE agent, direct API calls or open-weight evaluation.

Kimi Code CLI

Install the official developer tool and run K2.7 Code from the terminal.

Best for developers who want a managed coding workflow.

Claude Code setup

Use the Anthropic-compatible endpoint with kimi-k2.7-code environment variables.

Best for teams already using Claude Code-style flows.

Cline and RooCode

Select Moonshot as provider, api.moonshot.cn as entrypoint and kimi-k2.7-code as the model.

Best for VS Code agent workflows.

Direct API

Call the Kimi chat completions API with model kimi-k2.7-code.

Best for custom AI coding products and evaluation harnesses.

Open weights

Evaluate moonshotai/Kimi-K2.7-Code through Hugging Face, vLLM, SGLang or compatible local stacks.

Best for open-weight research and self-hosting experiments.

Fast setup for Kimi Code and compatible agents

Start with official Kimi Code for the simplest path, or configure an Anthropic-compatible agent when you want to keep an existing workflow.

Use official Kimi Code when you want a managed CLI with K2.7 Code already wired in.
Use Claude Code-compatible settings when your workflow expects Anthropic-style environment variables.
Use Cline or RooCode when your work happens inside VS Code and you want tool-based file edits.
Use the API when you need evaluation scripts, product features, or your own model router.
Official Kimi Code install command
curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash

Run the official installer from code.kimi.com, then authenticate before consuming Kimi Code quota.

Claude Code-compatible environment
export ANTHROPIC_BASE_URL=https://api.moonshot.cn/anthropic
export ANTHROPIC_AUTH_TOKEN=$MOONSHOT_API_KEY
export ANTHROPIC_MODEL=kimi-k2.7-code
export CLAUDE_CODE_SUBAGENT_MODEL=kimi-k2.7-code
export CLAUDE_CODE_AUTO_COMPACT_WINDOW=262144

After setting the variables, check model status inside the agent and make sure Thinking mode is enabled for K2.7 Code.

From first trial to production use

Treat Kimi Code as a coding workflow: choose the entry point, configure the model, keep tasks bounded, and monitor quota during long agent runs.

Understand the product

Kimi Code is the coding workflow around Kimi K2.7 Code, built for terminal, IDE and agent use.

Use this when comparing Kimi Code with direct chat or API-only access.

Select the model path

The main model ID is kimi-k2.7-code; keep Thinking enabled for the current K2.7 Code path.

Useful for API setup, benchmarks and tool configuration.

Connect your tools

Claude Code, Cline and RooCode can use Kimi through Moonshot endpoints and provider settings.

Keep the model name, base URL and authentication token aligned.

Control cost and scope

Coding agents can retry, call tools and produce long reasoning. Clear budgets and bounded tasks matter.

Break large jobs into reviewable steps before starting long runs.

Official facts to keep straight
Official product
Kimi Code

A coding-focused Kimi membership benefit and developer workflow.

Latest model
Kimi K2.7 Code

Official docs describe it as Kimi's strongest coding model.

Model ID
kimi-k2.7-code

Use this in Kimi API and compatible third-party coding agents.

Thinking
Enabled for K2.7 Code

The latest model requires Thinking On in Kimi Code and preserved thinking in API docs.

Integrations
Claude Code, Cline, RooCode, API

Official docs show these routes for programming tools.

Open weights
moonshotai/Kimi-K2.7-Code

Hugging Face lists local and inference-provider usage options.

Accuracy and safety notes
kimi-k2.org is an unofficial resource; use official Kimi links for account, billing and security-sensitive actions.
Do not assume free unlimited usage: Kimi Code quota and API billing depend on the user account and plan.
Long agent runs can spend tokens quickly because tools, retries and test loops add extra calls.
For K2.7 Code, keep Thinking enabled; disabled thinking is not a valid path for the latest model.

Kimi Code FAQ

Concise answers about Kimi Code, K2.7 Code, CLI setup, API integration, open weights and pricing.

What is Kimi Code?
Kimi Code is Moonshot AI's developer-facing coding workflow for Kimi. It lets developers use Kimi K2.7 Code through terminal, IDE and agent workflows rather than only a chat interface.
How do I install Kimi Code?
The official Kimi Code page provides the installer command curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash. After installation, authenticate before using Kimi Code quota.
What model does Kimi Code use?
The latest Kimi Code experience is powered by Kimi K2.7 Code. In API and compatible tools, the model ID to look for is kimi-k2.7-code.
Can I use Kimi K2.7 Code in Claude Code?
Yes. Official integration docs show an Anthropic-compatible endpoint with ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN and ANTHROPIC_MODEL set to kimi-k2.7-code.
Does Kimi K2.7 Code work with Cline or RooCode?
Yes. The official guide recommends selecting Moonshot as provider, api.moonshot.cn as the entrypoint, adding your Moonshot API key and choosing kimi-k2.7-code as the model.
Is Kimi K2.7 Code open source?
Official Kimi Code docs describe Kimi K2.7 Code as released and open-sourced, and Hugging Face lists the model as moonshotai/Kimi-K2.7-Code. Check the current model card for license details before production use.
Does Kimi K2.7 Code require Thinking mode?
Yes for the latest K2.7 Code path. Kimi Code docs say K2.7 Code takes effect only with Thinking On, and API docs state K2.7 Code does not support disabled thinking.
How much does Kimi Code cost?
Kimi Code availability depends on Kimi membership and quota, while API use follows Kimi API model pricing. Because coding agents can make many calls, set budgets and monitor long runs.
What tasks is Kimi Code best for?
It is best suited for codebase understanding, debugging, refactoring, tests, multi-file edits, UI work from screenshots, and agent workflows that need long context.
Should I use Kimi Code or the API?
Use Kimi Code for a ready developer workflow. Use the API when you need automation, custom products, benchmarking, or your own routing around kimi-k2.7-code.

Try Kimi Code, then use the deeper K2.7 guide

Start with the official tool, then read the practical Kimi K2.7 Code guide for examples, API notes and coding-agent setup details.