Kimi Code setup guide
Add CodingPass to ~/.kimi-code/config.toml and run Claude and Kimi from one monthly allowance.
Kimi K3.1 Pro pairs a 2.8T-parameter MoE backbone and a 1M context window with large-scale reinforcement learning, now available under a Modified MIT license. Here are the verified benchmarks, real monthly bills for Standard vs Highspeed, and a minimal Kimi Code CLI config.
Moonshot AI rolled out Kimi K3.1 Pro and its accelerated sibling Kimi K3.1 Pro Highspeed on October 23, 2026 across its API platform and Kimi Code, then published the full open weights for moonshotai/Kimi-K3.1-Pro on Hugging Face on November 4. It is one of the few 3T-class open-weight releases built specifically for long-horizon coding agents, native vision, and 1M-token sessions.
In Moonshot's naming, Kimi K3.1 refers to this post-trained generation built on the Kimi K3 architecture, and the production flagship is Kimi K3.1 Pro alongside the latency-focused Highspeed variant.
Headline numbers: Kimi K3.1 Pro is a 2.8T-parameter sparse MoE (104B active) with a 1M context window, native vision, and Modified MIT open weights. On Moonshot's published evals it scores 51.7% on SWE-Marathon v1.1, 75.5% on DeepSWE v1.1, 65.7% on Terminal-Bench 4.0, and 92.1% on BrowseComp. Direct API pricing is $2.00/M input, $0.20/M cached input, and $10.00/M output. Highspeed runs 2–3× faster at $4.00/$20.00 while keeping cached reads at $0.20/M.
Rather than training a brand-new base from scratch, Moonshot kept the 2.8T Kimi K3 MoE scale and reworked long-context attention and post-training reinforcement learning across hundreds of domains.
That extra reinforcement learning shows up in multi-step agent loops rather than single-shot trivia. The trade-off is verbosity: Kimi K3.1 Pro thinks longer before answering, which matters when estimating output token bills and interactive latency.
Moonshot omitted traditional SWE-bench Verified and LiveCodeBench from its primary launch grid and focused on long-horizon agent benchmarks instead. Here is how Kimi K3.1 Pro compares against Claude Opus 5.5 and GPT-6 Astra in Moonshot's Hugging Face model card:
| Benchmark | Kimi K3.1 Pro | Claude Opus 5.5 | GPT-6 Astra | Notes |
|---|---|---|---|---|
| SWE-Marathon v1.1 | 51.7% | 46.3% | 42.5% | Long-horizon software engineering (model card) |
| DeepSWE v1.1 | 75.5% | 74.2% | 74.1% | Complex repository tasks (model card) |
| Terminal-Bench 4.0 | 65.7% | 66.4% | 58.2% | Terminal agent eval at max reasoning effort |
| BrowseComp | 92.1% | 90.8% | 91.5% | Agentic web retrieval with context compaction |
| HLE (with tools) | 70.0% | — | — | 51.1% without tools (model card) |
Independent evaluations broadly line up with those figures. Across Vals AI and Artificial Analysis harnesses, Kimi K3.1 Pro lands between 63.6% and 67.2% on Terminal-Bench 4.0. On the Artificial Analysis Intelligence Index it scores 47, well ahead of the open-weight median (~23).
Artificial Analysis also flags the latency profile: standard first-party throughput averages around 36 tokens/s (third-party inference clouds push 49–200 tokens/s depending on hardware), and long reasoning traces bring the average benchmark task cost to roughly $3.68. For rapid back-and-forth edits in a terminal, you will feel that difference unless you use Highspeed or route small edits to a faster model.
Moonshot AI (platform.moonshot.ai) offers two endpoints with identical intelligence, vision, and 1M context—kimi-k3.1-pro and kimi-k3.1-pro-highspeed (2–3× faster generation):
| Rate (per 1M tokens) | kimi-k3.1-pro | kimi-k3.1-pro-highspeed |
|---|---|---|
| Uncached input | $2.00 | $4.00 |
| Cached input (cache hit) | $0.20 | $0.20 |
| Output | $10.00 | $20.00 |
| Cache write (5 min) | $2.00 | $4.00 |
| Cache write (1 hour) | $4.00 | $8.00 |
List rates only tell half the story because coding agents repeat most of the prompt context on every turn. Using a typical coding-agent request profile (100K tokens per request: 5K uncached input, 94K cached input, 1K output), the per-request formula is:
Cost per request = 0.005 × Input + 0.094 × Cached Input + 0.001 × Output
| Monthly volume | Standard (94% cache hit) | Highspeed (94% cache hit) | Standard (no cache) |
|---|---|---|---|
| 1,000 requests / mo (solo light) | $38.80 | $58.80 | $208.00 |
| 3,000 requests / mo (daily agent) | $116.40 | $176.40 | $624.00 |
| 10,000 requests / mo (heavy / multi-agent) | $388.00 | $588.00 | $2,080.00 |
Two numbers stand out here. First, prompt caching drops a Standard request from $0.208 to $0.0388—more than an 80% reduction. Second, because Highspeed keeps cached reads at $0.20/M, a 94%-cached coding session costs $0.0588 per request instead of $0.0388—roughly 1.5× the Standard bill, not 2×.
If you split your work between Kimi and Claude and want a fixed monthly bill instead of juggling pay-as-you-go API accounts, CodingPass includes kimi-k3.1-pro and kimi-k3 on Plus and up (from $30/month) alongside Claude Opus 5.5 and Sonnet 5.5, all metered at official API prices against one monthly allowance. On Go (from $10/month), you can pair Claude Sonnet 5.5 with Kimi K2.7 Code. See all models and pricing for exact tier allowances.
Moonshot archived the older Python kimi-cli and replaced it with Kimi Code CLI, distributed as a single binary with no Node.js dependency:
# Install Kimi Code CLI on macOS / Linuxcurl -fsSL https://code.kimi.com/kimi-code/install.sh | bash # Verifykimi --versionIf you prefer npm (Node.js 22.19+), run npm install -g @moonshot-ai/kimi-code. From any project directory, kimi opens the interactive TUI, kimi web launches a local browser workspace, and kimi acp connects to Agent Client Protocol editors such as Zed and JetBrains.
Kimi Code reads providers and models from ~/.kimi-code/config.toml. This minimal config routes kimi-k3.1-pro and claude-sonnet-5-5 through CodingPass so you can switch models inside one session:
default_model = "codingpass/kimi-k3.1-pro" [providers.codingpass]type = "openai"base_url = "https://codingpass.ai/v1"api_key = "cp-live-YOUR_KEY" [models."codingpass/kimi-k3.1-pro"]provider = "codingpass"model = "kimi-k3.1-pro"max_context_size = 1000000capabilities = ["thinking", "tool_use"] [models."codingpass/claude-sonnet-5-5"]provider = "codingpass"model = "claude-sonnet-5-5"max_context_size = 200000capabilities = ["thinking", "tool_use"]To call Moonshot's direct API instead, point base_url to https://api.moonshot.ai/v1 with your Moonshot key, or swap model to kimi-k3.1-pro-highspeed for faster output. Full setup notes and /compact workflow tips are in the Kimi Code setup guide.
For scripts, CI checks, or OpenAI-compatible agents like OpenCode:
curl https://api.moonshot.ai/v1/chat/completions \ -H "Authorization: Bearer $MOONSHOT_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "kimi-k3.1-pro", "messages": [ {"role": "user", "content": "Review this migration diff for lock contention."} ] }'| Workload | Recommended pick | Why / trade-off |
|---|---|---|
| Large-repo refactors and long investigations | kimi-k3.1-pro | 1M context and 51.7% SWE-Marathon; under $0.04/request with cache hits |
| Interactive terminal coding loops | kimi-k3.1-pro-highspeed | 2–3× faster output at roughly 1.5× the cached monthly bill |
| Routine CRUD, tests, and quick edits | kimi-k2.7-code or claude-sonnet-5-5 | Shorter reasoning traces, faster turnaround, available from Go tier |
| Mixed Kimi + Claude agent workflow | Kimi Code CLI + CodingPass | One monthly allowance across Kimi K3.1 Pro and Claude Opus 5.5 |
In practice, pairing kimi-k3.1-pro for broad codebase exploration and log analysis with kimi-k3.1-pro-highspeed or flagship Claude inside Claude Code gives you both the 1M-context depth and snappy day-to-day edits.
No. Kimi K3.1 is the post-trained generation built on Moonshot's Kimi K3 backbone; the released API models are kimi-k3.1-pro and kimi-k3.1-pro-highspeed, and the Hugging Face open-weight repository is moonshotai/Kimi-K3.1-Pro.
Yes. OpenCode and Kimi Code CLI both accept an OpenAI-compatible base_url with model ID kimi-k3.1-pro. With CodingPass, one API key works across Kimi Code, OpenCode, and Claude Code.
Keep your prompt prefix stable so cache hit rates stay above 90% ($0.20/M cached input vs $2.00/M uncached), and run /compact in Kimi Code CLI whenever you finish a subtask so stale history is not re-processed on every turn. See how allowances and caps work for reset window details.
Plus starts at