GLM-5.1
厂商牌价,无平台加价,按量付费。 以下为官方 list 价。登录客户可在 /console/pricing 查看含工作空间折扣的实际价格。 按 70% 缓存命中率计算的等效输入价:$0.602/M. 自动提示词缓存:重复的提示词前缀按价格表所示的缓存命中费率计费,无需改代码。
30 秒用上 GLM-5.1
OpenAI 兼容:换掉 base_url,SDK 不用改。POST /v1/chat/completions
from openai import OpenAI
client = OpenAI(
base_url="https://synthorai.io/v1",
api_key="sk-syn-...",
)
resp = client.chat.completions.create(
model="glm-5.1",
messages=[{"role": "user", "content": "Summarize this diff"}],
reasoning_effort="medium",
)
print(resp.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://synthorai.io/v1",
apiKey: "sk-syn-...",
});
const resp = await client.chat.completions.create({
model: "glm-5.1",
messages: [{ role: "user", content: "Summarize this diff" }],
reasoning_effort: "medium",
});
console.log(resp.choices[0].message.content);curl https://synthorai.io/v1/chat/completions \
-H "Authorization: Bearer sk-syn-..." \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.1",
"messages": [{"role": "user", "content": "Hello"}],
"reasoning_effort": "medium"
}'package main
import (
"context"
"fmt"
"github.com/openai/openai-go/v3"
"github.com/openai/openai-go/v3/option"
)
func main() {
client := openai.NewClient(
option.WithBaseURL("https://synthorai.io/v1"),
option.WithAPIKey("sk-syn-..."),
)
resp, _ := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
Model: "glm-5.1",
Messages: []openai.ChatCompletionMessageParamUnion{
openai.UserMessage("Summarize this diff"),
},
ReasoningEffort: openai.ReasoningEffortMedium,
})
fmt.Println(resp.Choices[0].Message.Content)
}import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.chat.completions.*;
import com.openai.models.ReasoningEffort;
OpenAIClient client = OpenAIOkHttpClient.builder()
.baseUrl("https://synthorai.io/v1")
.apiKey("sk-syn-...")
.build();
ChatCompletion resp = client.chat().completions().create(
ChatCompletionCreateParams.builder()
.model("glm-5.1")
.addUserMessage("Summarize this diff")
.reasoningEffort(ReasoningEffort.MEDIUM)
.build());
System.out.println(resp.choices().get(0).message().content().orElse(""));关于 GLM-5.1
GLM-5.1 是 Z.AI 为长程任务设计的旗舰基础模型,官方描述它能在单个任务上连续自主工作最长 8 小时,覆盖规划、执行、测试、修复和交付。
- 它在 GLM-5 的基础上强调「实验、分析、优化」循环而非单次生成,在复杂工程环境中实现自主探索、持续改进和稳定交付。
- 模型提供 200K 上下文窗口、最高 128K 输出 token,以及思考模式和函数调用。
- Synthorai 把 GLM-5.1 放在其 OpenAI 兼容端点之后,可直接替换接入。
规格与限制
| 最大输出(厂商规格) | 131,072 |
| 模态 | text → text |
| 参数量 | 总参数 744B · 激活 40B (MoE) |
| 特性 | tools · structured_output · streaming · reasoning · caching |
| 许可证 | MIT ↗ |
| 备注 | Next-gen agentic-engineering flagship (744B-A40B): works autonomously up to 8 hours in a single run across thousands of tool calls; 200K context / 128K max output. |
| 提示词缓存 | 自动 |
依据 Z.ai 官方文档 ↗
常见问题
GLM-5.1 API 可以免费试用吗?
可以。新账号可获得 10 次试用调用和最高 $1 的免费额度,无需绑卡。按输入 $1.4/M 计算,仅这笔额度就足够对 GLM-5.1 发起约 89 次 ~8K token 的请求。
GLM-5.1 最擅长什么?
可自主连续工作最长 8 小时,以及实验、分析、优化循环取代单次生成和覆盖规划到测试与交付。完整能力请见 About 部分,内容取自厂商官方发布说明。
GLM-5.1 的价格是多少?
在 Synthorai 上,GLM-5.1 输入 $1.4/百万 token、输出 $4.4/百万 token,即厂商牌价,无平台加价。缓存命中的输入 token 按 $0.26/M 计费。
GLM-5.1 支持提示词缓存(prompt caching)吗?
支持,且全自动:经 Z.ai 提供的提示词自动缓存,无需改代码。缓存命中的输入 token 按 $0.26/M 计费(未命中 $1.4/M)。 提示词缓存指南 →
如何开通 GLM-5.1?
把现有 OpenAI SDK 的 base_url 指向 "https://synthorai.io/v1",model 设为 "glm-5.1" 即可。一把 API key 通用网关上的全部模型。
GLM-5.1 开源吗?
开源:权重以 MIT 许可证 发布。也可以省去 GPU:这里的托管版本按量付费,无需自建基础设施。 运行开源权重模型 →