GLM-5.1 是智谱最新旗舰模型,代码能力大大增强,长程任务显著提升,能够在单次任务中持续、自主地工作长达 8 小时,完成从规划、执行到迭代优化的完整闭环,交付工程级成果。 在综合能力与 Coding 能力上,GLM-5.1 整体表现对齐 Claude Opus 4.6,并在长程自主执行、复杂工程优化与真实开发场景中展现出更强的持续工作能力,是构建 Autonomous Agent 与长程 Coding Agent 的理想基座。
from openai import OpenAI
client = OpenAI(
base_url="https://api.openroute.cn/v1",
api_key="<ONTOROUTE_API_KEY>",
)
completion = client.chat.completions.create(
model="z-ai/glm-5.1",
messages=[
{
"role": "user",
"content": "Write a one-sentence bedtime story about a unicorn.",
}
],
)
print(completion.choices[0].message.content)Prices are CNY (¥) per million tokens, billed as you go. Cache reads can cut the cost of repeated context.
| Provider | Input | Output | Cache read | Context length | Latency | Uptime | Status |
|---|---|---|---|---|---|---|---|
z-ai z-ai/glm-5.1 | ¥6.00 | ¥24.00 | — | 256K | 5.1s | 88.70% | |
z-ai z-ai/glm-5.1 | ¥1.68 | ¥5.04 | — | 256K | 1.2s | 0.00% | Lowest |
This model does not publish tunable parameters.