Kimi K2.7 Code
moonshotai/kimi-k2.7-code
Overview
Chat
Moonshot's coding model. It follows instructions more reliably in long contexts and completes coding tasks at a higher success rate.
Made by MoonshotAI · released Jun 2026
Input
TextOutput
Text- Context
- 262.144
- Input, maximum
- 196.608
- Output, maximum
- 65.536
- Default output
- 4.096
- Reasoning Supported
- Tool calling Supported
- Prompt caching Supported
- Automatic fallback routes Not supported
Routes and pricing
Providers are tried in the order listed below. We try these providers in order. If one fails, we move on to the next, and you pay the rate of the one that answers.
Moonshot
primary- Input
- Rp17.580per million tokens$0.95
- Output
- Rp74.000per million tokens$4
- Cache read
- Rp3.520per million tokens$0.19
Today's reference rate: Rp18.500/USD
Prices exclude the 5,5% service fee
Data and privacy
Moonshot Kimi Open Platform Terms of Service
- Used to train models
- Possibly May be used to improve the service; restricting that needs a separate enterprise agreement.
- Retention
- Not stated in the policy.
- Processing location
- Not stated in the policy.
- At indoRouter
- We don't store your prompts or responses. Files you upload, batches, and responses you send with
store: trueare kept encrypted for up to 30 days.
Code samples
Use this model ID with any OpenAI SDK. The base URL is the same for every model.
curl https://api.indorouter.ai/v1/chat/completions \
-H "authorization: Bearer $INDOROUTER_API_KEY" \
-H "content-type: application/json" \
-d '{"model": "moonshotai/kimi-k2.7-code",
"messages": [{"role": "user", "content": "halo"}]}'
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.indorouter.ai/v1",
api_key=os.environ["INDOROUTER_API_KEY"],
)
reply = client.chat.completions.create(
model="moonshotai/kimi-k2.7-code",
messages=[{"role": "user", "content": "halo"}],
)
print(reply.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.indorouter.ai/v1",
apiKey: process.env.INDOROUTER_API_KEY,
});
const reply = await client.chat.completions.create({
model: "moonshotai/kimi-k2.7-code",
messages: [{ role: "user", content: "halo" }],
});
console.log(reply.choices[0].message.content);