GLM-5.3 是 Z.ai 2026-08-14 发布的旗舰模型,与 GLM-5.2 完全同基座、纯后训练升级。本文所有"已验证"结论来自 2026-08-14 当天通过 AIHubMix API(Chat Completions / Responses / Messages 三种协议)的真实调用。
| 项目 | 值 |
|---|---|
| 上下文窗口 | 1M tokens(官方精确值 1,048,576) |
| 最大输出 | 128K(实测上限 131,072,超出返回 400) |
| 输入模态 | 文本 |
| 思考 | 始终开启,不可关闭;reasoning_effort 三档 low / high / max(默认 max) |
| 与 5.2 关系 | 同基座,纯后训练;编程与长程任务大幅增强 + 涌现网络安全能力 |
| 项目 | GLM-5.2 | GLM-5.3 |
|---|---|---|
| thinking.type | enabled / disabled(可关) | 仅 enabled(不可关) |
| reasoning_effort | 7 值兼容映射 | 三档 low / high / max(默认 max) |
| 定位 | 通用旗舰 | 强化编程与长程 Agent,涌现网络能力 |
官方迁移建议:原发送 {"type":"disabled"} 的应用改为 {"type":"enabled"} 并设 reasoning_effort:"low"。
实测:经 AIHubMix 发送 disabled 仍返回 200 且思考照常发生(按官方通道语义自动转换),若客户端依赖"关思考省 token",请改用 reasoning_effort:"low"。
实测:非法枚举值返回 200 并回退默认 max;low vs max 在同一算术题上思考 token 为 27 vs 39。
Chat Completions(思考内容在 reasoning_content 字段,流式在 delta.reasoning_content):
from openai import OpenAI
client = OpenAI(base_url="https://aihubmix.com/v1", api_key="<KEY>")
completion = client.chat.completions.create(
model="coding-glm-5.3",
reasoning_effort="max", # low / high / max, 默认 max
extra_body={"thinking": {"type": "enabled"}},
messages=[{"role": "user", "content": "Compute the square root of (17*23-19*11), rounded down. Digits only."}],
)
print(completion.choices[0].message.reasoning_content)
print(completion.choices[0].message.content) # 观察到: "13"实测:usage.completion_tokens_details.reasoning_tokens 报告思考用量——同题 low 为 27、max 为 39。
Responses API(思考内容为 reasoning output item,文本在 summary 数组的 summary_text):
response = client.responses.create(model="coding-glm-5.3", input="What is the capital of France? City name only.")
# output item 类型: ["reasoning", "message"]
# reasoning item: {"type": "reasoning", "summary": [{"type": "summary_text", "text": "..."}]}
# usage.output_tokens_details.reasoning_tokens: 80实测:不传任何 reasoning 参数也会默认返回 reasoning item(无需显式 opt-in)。
Messages(Anthropic 协议)(思考内容为原生 thinking content block):
client = Anthropic(api_key="<KEY>", base_url="https://aihubmix.com")
response = client.messages.create(model="coding-glm-5.3", max_tokens=4096,
messages=[{"role": "user", "content": "What is the capital of France? City name only."}])
# content block 类型: ["thinking", "text"]三种 API 均验证可用;Responses API 观察到单轮内并行工具调用(官方声明 supports_parallel_tool_calls: true)。
上游限制:tools 最多 128 个函数;tool_choice 原生仅支持 auto。
Chat Completions 实测 tool_choice:"none" 有效(不再调工具);Messages 协议实测 tool_choice:{type:"none"} 仍会产出 tool_use——要禁用工具请直接移除 tools 参数,或用 Chat Completions 的 tool_choice:"none"。
response_format 支持 text 和 json_object,上游未提供 json_schema 模式;需要严格 schema 时把 JSON Schema 写进提示词并客户端校验。
实测:response_format={"type":"json_object"} 返回合法 JSON 且包含请求的 key。
上下文缓存 / 自动缓存可用(AIHubMix 侧)。
该文为 AIHubMix 聚合渠道视角(模型 ID coding-glm-5.3 为其预览路由),官方渠道模型 ID 为 glm-5.3,注意区分。
"thinking.type no longer supports disabled — thinking cannot be turned off."
"If your client relied on 'turn off thinking to save tokens', switch to reasoning_effort: 'low'."
GLM-5.3