单文件版:功能测试 + 测试方式与可复制命令 + 性能指标(含公开数据参考)+ 渠道预备 + 验收。可直接发给渠道。
- 适用模型:GLM-5.3-Flash(文本 / 图片 / 视频 / 文件输入,纯文本输出)
- 接口:
/v1/chat/completions、/v1/messages、/v1/responses- 发布日期:2026-11-12
- 判定:功能必过项 100% + 性能 L1 全部通过 → 接入通过
| 项目 | 要求 |
|---|---|
| 模型 ID | 必须直接支持客户文档中的
glm-5.3-flash;如用内部别名(如
-lj),交付文档中必须写明映射,且文档 ID 必须真实可用 |
| 输入 | 文本、图片、视频、文件 |
| 输出 | 文本 |
| 思考 | 支持;thinking.type 仅
enabled(不支持关闭);reasoning_effort
low/high/max |
| 工具调用 | 支持;第一轮返回非空 tool_use.id,第二轮回填 |
| 流式 | Chat 以 [DONE] 收尾;Messages 以
message_delta + message_stop 收尾 |
以下数据来自 Z.ai 官方文档、智谱发布页与第三方评测;不同 provider/版本会有差异,不作为验收阈值,验收以本文件第 5 章 L1 为准。
| 项目 | 公开数据 | 来源 |
|---|---|---|
| 上下文窗口 | 1,048,576(1M)tokens | Z.ai 官方文档 |
| 最大输出 | 131,072(128K)tokens | Z.ai 官方文档 |
| 输入/输出模态 | 文本、图片、视频、文件 / 文本 | Z.ai 官方文档 |
| 总参数/激活参数 | 320B / 18B(A18B) | Z.ai / 智谱发布页 |
| 层数 | 45(GLM-5.3 为 92) | Z.ai 官方文档 |
| 架构 | 稀疏+线性注意力混合、mHC、IndexPool;30T 多模态预训练 | Z.ai / 智谱发布页 |
| 相对 GLM-5.3 | 注意力计算量降低 3.01×,KV Cache 降低 4.44× | Z.ai / 智谱发布页 |
| 模型代码 | glm-5.3-flash、glm-5.3-flashx、glm-5.3-flashx-legal |
Z.ai 官方文档 |
| 公开速度 | FlashX 200 tokens/s;Flash 未给官方数值 | Z.ai 官方文档 |
| 第三方 provider 速度 | 24 家 provider,最快 1,382.3 t/s(Inco FAST);最低首答案延迟 2.92 s | Artificial Analysis |
| 第三方价格 | 最低约 0.05–0.10/M blended(provider 不同) | Artificial Analysis |
| Artificial Analysis Intelligence Index | 57($0.045/task,折扣价) | Z.ai 发布页 / AA |
| DeepSWE v1.1 | 63.4(GLM-5.2 46.2) | Z.ai 发布页 |
| AutomationBench | 48.8(GLM-5.2 26.2) | Z.ai 发布页 |
| Z.ai Code Bench v1.0(max) | 29.0(Claude Opus 4.8 29.5) | Z.ai 发布页 |
| 公开价格关系 | GLM-5.3 的 1/10;限时折扣 1/20;Opus 4.8 的 1/40 | Z.ai 发布页 |
公开来源:
公开数据的口径、版本和 provider 各不相同;报告中引用时必须同时给出来源与测试条件。验收以本文件第 5 章的统一口径 L1 为准。
| 项目 | 要求 | 确认 |
|---|---|---|
| 模型 ID | glm-5.3-flash 直接请求 200;别名映射文档化 |
☐ |
| 端点与密钥 | Base URL + Key;具备测试权限与额度 | ☐ |
| 额度 | 功能 23 用例 + 性能 S3/S4 长稳额度;不被限流/预扣打断 | ☐ |
| 近源压测机 | 与目标服务同城/同区域;带宽 ≥50Mbps;无 HTTP 代理 | ☐ |
| UA/WAF | 放行
curl、OpenAI/Python、Python-urllib;不得
403/1010 |
☐ |
| SSE 解析 | 跳过 : 注释/心跳行、空
choices:[]、usage-only 块;按 token 摊分 ITL/TPOT |
☐ |
| usage | 流式带 stream_options.include_usage=true;服务端返回
usage |
☐ |
| 媒体样本 | 能直拉公网图片/视频 URL(不要求白名单),支持跳转;准备测试 URL | ☐ |
| 文件样本 | 能解析 demo1.pdf(536KB,2 页);支持三种协议 ×
URL/Base64 |
☐ |
| 超时 | 图片/视频/文件请求客户端超时 ≥120s;长上下文 ≥600s | ☐ |
| 日志 | 每个请求返回 request id;可按 id 查上游错误 | ☐ |
export API_BASE="https://<endpoint>" # 不带 /v1
export BASE_URL="$API_BASE/v1"
export API_KEY="<KEY>"
export MODEL="glm-5.3-flash"
curl -sS "$BASE_URL/chat/completions" \
-H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" \
-d '{"model":"'"$MODEL"'","messages":[{"role":"user","content":"hi"}],"max_tokens":16}'
[DONE] +
usage)curl -sS -N "$BASE_URL/chat/completions" \
-H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" \
-d '{"model":"'"$MODEL"'","messages":[{"role":"user","content":"请用一句话介绍北京。"}],"stream":true,"stream_options":{"include_usage":true}}'
curl -sS "$BASE_URL/chat/completions" -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" -d '{
"model":"'"$MODEL"'","max_tokens":512,
"messages":[{"role":"user","content":[
{"type":"text","text":"请用一句话描述这张图片。"},
{"type":"image_url","image_url":{"url":"https://cdn.bigmodel.cn/static/logo/register.png"}}
]}]
}'
视频把 image_url 换成 video_url:
{"type":"video_url","video_url":{"url":"https://cdn.bigmodel.cn/agent-demos/lark/113123.mov"}}
判定:200 且
prompt_tokens_details.image_tokens/video_tokens > 0(或
prompt_tokens 明显高于纯文本基线),回答能描述;200 但无 token
增长、模型说“没看到图/视频”= 静默丢弃,不通过。
先生成 base64 与 data URI:
B64=$(base64 -i demo1.pdf | tr -d '\n')
DATA_URI="data:application/pdf;base64,$B64"
Chat file URL / Base64:
# file URL
curl -sS "$BASE_URL/chat/completions" -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" -d '{
"model":"'"$MODEL"'","max_tokens":1024,
"messages":[{"role":"user","content":[
{"type":"file","file":{"file_url":"https://cdn.bigmodel.cn/static/demo/demo1.pdf"}},
{"type":"text","text":"文件在讲什么"}]}]}'
# file Base64(file_data 必须带 data URI)
curl -sS "$BASE_URL/chat/completions" -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" -d '{
"model":"'"$MODEL"'","max_tokens":1024,
"messages":[{"role":"user","content":[
{"type":"file","file":{"filename":"demo.pdf","file_data":"'"$DATA_URI"'"}},
{"type":"text","text":"文件在讲什么"}]}]}'
Messages document URL / Base64(data
只放裸 Base64):
# document URL
curl -sS "$BASE_URL/messages" -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" -d '{
"model":"'"$MODEL"'","max_tokens":1024,
"messages":[{"role":"user","content":[
{"type":"document","source":{"type":"url","url":"https://cdn.bigmodel.cn/static/demo/demo1.pdf"}},
{"type":"text","text":"文件在讲什么"}]}]}'
# document Base64(裸 base64,不是 data URI)
curl -sS "$BASE_URL/messages" -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" -d '{
"model":"'"$MODEL"'","max_tokens":1024,
"messages":[{"role":"user","content":[
{"type":"document","source":{"type":"base64","media_type":"application/pdf","data":"'"$B64"'"},"title":"demo.pdf"},
{"type":"text","text":"文件在讲什么"}]}]}'
Responses input_file URL /
Base64(file_data 使用 data URI):
# input_file URL
curl -sS "$BASE_URL/responses" -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" -d '{
"model":"'"$MODEL"'","max_output_tokens":2048,
"input":[{"type":"message","role":"user","content":[
{"type":"input_text","text":"文件在讲什么"},
{"type":"input_file","file_url":"https://cdn.bigmodel.cn/static/demo/demo1.pdf"}]}]}'
# input_file Base64
curl -sS "$BASE_URL/responses" -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" -d '{
"model":"'"$MODEL"'","max_output_tokens":2048,
"input":[{"type":"message","role":"user","content":[
{"type":"input_text","text":"文件在讲什么"},
{"type":"input_file","filename":"demo.pdf","file_data":"'"$DATA_URI"'"}]}]}'
判定:200 且 input_tokens/prompt_tokens
明显高于纯文本基线,模型能复述 PDF;200 但模型说“没有看到文件”=
静默丢弃,不通过。
Chat 思考:
curl -sS "$BASE_URL/chat/completions" -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" -d '{
"model":"'"$MODEL"'","max_tokens":2048,
"messages":[{"role":"user","content":"9.11和9.9哪个大?请一步步推理后给出结论。"}],
"thinking":{"type":"enabled"},"reasoning_effort":"high"}'
Messages 思考:同一 JSON 发到
$BASE_URL/messages,检查
content[].type=="thinking"。
工具调用(Messages 示例):
curl -sS "$BASE_URL/messages" -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" -d '{
"model":"'"$MODEL"'","max_tokens":1024,"stream":true,"thinking":{"type":"enabled"},
"messages":[{"role":"user","content":[{"type":"text","text":"今天北京的天气怎么样"}]}],
"tools":[{"name":"get_weather","description":"Get current weather.",
"input_schema":{"type":"object","properties":{"location":{"type":"string"},"units":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location","units"]}}]}'
第一轮检查 tool_use.id 非空;第二轮回填真实 id;空 id
应返回 4xx。
aiperf profile \
--model "$MODEL" --url "$API_BASE" --endpoint-type chat --api-key "$API_KEY" \
--streaming --use-server-token-count \
--isl 32768 --osl 300 --concurrency 8 \
--benchmark-duration 60 --request-count 200 --seed 42 \
--extra-inputs ignore_eos:true
长文并发:--isl 100000 --osl 1000 --concurrency 20;短请求:--isl 2000 --osl 256 --concurrency 100。多模态请求单独统计,不混入纯文本
S1–S4 分位。
| # | 用例 | 通过标准 |
|---|---|---|
| F1 | 模型 ID | glm-5.3-flash 直接请求 200;文档别名可用;错误 ID
返回明确 4xx |
| F2 | Chat 连通性 | 200,内容合理,usage 完整 |
| F3 | Chat 流式 | 多个 chunk + [DONE];usage 可取;终止块允许
delta:{} + finish_reason |
| F4 | Messages 流式 | message_delta(含 stop_reason)+
message_stop;不得中途 EOF |
| F5 | 图片 URL | 200;image_tokens>0 或 prompt tokens
明显增长;内容能描述 |
| F6 | 视频 URL | 200;video_tokens>0 或 prompt tokens
明显增长;内容能描述 |
| F7 | Chat file URL | 200;prompt_tokens 明显高于文本基线;能复述 PDF |
| F8 | Chat file Base64 | 200;同上;file_data 带 data URI |
| F9 | Messages document URL | 200;input_tokens 明显高于基线;能复述 PDF |
| F10 | Messages document Base64 | 200;同上;data 为裸 base64 |
| F11 | Responses input_file URL | 200;input_tokens 明显高于基线;能复述 PDF |
| F12 | Responses input_file Base64 | 200;同上;file_data 为 data URI |
| F13 | Chat 思考 | 难题 + thinking 开启时 reasoning_content
非空;简单题允许 reasoning_tokens≈0 |
| F14 | Messages 思考 | 难题 + thinking 开启时
content[].type=="thinking";不要断言
reasoning_content |
| F15 | 工具第一轮 | 返回非空
tool_use.id,stop_reason=tool_use |
| F16 | 工具第二轮 | 回填真实 id 后 200;空 id 返回 4xx |
| F17 | 错误处理 | 不支持的类型/模型/参数返回结构化 4xx;无 200 静默丢弃、无连接 reset |
客户业务中的图片/视频 URL 由终端客户动态提供,域名不固定。渠道不得要求预报名单/白名单,应直接拉取公网 HTTP(S) URL,支持常见跳转。
必测 URL:
| 类型 | URL |
|---|---|
| 图片 | https://cdn.bigmodel.cn/static/logo/register.png |
| 图片 | https://b0.bdstatic.com/ugc/img/2025-02-15/2af3c8fe5e7752eee2242e849be1b6ff.png |
| 图片(短链/跳转) | https://images.unsplash.com/photo-1506744038136-46273834b3fb |
| 视频 | https://cdn.bigmodel.cn/agent-demos/lark/113123.mov |
判定:200 且
image_tokens/video_tokens 增长(或 prompt
tokens 明显高于纯文本基线),内容能描述;200 但 token
不增长、模型说“没看到图片/视频”=
静默丢弃,不通过。拉取失败应返回结构化
4xx,不得直接断开连接。
测试文件:demo1.pdf(536KB,2 页)。所有文件请求必须
200,且 input_tokens/prompt_tokens
明显高于纯文本基线,模型能复述文件内容;200
但模型说“没有看到文件”视为静默丢弃,不通过。六种请求体见 3.5 的
curl 命令。
| 协议 | 正确字段 | 错误做法 |
|---|---|---|
| Chat Completions | choices[].message.reasoning_content |
不要断言 Messages 的 thinking 块 |
/v1/messages |
content[].type == "thinking",thinking
非空 |
不要断言 reasoning_content(Anthropic
协议没有该字段) |
简单题可能只产生 1 个 reasoning
token、上游不返回思考内容;测试应使用需要推理的题目,或允许
reasoning_tokens≈0/1 时字段缺失。
tool_use.id,stop_reason=tool_use。tool_use.id 与
tool_result.tool_use_id 必须一致;空 id 返回 4xx。| 指标 | 定义 / 计算式 | 关键约束 |
|---|---|---|
| TTFT | 请求发出到首个有效内容块 | 不含仅 role、仅 usage、choices:[]、SSE 注释/心跳行 |
| TTFT-content | 首个非 reasoning 的可见答案 token | 思考模型必须同时报 TTFT 与 TTFT-content |
| PFS | prompt_tokens ÷ TTFT |
定位 prefill 慢还是排队 |
| Decode | completion_tokens ÷ (E2E − TTFT),tok/s/user |
与 TPOT 等价 |
| TPOT | (E2E − TTFT) ÷ (completion_tokens − 1),ms/token |
分位数按请求维度统计 |
| ITL | 相邻输出 token 间隔 | 一个 chunk 含多 token 时按 token 数摊分 |
| E2E | 请求发出到流结束 | 含排队、prefill、decode、网络 |
| RPS/TPM | 请求速率/每分钟 token | TPM 含输入+输出;缓存命中输入也计入 |
| 缓存命中率 | cached_tokens ÷ prompt_tokens |
分母是合并值,不得再加一次 |
| 错误率 | 非 2xx/连接失败/断流 | 扣除客户端超时;5xx 单列 |
| 档位 | 输入:输出 | 说明 |
|---|---|---|
| S1 | 2K:256 | 客服/指令 |
| S2 | 8K:512 | RAG/文档问答 |
| S3 | 32K:300 | 必测主档位 |
| S4 | 100K:1K | 并发模式,找饱和点 |
| S5 | 100K 共享前缀 | 可选;报计量/实际计算量口径 |
| 档位 | TTFT P50 L1/L2/L3 | TTFT P95 L1/L2/L3 | PFS L1/L2/L3 |
|---|---|---|---|
| S1 2K:256 | ≤0.8 / ≤0.5 / ≤0.3 s | ≤2 / ≤1 / ≤0.6 s | ≥2.5K / ≥4K / ≥6.7K tok/s |
| S2 8K:512 | ≤2.0 / ≤1.2 / ≤0.7 s | ≤5 / ≤3 / ≤1.5 s | ≥4K / ≥6.7K / ≥11K tok/s |
| S3 32K:300 | ≤8.0 / ≤4.0 / ≤2.2 s | ≤30 / ≤15 / ≤8 s | ≥4K / ≥8K / ≥15K tok/s |
| S4 100K:1K | ≤20 / ≤12 / ≤7 s | ≤60 / ≤35 / ≤20 s | ≥5K / ≥8.3K / ≥14K tok/s |
| 指标 | L1 | L2 | L3 |
|---|---|---|---|
| 单流 decode | ≥30 tok/s | ≥60 tok/s | ≥100 tok/s |
| TPOT P95 | ≤45 ms | ≤25 ms | ≤15 ms |
| ITL P95(按 token 摊分) | ≤120 ms | ≤60 ms | ≤35 ms |
| E2E P99(S3 32K/300) | ≤60 s | ≤35 s | ≤20 s |
| TTFT-content | ≤1.5×TTFT+1s | ≤1.2×TTFT+0.5s | ≈TTFT |
| 尾延迟比 P95/P50 | ≤4× | ≤3× | ≤2× |
| 项 | L1 | L2 |
|---|---|---|
| S3 32K 并发 8 | TTFT P50≤12s、P95≤40s;P50 增幅≤2× | P50≤6s、P95≤20s;增幅≤1.5× |
| S4 100K/1K 并发 20 | RPS≥1.0、TPM≥600 万;TTFT P95≤40s | RPS≥2.0、TPM≥1200 万 |
| S5 100K 共享前缀并发 96 | 计量 TPM≥1000 万(同时报实际计算量口径) | ≥2500 万 |
| S1 2K/256 并发 100 | RPS≥20、P99≤8s | RPS≥40、P99≤5s |
| 稳态缓存命中率(≥3 轮) | ≥60% | ≥90% |
| 第 2 轮缓存命中率 | ≥50% | ≥80% |
| 错误率(30min) | ≤1% | — |
| 5xx 错误率 | ≤0.5% | — |
无 [DONE] 断流 |
0 次 | — |
| 30min 吞吐衰减 | ≤10% | — |
| 来源 | 输出速度 | 首答案延迟 | 备注 |
|---|---|---|---|
| Z.ai 官方 | FlashX 200 tokens/s | — | Flash 未给官方数值 |
| Artificial Analysis(24 providers) | 最快 1,382.3 t/s(Inco FAST);其他 250–336 t/s | 最低 2.92 s | 价格最低约 0.05–0.10/M blended |
| Z.ai 发布页 | — | — | AA Intelligence Index 57;$0.045/task(折扣) |
以上为公开资料,provider/版本/负载不同会导致差异;验收以第 5.3–5.5 节的统一口径 L1 为准。多模态请求的 E2E 包含渠道拉取/解析时间,应单独统计,不得混入纯文本 S1–S4 分位。
| 指标 | L1 | 实测 | 判定 |
|---|---|---|---|
| S3 TTFT P50 / P95 | ≤8 / ≤30 s | ||
| S3 PFS | ≥4K tok/s | ||
| 单流 decode | ≥30 tok/s | ||
| TPOT P95 | ≤45 ms | ||
| E2E P99 | ≤60 s | ||
| 第 2 轮/稳态缓存命中率 | ≥50% / ≥60% | ||
| 5xx / 断流 | ≤0.5% / 0 次 | ||
| S4 并发 20 RPS / TPM | ≥1.0 / ≥600 万 | ||
| TTFT-content | 如实报告 |
choices:[]、usage-only 块必须跳过。include_usage;TPM/缓存率用服务端
usage。