Kimi K2.7 Code 是月之暗面在 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 参数的混合专家(MoE)架构,每 token 激活 32B(384 个专家,每 token 8 个另加 1 个共享),上下文为 256K,除文本外还接受图像输入,并始终运行在思考模式下,推理内容在多轮对话中保留。
- 非思考模式不只是不被建议,而是被拒绝:文档声明该模型不支持它,关闭思考会返回错误,保留思考在服务端被强制开启。
- 推理先于答案返回在 reasoning_content 中,指南明确要求你在工具调用的轮次把该字段随 assistant 消息一同回传,否则请求会报错,这是这个模型最常见的接入错误。
- 官方说法是,它在复杂软件工程工作流中强化了端到端的任务完成度,同时比 K2.6 少用约 30% 的思考 token,并通过 MCP 生态支持智能体式工具使用,可在多步工具调用之间交错思考。
- 月之暗面建议为 max_tokens 留出充足余量,因为推理会消耗它。
- 权重以修改版 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 的上下文长度是多少?
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 key 就能调用网关上的全部模型。
Kimi K2.7 Code 开源吗?
开源:权重以 Modified-MIT 许可证发布。不想自己备 GPU 也行:这里的托管版本按量付费,不需要自建基础设施。 运行开源权重模型 →
相关模型
对比
本页的每个数值都照录自供应商自己的文档(链接见上),并标有核对日期。价格是在整个目录范围内比较的;各家供应商定义不一样的规格项,只说明差异,不画图对比。这里没有任何一项是我们自己测的,也不打分。