Z.ai

GLM 5.1

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

GLM-5.1 适合需要反复试验和持续改进的编程任务,可以拆解问题、结合工具结果调整方案,用于工程排障、性能优化和较长周期的开发协作。

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

Pricing by Supplier

official
官方接口直连
輸入/ 1M tokens
$0.87
輸出/ 1M tokens
$3.5
緩存讀取/ 1M tokens
$0.19
Alibaba
阿里巴巴百炼官方
輸入/ 1M tokens
$0.87
輸出/ 1M tokens
$3.5
緩存讀取/ 1M tokens
$0.19

能力 / 支援的模態

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

廠商與數據私隱

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

效能

基準測試

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

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

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

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

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

About GLM 5.1

在反复试验中把问题解决

GLM-5.1 面向编程和需要持续执行的智能体任务。它接收文本材料,可以分析需求与代码、制定计划,再根据工具返回的结果修正判断。对于第一种办法往往不够用的问题,例如性能瓶颈、复杂构建失败或跨模块故障,它适合参与多轮调查与改进。

这类任务的关键是形成有效的反馈循环:提出假设,设计检查,阅读结果,再决定下一步。可以把目标指标、已有尝试和失败现象交给模型,让它优先安排能区分不同原因的实验,而不是一次列出很多互不相关的修改。接入代码和终端工具后,应用可以让它依据真实运行结果继续推进。

GLM-5.1 支持工具调用,也可以按结构化格式返回结果。团队可以把每轮调查组织为假设、验证方法、观察结果和后续动作,逐步积累排查记录。除了修复代码,它也能协助整理技术方案和交付说明,让长时间工作中的决定有据可查。

持续执行能力需要工作环境和工具配合。开始前应说明允许修改的范围、成功条件和停止条件;实验没有带来改进时,要求模型解释新证据改变了什么判断。保留可复现的测试输入与比较基线,才能分辨方案是否真的有效,并减少在无效方向上反复尝试。

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無限制無限制無限制
official無限制無限制無限制

無限制

Frequently asked questions about glm-5.1

What is glm-5.1?

GLM-5.1 适合需要反复试验和持续改进的编程任务,可以拆解问题、结合工具结果调整方案,用于工程排障、性能优化和较长周期的开发协作。

How do I call glm-5.1?

Create an API key with access to glm-5.1, 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.1 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.1?

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

What is the maximum output of glm-5.1?

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

How should I evaluate glm-5.1 for my project?

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