Kimi K2.7 Code 是月之暗面(Moonshot AI)在 Kimi K2.6 之上打造、聚焦編碼的智慧體模型,針對真實世界的軟體工程調校,月之暗面稱它是自家專用的編碼模型,在長上下文中更可靠地遵循指令,並以更高的成功率完成編碼任務。
- 輸入
- 文字 影像 影片 $0.95/M
- 輸出
- 文字 $4/M
- 快取讀取
- $0.19/M
- 上下文
- 256K
- 相較 GPT-4o
- 便宜約 81%
Benchmark 成績
廠商公布: Alibaba (Qwen) Moonshot OpenAI Z.ai
價格在同類中的位置
價格在 60 個同類模型中的位置
這條線顯示該模型的價格,在 Synthorai 上同類模型裡處於什麼位置。兩端標出了最便宜和最貴的那個。這裡是基礎價,批次、區域與快取寫入的折扣見價格頁。
規格與限制
Token
| 上下文視窗(廠商規格) | 256,000 |
|---|---|
| 最大輸出(廠商規格) | 32,768 |
提示詞快取
| 快取方式 | 自動 |
|---|
思考
| 廠商參數 | thinking.type + thinking.keep |
|---|---|
| 可選值 | type accepts only enabled; keep accepts only all |
| 預設值 | 思考開啟,且 Preserved Thinking 一併開啟 請求未指定時生效 |
| 可關閉 | 不支援 |
| 思考行為 | 傳入 type disabled 會回傳錯誤;由於 Preserved Thinking 由伺服器端強制開啟,每一條歷史 assistant 訊息的 reasoning_content 都必須原樣回傳。 |
| 參數 | reasoning_effort |
| 取值 | minimal · low · medium · high 閘道側參數面——以上方廠商映射為準 |
模型
| 模態 | 文字 + 影像 + 影片 → 文字 |
|---|---|
| 參數量 | 總參數 1T · 啟用 32B MoE |
| 授權條款 | Modified-MIT |
- 基於 K2.6 打造、聚焦編碼的智慧體模型:1T 總參數 / 32B 啟用的 MoE,256K 上下文
- 思考始終開啟並跨輪保留推理
- 思考 token 相比 K2.6 約少 30%
單一提示詞 — 經由閘道測量
Kimi K2.7 Code 通過 · 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.
輸出 259 tok (+174 思考) 延遲 5.4 s
指令遵循(恰好三句,可數)、受眾適配(面向 CFO 的語氣),以及下方 token 計量所暴露的隱藏思考計費缺口。
Kimi K2.7 Code 通過 · 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.
輸出 410 tok (+222 思考) 延遲 9.4 s
修復是否真的正確(可執行)、解釋的資訊密度,以及在一個邊界明確的任務上的 token 效率。
Kimi K2.7 Code 通過 · 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" } ```
輸出 721 tok (+663 思考) 延遲 13.2 s
schema 服從度(不臆造欄位)、幻覺壓力(guidance 明確被暫緩給出),以及結構化輸出路徑的差異。
Kimi K2.7 Code 通過 · 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.
輸出 2375 tok (+2235 思考) 延遲 38.6 s
約束服從度(字數預算、禁用詞表、唯一的那句問句)、文風指紋,以及長度控制。
30 秒用上 Kimi K2.7 Code
OpenAI 相容:換掉 base_url,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)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://synthorai.io/v1",
apiKey: "sk-syn-...",
});
const resp = await client.chat.completions.create({
model: "kimi-k2.7-code",
messages: [{ role: "user", content: "Summarize this diff" }],
reasoning_effort: "medium",
});
console.log(resp.choices[0].message.content);curl https://synthorai.io/v1/chat/completions \
-H "Authorization: Bearer sk-syn-..." \
-H "Content-Type: application/json" \
-d '{
"model": "kimi-k2.7-code",
"messages": [{"role": "user", "content": "Hello"}],
"reasoning_effort": "medium"
}'package main
import (
"context"
"fmt"
"github.com/openai/openai-go/v3"
"github.com/openai/openai-go/v3/option"
)
func main() {
client := openai.NewClient(
option.WithBaseURL("https://synthorai.io/v1"),
option.WithAPIKey("sk-syn-..."),
)
resp, _ := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
Model: "kimi-k2.7-code",
Messages: []openai.ChatCompletionMessageParamUnion{
openai.UserMessage("Summarize this diff"),
},
ReasoningEffort: openai.ReasoningEffortMedium,
})
fmt.Println(resp.Choices[0].Message.Content)
}import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.chat.completions.*;
import com.openai.models.ReasoningEffort;
OpenAIClient client = OpenAIOkHttpClient.builder()
.baseUrl("https://synthorai.io/v1")
.apiKey("sk-syn-...")
.build();
ChatCompletion resp = client.chat().completions().create(
ChatCompletionCreateParams.builder()
.model("kimi-k2.7-code")
.addUserMessage("Summarize this diff")
.reasoningEffort(ReasoningEffort.MEDIUM)
.build());
System.out.println(resp.choices().get(0).message().content().orElse(""));關於 Kimi K2.7 Code
- 它保留 1T 參數的混合專家架構,每 token 啟用 32B(384 個專家,每 token 八個並加一個共享專家),具備 256K 上下文,除文字外也接受影像輸入,並始終以思考模式執行,推理內容跨多輪對話保留。
- 非思考模式不只是不建議,而是直接被拒絕:文件指出該模型不支援,關閉思考會回傳錯誤,保留思考則由伺服器端強制開啟。
- 推理會先於答案回傳在 reasoning_content 中,指南明確要求在工具呼叫的輪次把該欄位連同 assistant 訊息一起傳回,否則請求會出錯,而這正是這個模型最常見的整合錯誤。
- 官方說法是,它在複雜軟體工程流程中強化了端到端的任務完成度,同時比 K2.6 少用約 30% 的思考 token,並透過 MCP 生態支援智慧體式工具使用,可在多步工具呼叫之間交錯思考。
- 月之暗面建議為 max_tokens 留出充裕餘量,因為推理會消耗它。
- 權重以 Modified MIT 授權開放。
- 在 Synthorai 上,透過 OpenAI 相容端點即可使用 Kimi K2.7 Code。
常見問題
Kimi K2.7 Code API 可以免費試用嗎?
可以,新帳號可獲得 10 次試用呼叫和最高 $1 的免費額度,無需信用卡。以輸入 $0.95/M 計算,光是這筆額度就足以對 Kimi K2.7 Code 發出約 131 次 ~8K token 的請求。
Kimi K2.7 Code 最擅長什麼?
思考 token 用量少約 30%、推理內容跨多輪對話保留、為真實軟體工程調優。完整能力請見「關於」一節,內容取自廠商官方發布說明。
Kimi K2.7 Code 的價格是多少?
在 Synthorai 上,Kimi K2.7 Code 輸入 $0.95/百萬 token、輸出 $4/百萬 token,即廠商牌價,無平台加價。快取命中的輸入 token 以 $0.19/M 計費。
Kimi K2.7 Code 支援提示詞快取(prompt caching)嗎?
支援,且全自動:由 Moonshot 供應的提示詞會自動快取,無需改程式碼。快取命中的輸入 token 以 $0.19/M 計費(未命中 $0.95/M)。 提示詞快取指南 →
如何開通 Kimi K2.7 Code?
把現有 OpenAI SDK 的 base_url 指向 "https://synthorai.io/v1",model 設為 "kimi-k2.7-code" 即可。一組 API key 通用閘道上的所有模型。
Kimi K2.7 Code 是開源的嗎?
是,權重以 Modified-MIT 授權 發布。也可以省下 GPU:這裡的託管版本按用量計費,無需自建基礎設施。 執行開放權重模型 →
相關模型
對比
本頁每個值都轉錄自廠商自己的文件(連結見上),並帶有核對日期。價格在全目錄範圍內比較;各廠商定義不同的規格值,只說明差異而不作圖表對比。此處沒有任何由我們測量的資料,也不做評分。