Z.ai

GLM 5.1

Z.aiToken-based
Alias:glm-5.1
Create API Key

Compare glm-5.1 API pricing, supported endpoints, capabilities and access options on voguesly.

textfunction_callingtoolsjson_modereasoningcontext:204800
Starting price
Input / Output · 1M
Context
204.8K
Maximum input window
Max output
128K
Maximum tokens per response
Modalities
→

Pricing by Supplier

official
-40%
官方接口直连
Input/ 1M tokens
$0.522$0.87
Output/ 1M tokens
$2.1$3.5
Cache Read/ 1M tokens
$0.114$0.19
Alibaba
阿里巴巴百炼官方
Input/ 1M tokens
$0.87
Output/ 1M tokens
$3.5
Cache Read/ 1M tokens
$0.19

Capabilities / Supported modalities

StreamingFunction callingToolsJSON modeStructured outputReasoning
Input
Output

Provider & data privacy

Provider
Zhipu AIDocs
Tokenizer
GLM tokenizer
License
GLM-4 LicenseOpen weights
Data retention77 daysNot used for upstream training by default

Performance

Benchmarks

Scores on standardized evaluations. Higher percentages are better — and rank percentile shows

Metrics sourced fromArtificial Analysis 2026-09-30·GLM 5.1

This model is not included in the current benchmark snapshot.

Missing models or measurements are not zero scores.

Benchmark charts preserve the source model selection and reasoning settings. Missing models or measurements are not zero scores, and benchmark cost or speed is not this site’s service commitment.

About GLM 5.1

在反复试验中把问题解决

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

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

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

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

Use cases and prompting

性能排查提示词

“下面是接口代码、慢请求日志和已经试过的办法。目标是在保持返回结果一致的前提下改善响应时间。请先按证据排序可能瓶颈,设计能区分原因的检查,每轮只改变一个主要因素。读取检查结果后再决定下一步,最后汇总有效改动及前后对比。”

常见问题

  • 模型反复给出相同办法怎么办?补充已失败的实验及结果,要求它说明新方案验证的是哪个不同假设。
  • 怎样判断优化有效?固定测试输入、环境和比较指标,保存改动前后的实际运行结果。
  • 能一直在后台执行吗?持续运行由应用的任务调度和工具环境提供;应保存阶段进度与停止条件。

API access

API documentation

Code samples

RequestPOST/v1/chat/completions
Example request
Parameters
ParameterTypeDefault / rangeDescription
temperature
number
=10 ~ 2
Sampling temperature; lower is more deterministic
top_p
number
=10 ~ 1
Nucleus sampling probability mass
max_tokens
integer>= 1Maximum number of tokens in the response
frequency_penalty
number
=0-2 ~ 2
Penalises repetition of frequent tokens
presence_penalty
number
=0-2 ~ 2
Encourages introducing new topics
stop
array—Up to 4 strings that stop generation
seed
integer—Deterministic sampling seed (best-effort)
n
integer
=1>= 1
Number of completions to generate
stream
boolean
=false
Stream tokens via Server-Sent Events
response_format
object—Force JSON object or schema-conforming output
tools
array—Tool / function declarations the model may call
tool_choice
string
autononerequired
Tool-choice policy or specific tool name
logprobs
boolean
=false
Return per-token log probabilities
top_logprobs
integer0 ~ 20Number of top log probabilities returned per token
logit_bias
object—Per-token logit bias map
user
string—End-user identifier for abuse monitoring

Replace <YOUR_API_KEY> with the API key from your token settings.

Authentication

All requests must include Authorization: Bearer <TOKEN> header. Anthropic-formatted endpoints accept the x-api-key header instead.

Generate tokens from the Tokens page; you can scope them to specific models, groups, IPs, and rate-limits.

Supported parameters

Generation parameters
ParameterTypeDefault / rangeDescription
temperature
number
=10 ~ 2
Sampling temperature; lower is more deterministic
top_p
number
=10 ~ 1
Nucleus sampling probability mass
max_tokens
integer>= 1Maximum number of tokens in the response
frequency_penalty
number
=0-2 ~ 2
Penalises repetition of frequent tokens
presence_penalty
number
=0-2 ~ 2
Encourages introducing new topics
stop
array—Up to 4 strings that stop generation
seed
integer—Deterministic sampling seed (best-effort)
n
integer
=1>= 1
Number of completions to generate
stream
boolean
=false
Stream tokens via Server-Sent Events
response_format
object—Force JSON object or schema-conforming output
tools
array—Tool / function declarations the model may call
tool_choice
string
autononerequired
Tool-choice policy or specific tool name
logprobs
boolean
=false
Return per-token log probabilities
top_logprobs
integer0 ~ 20Number of top log probabilities returned per token
logit_bias
object—Per-token logit bias map
user
string—End-user identifier for abuse monitoring

Rate limits

SupplierRPMTPMRPD
AlibabaUnlimitedUnlimitedUnlimited
officialUnlimitedUnlimitedUnlimited

No restriction

Frequently asked questions about glm-5.1

What is glm-5.1?

Compare glm-5.1 API pricing, supported endpoints, capabilities and access options on voguesly.

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.