Kimi K2.7 Code
MoonshotAI: Kimi K2.7 Code is a coding-focused model in Moonshot AI's Kimi K2 family, built to complete end-to-end programming tasks reliably over long contexts.
Not on a home PC. Kimi K2.7 Code is an open model, but even the 4-bit version needs about 652 GB of memory, which takes server-class hardware. You can download the weights, or use it through one of the providers below.
How it compares
Models closest in score, open and proprietary together.
What it costs
Through an API, per million tokens.
Cached input: $0.12 per million.
Flat-rate subscriptions can cost far less than API list prices for heavy use. Treat this as a reference, not a bill.
Where to run it through an API
Same open model, several inference providers, very different prices. Cheapest first.
Prices from OpenRouter’s public provider list. “Precision” is how the weights are stored: a lower-precision copy (fp4, fp8) is cheaper and faster but can be slightly less accurate. Uptime over the last 30 minutes.
Call Kimi K2.7 Code through the API
OpenRouter exposes this model through an OpenAI-compatible API. Create a key on OpenRouter, then use the model identifier moonshotai/kimi-k2.7-code.
Python
import os
from openai import OpenAI
client = OpenAI(
base_url="https://openrouter.ai/api/v1",
api_key=os.environ["OPENROUTER_API_KEY"],
)
response = client.chat.completions.create(
model="moonshotai/kimi-k2.7-code",
messages=[{"role": "user", "content": "Explain 4-bit quantization in two sentences."}],
)
print(response.choices[0].message.content)JavaScript
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://openrouter.ai/api/v1",
apiKey: process.env.OPENROUTER_API_KEY,
});
const response = await client.chat.completions.create({
model: "moonshotai/kimi-k2.7-code",
messages: [{ role: "user", content: "Explain 4-bit quantization in two sentences." }],
});
console.log(response.choices[0].message.content);cURL
curl https://openrouter.ai/api/v1/chat/completions \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "moonshotai/kimi-k2.7-code",
"messages": [{"role": "user", "content": "Explain 4-bit quantization in two sentences."}]
}'Prices and providers are in the sections above. Check the exact identifier on the OpenRouter model page.
Specifications
Where to get it
Download on Hugging Face GGUF files for local use Use it through OpenRouterTo run it on your own machine, the two easiest tools are Ollama and LM Studio.
Frozen facts (name, specifications, links) are fixed when the page is created. Scores, prices and download numbers: refreshed daily; last update 24 Nov 2026. Scores: Epoch AI (Capabilities & benchmarking, CC BY 4.0), adapted by KernelFox.