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.
Use this model ID in the Kimi API and compatible coding tools.
Enough room for project files, logs, requirements and multi-turn plans.
K2.7 Code requires Thinking On; disabled thinking routes away or errors depending on the surface.
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.
Install the official developer tool and run K2.7 Code from the terminal.
Best for developers who want a managed coding workflow.
Use the Anthropic-compatible endpoint with kimi-k2.7-code environment variables.
Best for teams already using Claude Code-style flows.
Select Moonshot as provider, api.moonshot.cn as entrypoint and kimi-k2.7-code as the model.
Best for VS Code agent workflows.
Call the Kimi chat completions API with model kimi-k2.7-code.
Best for custom AI coding products and evaluation harnesses.
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.
curl -fsSL https://code.kimi.com/kimi-code/install.sh | bashRun the official installer from code.kimi.com, then authenticate before consuming Kimi Code quota.
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=262144After 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.
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.
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.
Claude Code, Cline and RooCode can use Kimi through Moonshot endpoints and provider settings.
Keep the model name, base URL and authentication token aligned.
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.
A coding-focused Kimi membership benefit and developer workflow.
Official docs describe it as Kimi's strongest coding model.
Use this in Kimi API and compatible third-party coding agents.
The latest model requires Thinking On in Kimi Code and preserved thinking in API docs.
Official docs show these routes for programming tools.
Hugging Face lists local and inference-provider usage options.
Kimi Code FAQ
Concise answers about Kimi Code, K2.7 Code, CLI setup, API integration, open weights and pricing.