# Kimi K2.7 Code

Agentic coding with a leaner reasoning budget. Kimi K2.7 Code improves coding and agent performance over Kimi K2.6 while cutting thinking-token usage by roughly 30% on average.

- **Model ID:** `moonshotai/kimi-k2.7-code`
- **Type:** chat
- **Providers:** moonshotai
- **Context window:** 256,000
- **Maximum output tokens:** 32,768
- **Pricing:** $0.95/1M input tokens, $4/1M output tokens
- **Canonical page:** https://vercel.com/ai-gateway/models/kimi-k2.7-code

## Supported parameters

Detailed capability metadata has not been reported for this model.

## Example

```ts
import { streamText } from 'ai'

const result = streamText({
  model: 'moonshotai/kimi-k2.7-code',
  prompt: 'Why is the sky blue?'
})
```

## About

Kimi K2.7 Code, released on June 12, 2026, is Moonshot AI's coding-focused successor to Kimi K2.6. Kimi K2.7 Code is a Mixture-of-Experts model with one trillion total parameters and 32 billion active per forward pass, published under a Modified MIT license. Moonshot AI tunes this release for three things: stronger coding and agent performance, more efficient reasoning, and better instruction following across long-horizon coding sessions.

The efficiency shift is concrete. Kimi K2.7 Code spends roughly 30% fewer thinking tokens than Kimi K2.6 on average, which Moonshot AI frames as less overthinking. On Moonshot AI's own benchmark suite, Kimi K2.7 Code scores 62.0 on Kimi Code Bench V2 against 50.9 for Kimi K2.6, and 81.1 on MCP Mark Verified against 72.8. Treat those as vendor-reported numbers; they come from internal benchmarks without third-party verification at release.

Long-horizon execution is the other documented gain. Moonshot AI reports improved success on sequences exceeding 4,000 tool calls and runs lasting over 12 hours of continuous execution. The improvements generalize across Rust, Go, and Python, and across task types like frontend work, DevOps, and performance optimization. Reasoning stays on for every request: Kimi K2.7 Code always thinks before answering, and that mode can't be disabled.

Input is natively multimodal. Kimi K2.7 Code accepts images in formats like PNG, JPEG, WebP, and GIF, plus video in MP4, MOV, AVI, and others, with temporal analysis for video understanding. A coding agent can read a screenshot of a broken layout or a screen recording of a bug without a separate vision model in the pipeline.

Access Kimi K2.7 Code through AI Gateway by setting the model string to `moonshotai/kimi-k2.7-code`. Use the AI SDK or any supported interface like Chat Completions, Responses, or Messages, and AI Gateway routes across Moonshot AI with automatic failover. If you want faster serving of the same weights, `kimi-k2.7-code-highspeed` runs this model on a higher-throughput tier.

Kimi K2.7 Code supports a context window of 256K tokens and completions up to 32.8K tokens per request. Pricing through AI Gateway is $0.95 per million input tokens and $4 per million output tokens, with cached input at $0.19 per million tokens.

## What to consider

Kimi K2.7 Code always reasons before answering, and thinking mode can't be switched off. Budget output tokens for reasoning traces on top of the code Kimi K2.7 Code writes, and note the completion cap of 32.8K tokens per request. If deliberation never helps your workload, a non-thinking Kimi K2 variant avoids the reasoning overhead entirely.

## When to use

### Best For

- Long-horizon coding agents that chain thousands of tool calls across multi-hour sessions
- Reasoning-enabled coding at lower thinking-token overhead than Kimi K2.6
- Multi-language engineering work across Rust, Go, and Python, including frontend, DevOps, and performance tasks
- Debugging pipelines that feed screenshots or screen recordings directly into the coding loop

### Consider Alternatives When

- You want faster output from the same model. Kimi K2.7 Code High Speed serves the same weights on a higher-throughput tier
- Thinking mode must be optional. A non-thinking Kimi K2 variant gives you direct generation
- The work is general-purpose rather than code. Kimi K2.6 covers broader design-with-code and multimodal workflows
- You need visible chain-of-thought traces as a product feature. Kimi K2 Thinking is built around them

## Best for

- **Long-horizon coding agents:** Sessions that chain thousands of tool calls and keep executing for hours without losing the task thread
- **Token-efficient reasoning:** Coding workloads that benefit from thinking but paid too much reasoning overhead on earlier variants
- **Multi-language engineering:** Refactors, DevOps automation, and performance work across Rust, Go, and Python codebases
- **Visual debugging inputs:** Screenshots and screen recordings that feed directly into the coding loop without a separate vision model

## Consider alternatives

- **Faster serving of the same weights:** Kimi K2.7 Code High Speed runs the identical model on a higher-throughput tier for latency-sensitive agents
- **Optional thinking mode:** A non-thinking Kimi K2 variant skips the always-on reasoning when deliberation adds cost without quality
- **Work beyond code:** Kimi K2.6 covers broader design-with-code and general multimodal workflows
- **Visible reasoning traces:** Kimi K2 Thinking emits full chain-of-thought for products that surface deliberation to users

## Frequently asked questions

### What's new in Kimi K2.7 Code compared to Kimi K2.6?

Three things: stronger coding and agent performance, roughly 30% fewer thinking tokens on average, and better instruction following in long-horizon coding sessions. Moonshot AI's internal benchmarks show gains like 62.0 against 50.9 on Kimi Code Bench V2; treat those as vendor-reported numbers.

### Can I turn off thinking mode on Kimi K2.7 Code?

No. Kimi K2.7 Code always reasons before answering, and the mode can't be disabled. Budget output tokens for reasoning traces, and use a non-thinking Kimi K2 variant if deliberation never helps your workload.

### Does Kimi K2.7 Code accept images and video?

Yes. Kimi K2.7 Code takes images in formats like PNG, JPEG, WebP, and GIF, plus video in MP4, MOV, AVI, and others, with temporal analysis for video understanding. Confirm modality limits on https://platform.kimi.ai/docs/guide/kimi-k2-7-code-quickstart before you build a media-heavy pipeline.

### How long can Kimi K2.7 Code run in a single agentic session?

Moonshot AI reports improved success on sequences exceeding 4,000 tool calls and runs lasting over 12 hours of continuous execution. Plan your agent harness and token budgets around extended runs.

### Is Kimi K2.7 Code open weights?

Yes. Moonshot AI publishes the weights under a Modified MIT license. Through AI Gateway you get hosted access without managing the trillion-parameter deployment yourself.

### How do I use Kimi K2.7 Code on AI Gateway?

Use the identifier `moonshotai/kimi-k2.7-code` with the AI SDK or any supported interface like Chat Completions, Responses, or Messages. AI Gateway routes across `moonshotai` and handles failover automatically.

### Does Kimi K2.7 Code support zero data retention?

Yes, Zero Data Retention is available for this model. Zero Data Retention is offered on a per-provider basis. See https://vercel.com/docs/ai-gateway/capabilities/zdr for details.

## Links

- [Model page](https://vercel.com/ai-gateway/models/kimi-k2.7-code)
- [AI Gateway documentation](https://vercel.com/docs/ai-gateway)
- [Provider model documentation](https://platform.kimi.ai/docs/guide/kimi-k2-7-code-quickstart)


If you encounter incorrect information, can’t find what you need, need a capability Vercel doesn’t currently offer, or have any other feedback to report, please do it by following the instructions at https://vercel.com/feedback.md.
