GLM-5.2 是 Z.AI 面向长程任务时代打造的旗舰模型,把上下文窗口扩展到 1M token,输出最高 128K;文档强调让 1M 上下文在项目级工作中真正可用。
- 输入
- 文本 $1.4/M
- 输出
- 文本 $4.4/M
- 缓存读取
- $0.26/M
- 上下文
- 1M
- 对比 GPT-4o
- 便宜约 72%
Benchmark 成绩
供应商公布: Alibaba (Qwen) Anthropic ByteDance DeepSeek Google MiniMax Moonshot OpenAI Tencent Z.ai
价格在同类中的位置
价格在 68 个同类模型中的位置
这条线标出该模型的价格在 Synthorai 同类模型中的位置,两端分别是最便宜和最贵的模型。这里是基础价,批量、区域和缓存写入的折扣见价格页。
规格与限制
Token
| 上下文窗口(供应商规格) | 1,000,000 |
|---|---|
| 最大输出(供应商规格) | 131,072 |
提示词缓存
| 缓存方式 | 自动 |
|---|
思考
| 供应商参数 | thinking.type + reasoning_effort |
|---|---|
| 可选值 | thinking.type enabled · disabled; reasoning_effort none · minimal · low · medium · high · xhigh · max (none and minimal skip thinking, low and medium map to high, xhigh maps to max) |
| 默认值 | enabled,reasoning_effort 为 max:唯一带力度旋钮的 GLM,且默认就在最高档 请求未指定时生效 |
| 可关闭 | 支持 |
| 思考行为 | 思维链通过 reasoning_content 返回;在标准 API 端点上,此前轮次的思维链默认被清除,交错思考要生效则必须把思考块与工具结果一并回传 |
| 参数 | reasoning_effort |
| 取值 | minimal · low · medium · high 这是网关侧的参数,实际以上方的供应商映射为准 |
模型
| 模态 | 文本 → 文本 |
|---|---|
| 参数量 | 总参数 744B · 激活 40B MoE(混合专家) |
| 许可证 | MIT |
长程旗舰(744B-A40B),提供可用的 1M token 上下文 / 128K 最大输出、可配置的思考力度档位,以及 1M 上下文下 IndexShare 稀疏注意力带来的效率。
依据 Z.ai 官方文档 ↗
一条提示词,经网关实测
GLM-5.2 通过 · 3 sentences
Enabling reasoning means the LLM now generates thousands of invisible "thinking" tokens to systematically work through complex problems before producing a final answer. Because our cloud providers bill for these internal processing steps at the same rate as standard output, our billable token volume per query has doubled. While this increases our direct API costs, it drastically reduces error rates and manual review labor, ultimately lowering our total cost per resolved transaction.
输出 1223 tok (+1138 思考) 延迟 17.1 s
指令遵循(恰好三句,数得出来)、受众适配(对 CFO 说话的口吻),以及下方 token 计数暴露出的隐藏思考计费差额。
GLM-5.2 未通过 · 1/8 cases (fails [1])
```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 […]
输出 4097 tok (+4036 思考) 延迟 58.4 s
修复是否真的正确(能运行)、解释的信息密度,以及在一个范围明确的任务上的 token 效率。
GLM-5.2 通过 · 5/5 fields, guidance "withheld"
```json { "company": "Meridian Robotics", "quarter": "September quarter", "revenue_usd_m": 412, "growth_pct": 11, "guidance": "withheld" } ```
输出 1947 tok (+1893 思考) 延迟 30.9 s
是否严守 schema(不臆造字段)、能否顶住幻觉压力(原文明说暂不给出 guidance),以及结构化输出路径的差异。
GLM-5.2 通过 · 120 words, 0 banned, 1 question
We are introducing Caching for our API Gateway, the smartest way to optimize your workflows. Why pay for the exact same response twice? Now, you can automatically store and reuse prompt results across multiple AI providers, drastically reducing latency and overall operational costs. If a user submits a duplicate query, the gateway serves the cached answer instantly, regardless of whether you route to OpenAI, Anthropic, or others. This directly translates to faster applications and significantly lower monthly API bills. You can easily configure your specific caching rules within the developer dashboard and watch your efficiency soar. Stop wasting your valuable tokens on completely redundant computations. Upgrade to the latest gateway version today and experience the future of intelligent prompt management.
输出 11125 tok (+10984 思考) 延迟 114.8 s
是否守住约束(字数预算、禁用词表、只能有一个问句)、文风特征,以及长度控制。
30 秒用上 GLM-5.2
兼容 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="glm-5.2",
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: "glm-5.2",
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": "glm-5.2",
"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: "glm-5.2",
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("glm-5.2")
.addUserMessage("Summarize this diff")
.reasoningEffort(ReasoningEffort.MEDIUM)
.build());
System.out.println(resp.choices().get(0).message().content().orElse(""));关于 GLM-5.2
- 相比 GLM-5.1,官方页面突出更稳定的长程任务执行、在超长上下文中更一致地遵循工程规范、支持多文件重构的项目级理解,以及面向移动与客户端开发的完整真机调试闭环,还有小程序与小游戏开发和研究复现。
- 更长窗口背后的效率手段也已公布:IndexShare 方案让一个轻量索引器服务每四个 transformer 层,削减 1M 上下文下的单 token 算力,改进的多 token 预测层则提高了投机解码的接受率。
- 它也是产品线中唯一带 reasoning_effort 控制项的模型,文档给出的一组档位在实践中收敛为跳过思考、high 档和最大档,而托管 API 默认取最大档,因此一个什么都不设的请求就是一个深度思考的请求。
- 思考在其他方面与 GLM-5 产品线一致,轨迹在单独字段中返回,工具调用、MCP、JSON 输出和自动缓存也一并沿用。
- 权重以 MIT 许可发布。
- 在 Synthorai 上调用 GLM-5.2,OpenAI 兼容端点让它成为长上下文智能体负载的直接替换升级。
常见问题
GLM-5.2 API 可以免费试用吗?
可以。新账号有 10 次试用调用,免费额度最高 $1,无需绑卡。按输入 $1.4/M 计算,光这笔额度就够向 GLM-5.2 发约 89 次请求,每次 ~8K token。
GLM-5.2 最擅长什么?
上下文扩展至可用的 1M token、项目级理解与多文件重构、移动开发的真机调试闭环。完整介绍见「关于」部分,内容取自供应商的官方发布说明。
GLM-5.2 的价格是多少?
在 Synthorai 上,GLM-5.2 的输入价为 $1.4/百万 token,输出价为 $4.4/百万 token。这就是供应商官网价,平台不加价。缓存命中的输入 token 按 $0.26/M 计费。
GLM-5.2 的上下文长度是多少?
GLM-5.2 的上下文长度(上下文窗口)是 1M token。单次回复最多输出 131,072 个 token。
GLM-5.2 支持提示词缓存(prompt caching)吗?
支持,而且全自动:经 Z.ai 处理的提示词会自动缓存,不用改代码。缓存命中的输入 token 按 $0.26/M 计费(未命中为 $1.4/M)。 提示词缓存指南 →
如何开通 GLM-5.2?
把现有 OpenAI SDK 的 base_url 指向 "https://synthorai.io/v1",model 设为 "glm-5.2" 即可。一个 API key 就能调用网关上的全部模型。
GLM-5.2 开源吗?
开源:权重以 MIT 许可证发布(官方仓库链接见「关于」部分)。不想自己备 GPU 也行:这里的托管版本按量付费,不需要自建基础设施。 运行开源权重模型 →
相关模型
对比
本页的每个数值都照录自供应商自己的文档(链接见上),并标有核对日期。价格是在整个目录范围内比较的;各家供应商定义不一样的规格项,只说明差异,不画图对比。这里没有任何一项是我们自己测的,也不打分。