New Sign up free, 10 calls on us. Up to $1, no card needed.

Kimi K2.7 Code

Released 2026-06

chatCodeReasoningTool callingVision

Kimi K2.7 Code is Moonshot AI's coding-focused agentic model built upon Kimi K2.6, tuned for real-world software engineering and described by Moonshot as its dedicated coding model, following instructions more reliably in long contexts and completing coding tasks at higher success rates.

Input
text image video $0.95/M
Output
text $4/M
Cache read
$0.19/M
Context
256K
vs GPT-4o
~81% cheaper

Benchmarks

Above average1 / 5
Kimi K2.7 Code other models measured peer average no peer scored higher
MLS-Bench-Lite
35.1%
MCP-Atlas
76%

Vendor-published: Alibaba (Qwen) Moonshot OpenAI Z.ai

Price in context

Where the price sits among 60 comparable models

Input$0.95/M
$0.05 · Qwen3 VL Flash GPT-5.4 Pro · $30
Output$4/M
$0.275 · DeepSeek V4 Flash GPT-5.4 Pro · $180
Cached read$0.19/M
$0.0028 · DeepSeek V4 Flash GPT-5.4 Pro · $15

The bar shows how this model’s price compares with every other model of the same kind on Synthorai. The cheapest and the most expensive are named at each end. These are base rates; batch, region and cache-write discounts are on the pricing page.

Specs & limits

Tokens

Context window (vendor spec) 256,000
Max output (vendor spec) 32,768

Prompt caching

How it caches automatic

Thinking

Vendor control thinking.type + thinking.keep
Accepted values type accepts only enabled; keep accepts only all
Default thinking on with Preserved Thinking on applied when the request sets nothing
Can be turned off No
Thinking behaviour Passing type disabled returns an error; because Preserved Thinking is forced server-side, every historical assistant message's reasoning_content must be passed back as-is.
Parameter reasoning_effort
Values minimal · low · medium · high the gateway's parameter surface - the vendor mapping above applies

Model

Modalities text + image + video → text
Parameters 1T total · 32B active MoE
License Modified-MIT
  • Coding-focused agentic model built on K2.6: 1T/32B active MoE, 256K context
  • thinking always on with preserved reasoning across turns
  • ~30% fewer thinking tokens vs K2.6

per Moonshot official docs ↗

One prompt, measured through the gateway

PROMPT Explain to a CFO, in exactly three sentences, why our LLM bill doubled after we enabled reasoning. CHECK exactly 3 sentences

Kimi K2.7 Code passed · 3 sentences

Enabling reasoning mode causes the model to generate an internal chain-of-thought before producing each answer, and that hidden reasoning text is billed like any other output. Those extra reasoning tokens typically add up to much more than the final response itself, so every API call now costs significantly more than before. Because our overall usage volume did not change, the doubled bill reflects that each query consumes roughly twice as many billable tokens.

out 259 tok (+174 thinking) latency 5.4 s

Instruction following (exactly three sentences - countable), audience shaping (CFO register), and the hidden-thinking billing gap the token meters below expose.

PROMPT This function is supposed to return the longest run of consecutive equal items, but callers report it is off by one on single-element inputs and misses runs that end at the last index. Fix it and explain the bug in one paragraph. CHECK fix passes tests

Kimi K2.7 Code passed · 8/8 cases

```python def longest_run(xs): if not xs: return 0 best = 1 cur = 1 for i in range(1, len(xs)): if xs[i] == xs[i - 1]: cur += 1 best = max(best, cur) else: cur = 1 return best ``` The bug is that the function counts *transitions* between equal neighbors instead of counting the items themselves, so a single-element list never enters the loop and returns `0` instead of `1`. Likewise, resetting `cur` to `0` on a mismatch forgets the current item that starts a new run, which causes runs that end at the last index to be undercounted. Initializing both `best` and `cur` to `1` and resetting `cur` to `1` fixes both issues.

out 410 tok (+222 thinking) latency 9.4 s

Whether the fix is actually correct (runnable), explanation density, and token efficiency on a bounded task.

PROMPT Extract a JSON object with fields {company, quarter, revenue_usd_m, growth_pct, guidance} from this text. Use null for anything not stated; add no other fields. CHECK valid JSON, schema exact

Kimi K2.7 Code passed · 5/5 fields, guidance "withheld pending the Q4 close"

```json { "company": "Meridian Robotics", "quarter": "September quarter", "revenue_usd_m": 412, "growth_pct": 11, "guidance": "withheld pending the Q4 close" } ```

out 721 tok (+663 thinking) latency 13.2 s

Schema obedience (no invented fields), hallucination pressure (guidance is explicitly withheld), and structured-output path differences.

PROMPT Write a 120-word product announcement for an API gateway feature that caches prompts across providers. Forbidden words: "seamless", "unlock", "game-changer", "revolutionize", "empower". Exactly one sentence must be a question. CHECK 120 words, 0 banned words

Kimi K2.7 Code passed · 120 words, 0 banned, 1 question

We're introducing Prompt Cache for our API Gateway, a new capability that stores prompt responses across multiple AI providers. By caching replies, you reduce redundant calls, lower latency, and cut costs without changing how you build. Teams using several model providers can now reuse identical prompt results instantly, keeping traffic consistent and budgets predictable. Responses are keyed by provider, model, and exact prompt, so you always get the right result. Configure TTL, hit thresholds, and eviction rules from a single dashboard. It fits into your existing routing and requires no code changes. Setup takes minutes and works with your current endpoints. Want to see how much latency and spend you can trim? Check the docs to enable Prompt Cache today.

out 2375 tok (+2235 thinking) latency 38.6 s

Constraint obedience (word budget, banned-word list, the single question), style fingerprint, and length control.

Use Kimi K2.7 Code in 30 seconds

OpenAI-compatible: swap the base_url, keep your SDK. POST /v1/chat/completions

from openai import OpenAI

client = OpenAI(
    base_url="https://synthorai.io/v1",
    api_key="sk-syn-...",
)

resp = client.chat.completions.create(
    model="kimi-k2.7-code",
    messages=[{"role": "user", "content": "Summarize this diff"}],
    reasoning_effort="medium",
)
print(resp.choices[0].message.content)

About Kimi K2.7 Code

  • It keeps the 1T-parameter Mixture-of-Experts architecture with 32B activated per token (384 experts, eight per token plus one shared) and a 256K context, accepts image input alongside text, and always runs in thinking mode with reasoning content preserved across multi-turn conversations.
  • Non-thinking mode is not merely discouraged but rejected: the docs state the model does not support it and that disabling thinking returns an error, with preserved thinking forced on server-side.
  • Reasoning arrives in reasoning_content ahead of the answer, and the guide is explicit that you must feed that field back with the assistant message on tool-calling turns or the request errors, which is the single most common integration mistake with this model.
  • Officially, it strengthens end-to-end task completion across complex software engineering workflows while using about 30% fewer thinking tokens than K2.6, and supports agentic tool use through the MCP ecosystem with interleaved thinking across multi-step tool calls.
  • Moonshot advises leaving generous max_tokens headroom because reasoning consumes it.
  • Weights are open under a Modified MIT license.
  • Access Kimi K2.7 Code on Synthorai through the OpenAI-compatible endpoint.

FAQ

Is the Kimi K2.7 Code API free to try?

Yes: new accounts get 10 trial calls and up to $1 in free credit, no card required. At $0.95/M input tokens, that credit alone covers roughly 131 requests of ~8K tokens against Kimi K2.7 Code.

What is Kimi K2.7 Code best at?

About 30% fewer thinking tokens; reasoning preserved across multi-turn conversations; tuned for real-world software engineering. See the About section for the full picture from the vendor's own release notes.

How much does Kimi K2.7 Code cost?

Kimi K2.7 Code costs $0.95 per million input tokens and $4 per million output tokens on Synthorai. That is the provider's list price, with no platform markup. Cached input tokens bill at $0.19/M.

Does Kimi K2.7 Code support prompt caching?

Yes, automatically: Moonshot-served prompts cache with no code changes. Cached input tokens bill at $0.19/M vs $0.95/M uncached. Prompt caching guide →

How do I get access to Kimi K2.7 Code?

Point your existing OpenAI SDK at base_url="https://synthorai.io/v1", set model="kimi-k2.7-code", and you're done. One API key covers every model on the gateway.

Is Kimi K2.7 Code open source?

Yes: the weights are published under the Modified-MIT license. Or skip the GPUs: the hosted version here is pay-as-you-go with no infrastructure to run. Running open-weight models →

Related models

Compare

Every value on this page is transcribed from the vendor's own documentation, linked above, and carries the date it was checked. Prices are compared across the catalogue; specification values that vendors define differently are shown with the difference stated rather than charted. Nothing here is measured by us, and nothing is scored.

Get your API key Compare your cost →