Skip to content
Dashboard

Kimi K2.7 Code

Kimi K2.7 Code is Moonshot AI's coding-focused agentic model with stronger coding and agent performance than Kimi K2.6, less overthinking, and a context window of 262.1K tokens, available through AI Gateway via moonshotai, deepinfra, fireworks, baseten.

ReasoningTool UseImplicit CachingFile InputVision (Image)
index.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

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 moonshotai, deepinfra, fireworks, baseten 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 262.1K tokens and completions up to 32.8K tokens per request. Pricing through AI Gateway is $0.74 per million input tokens and $3.5 per million output tokens, with cached input at $0.15 per million tokens.