Z.ai

GLM 5.2

Z.ai按量收費
Alias:glm-5.2

GLM-5.2 面向需要持续推进的复杂文本任务,适合项目级编程、跨文件修改和多步工具协作,在较长工作流程中保持工程背景与交付要求。

textfunction_callingtoolsjson_modereasoningcontext:1048576
起始價格
輸入 / 輸出 · 1M
上下文
1M
最大輸入窗口
最大輸出
131.1K
單次回應最大 token 數
模態
→

Pricing by Supplier

official
官方接口直连
輸入/ 1M tokens
$1.4
輸出/ 1M tokens
$4.4
緩存讀取/ 1M tokens
$0.26
Volcengine
省8%
火山引擎官方接口
輸入/ 1M tokens
$1.288$1.4
輸出/ 1M tokens
$4.048$4.4
緩存讀取/ 1M tokens
$0.2392$0.26
Alibaba
阿里巴巴百炼官方
輸入/ 1M tokens
$1.4
輸出/ 1M tokens
$4.4
緩存讀取/ 1M tokens
$0.26
火山引擎特价
省55%
火山引擎官方接口,高并发,活动特价
輸入/ 1M tokens
$0.63$1.4
輸出/ 1M tokens
$1.98$4.4
緩存讀取/ 1M tokens
$0.117$0.26
Baidu
省35%
輸入/ 1M tokens
$0.91$1.4
輸出/ 1M tokens
$2.86$4.4
緩存讀取/ 1M tokens
$0.169$0.26

能力 / 支援的模態

串流輸出函數呼叫工具JSON 模式結構化輸出推理
輸入
輸出

廠商與數據私隱

供應商
Zhipu AI文件
分詞器
GLM tokenizer
許可證
GLM-4 License開放權重
數據保留4 日預設不會用於上游訓練

效能

基準測試

標準化評測得分。百分比越高越好,並展示排名百分位。

指標來源:Artificial Analysis 2026-09-30·GLM 5.2

目前基準快照不包含此模型。

缺少模型或測量值不代表零分。

基準圖表保留來源中的模型選擇和推理設定。缺少模型或測量值不代表零分,基準成本或速度也不是本站的服務承諾。

About GLM 5.2

适合把一项工程任务持续做下去

GLM-5.2 是智谱面向长流程工作的推理模型,接收和输出文本。它适合需要阅读大量项目背景、连续调用工具并反复验证的任务,例如跨模块功能开发、代码迁移、复杂排障和自动化工作流。

项目级开发往往不止是写出一段函数,还要理解已有接口、处理依赖、遵循工程规范并完成验证。可以让 GLM-5.2 先阅读需求与关键代码,整理影响范围,再按步骤实施和检查。长上下文有助于同时保留设计约定、历史讨论和工具结果,减少任务推进时反复补充背景的负担。

它强调编程与工具使用能力,也提供不同的推理投入选择。遇到跨服务故障、相互冲突的需求或复杂算法问题时,可以增加思考深度;明确而局部的改动则应给出清晰范围,避免把简单任务扩展成不必要的重构。在具备文件读取、命令执行等工具的开发助手中,它可以根据实际反馈调整后续步骤。

长流程仍需要明确的完成标准。开始前列出必须满足的行为、兼容条件和检查方法;执行中保留已完成、待验证和受阻事项;交付时要求说明实际修改与验证结果。模型能提出部署或操作方案,是否已经执行成功,应以工具返回和环境中的真实状态判断。

Use cases and prompting

代码迁移提示词

“请将这个项目的数据访问模块迁移到新接口。先阅读旧接口与调用位置,列出行为差异和受影响文件,再按模块完成修改。保留现有错误处理与兼容约定。每一步执行后检查结果,最后汇总已通过的验证和仍需人工决定的问题。”

常见问题

  • 项目材料很多,应该先给什么?先给架构说明、目标模块和接口约定,再按依赖补充代码,减少无关内容干扰。
  • 长任务怎样方便接续?阶段结束时保存目标、约束、修改位置和未完成检查,让下一轮从明确状态继续。
  • 能直接分析界面截图吗?该模型以文本输入为主,界面问题可提供页面结构、报错文本及相关代码。

API access

API 介面文件

呼叫示例

請求POST/v1/chat/completions
請求範例
參數
參數類型預設值 / 範圍說明資訊
temperature
number
=10 ~ 2
採樣溫度;越低越穩定
top_p
number
=10 ~ 1
核採樣累積概率
max_tokens
integer>= 1回應中最大 token 數
frequency_penalty
number
=0-2 ~ 2
懲罰高頻 token 的重複出現
presence_penalty
number
=0-2 ~ 2
鼓勵引入新話題
stop
array—最多 4 個停止生成的字串
seed
integer—盡量保證可復現的採樣種子
n
integer
=1>= 1
生成的候選條數
stream
boolean
=false
透過 SSE 串流返回 token
response_format
object—強制輸出 JSON 物件或符合 Schema 的結果
tools
array—模型可呼叫的工具 / 函數聲明
tool_choice
string
autononerequired
工具選擇策略或具體工具名
logprobs
boolean
=false
返回每個 token 的對數概率
top_logprobs
integer0 ~ 20每個 token 返回的 top 概率數量
logit_bias
object—按 token 的 logit 偏置映射
user
string—用於風險審計的終端用戶標識

替換 <YOUR_API_KEY> 替換為令牌設定中的 API Key。

身份驗證

所有請求必須攜帶 Authorization: Bearer <TOKEN> 請求頭。Anthropic 格式的端點也接受 x-api-key 請求頭。

在「令牌」頁面生成 API Key,可以按模型、分組、IP、速率等維度精細化授權。

支援的參數

Generation parameters
參數類型預設值 / 範圍說明資訊
temperature
number
=10 ~ 2
採樣溫度;越低越穩定
top_p
number
=10 ~ 1
核採樣累積概率
max_tokens
integer>= 1回應中最大 token 數
frequency_penalty
number
=0-2 ~ 2
懲罰高頻 token 的重複出現
presence_penalty
number
=0-2 ~ 2
鼓勵引入新話題
stop
array—最多 4 個停止生成的字串
seed
integer—盡量保證可復現的採樣種子
n
integer
=1>= 1
生成的候選條數
stream
boolean
=false
透過 SSE 串流返回 token
response_format
object—強制輸出 JSON 物件或符合 Schema 的結果
tools
array—模型可呼叫的工具 / 函數聲明
tool_choice
string
autononerequired
工具選擇策略或具體工具名
logprobs
boolean
=false
返回每個 token 的對數概率
top_logprobs
integer0 ~ 20每個 token 返回的 top 概率數量
logit_bias
object—按 token 的 logit 偏置映射
user
string—用於風險審計的終端用戶標識

速率限制

供應商RPMTPMRPD
Alibaba無限制無限制無限制
Baidu無限制無限制無限制
official無限制無限制無限制
Volcengine無限制無限制無限制
火山引擎特价無限制無限制無限制

無限制

Frequently asked questions about glm-5.2

What is glm-5.2?

GLM-5.2 面向需要持续推进的复杂文本任务,适合项目级编程、跨文件修改和多步工具协作,在较长工作流程中保持工程背景与交付要求。

How do I call glm-5.2?

Create an API key with access to glm-5.2, then use the exact model ID and a supported endpoint from the API access section. Request fields depend on the selected endpoint.

How is glm-5.2 priced?

Pricing depends on the selected provider group and the model billing unit. The current input, output, request, or media prices are shown on this page before sign-up.

What is the context window of glm-5.2?

The model catalog lists a context window of 1048576 tokens. Check the selected endpoint for request limits.

What is the maximum output of glm-5.2?

The model catalog lists a maximum output of 131072 tokens. Your request settings may set a lower limit.

How should I evaluate glm-5.2 for my project?

Start with the use cases and prompting guidance on this page, then evaluate the model with representative inputs from your project.