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:這裡的託管版本按用量計費,無需自建基礎設施。 執行開放權重模型 →