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
價格在同類中的位置
價格在 68 個同類模型中的位置
這條線標出這個模型的價格,在 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 的輸入價是每百萬 token $0.95,輸出價是每百萬 token $4。這就是供應商官網價,平台不加價。快取命中的輸入 token 以 $0.19/M 計費。
Kimi K2.7 Code 的上下文長度是多少?
Kimi K2.7 Code 的上下文長度(上下文視窗)是 256K token。單次回覆最多輸出 32,768 個 token。
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 金鑰就能呼叫閘道上的所有模型。
Kimi K2.7 Code 是開源的嗎?
是,權重以 Modified-MIT 授權釋出。不想自己準備 GPU 的話,這裡的託管版本按用量計費,不必自己架設基礎設施。 執行開放權重模型 →
相關模型
比較
本頁每一個數值都摘錄自供應商自己的文件(連結見上方),並附上查核日期。價格是放在整個目錄裡比較;各家供應商定義不一樣的規格,只說明差異,不畫成圖表比較。這裡沒有任何數據是我們自己量測的,也不做評分。