GLM-5 是 Z.AI 面向智慧體工程打造的新一代基礎模型,瞄準複雜系統工程與長程智慧體任務。
- 輸入
- 文字 $1/M
- 輸出
- 文字 $3.2/M
- 快取讀取
- $0.2/M
- 上下文
- 200K
- 相較 GPT-4o
- 便宜約 80%
Benchmark 成績
供應商公布: Alibaba (Qwen) Anthropic ByteDance DeepSeek Google MiniMax Moonshot OpenAI Tencent Z.ai
價格在同類中的位置
價格在 68 個同類模型中的位置
這條線標出這個模型的價格,在 Synthorai 的同類模型裡落在什麼位置;兩端分別是最便宜和最貴的模型。這裡列的是基礎價,批次、區域和快取寫入的折扣請見價格頁。
規格與限制
Token
| 上下文視窗(供應商規格) | 200,000 |
|---|---|
| 最大輸出(供應商規格) | 131,072 |
提示詞快取
| 快取方式 | 自動 |
|---|
思考
| 供應商參數 | thinking.type |
|---|---|
| 可接受的值 | enabled · disabled |
| 預設值 | enabled,在 GLM-5 上由模型自動判斷是否思考 請求未指定時生效 |
| 可關閉 | 支援 |
| 思考行為 | 思考軌跡透過 reasoning_content 回傳;先前輪次的軌跡預設會被清除(clear_thinking 為 true),交錯思考的 thinking 區塊則應保留並與工具結果一併回傳。 |
| 參數 | reasoning_effort |
| 參數值 | minimal · low · medium · high 這是閘道的參數,實際以上方的供應商對應為準 |
模型
| 模態 | 文字 → 文字 |
|---|---|
| 參數量 | 總參數 744B · 啟用 40B MoE |
| 授權條款 | MIT |
- 面向智慧體工程的旗艦:744B 參數的 MoE(啟用 40B),以 28.5T token 預訓練並採用 DeepSeek Sparse Attention
- 200K 上下文 / 128K 最大輸出
依據 Z.ai 官方文件 ↗
一段提示詞,經閘道實測
GLM-5 通過 · 3 sentences
Enabling reasoning forces the model to perform multiple hidden steps to "think" through a problem, drastically increasing the volume of data processed per query compared to a standard response. Because our billing is directly tied to this processing volume, the additional computational work required for higher accuracy has proportionally doubled our consumption. Essentially, the spike reflects a trade-off where we are paying a higher variable cost to secure significantly better analytical outcomes.
輸出 1393 tok (+1308 思考) 延遲 36.0 s
是否照指令做(剛好三句,數得出來)、語氣是否貼合對象(寫給 CFO 看),以及下方 token 計量顯示出的隱藏思考計費落差。
GLM-5 通過 · 8/8 cases
Here is the fixed code: ```python def longest_run(xs): if not xs: return 0 best = 1 cur = 1 for i in range(1, len(xs)): if xs[i] == xs[i - 1]: cur += 1 best = max(best, cur) else: cur = 1 return best ``` **Explanation:** The bug stems from initializing `best` and `cur` to zero, which causes the function to count the number of *transitions* between adjacent elements rather than the total number of items in the run, resulting in a return value that is always one less than the actual length (reporting 0 for a single element and 1 for a pair). By initializing the counters to 1 and resetting `cur` to 1 when a streak breaks, the logic correctly counts the items themselves; adding an explicit check for an empty list ensures the function handles the zero-element edge case correctly.
輸出 2907 tok (+2694 思考) 延遲 73.7 s
修正是否真的正確(跑得起來)、說明的資訊密度,以及在範圍明確的任務上的 token 效率。
GLM-5 通過 · 5/5 fields, guidance "withheld pending the Q4 close"
```json { "company": "Meridian Robotics", "quarter": "September quarter", "revenue_usd_m": 412, "growth_pct": 11, "guidance": "withheld pending the Q4 close" } ```
輸出 3620 tok (+3561 思考) 延遲 91.8 s
是否遵守 schema(不自創欄位)、面對幻覺誘因的表現(題目明確不給 guidance),以及結構化輸出路徑的差異。
GLM-5 通過 · 119 words, 0 banned, 1 question
We are thrilled to introduce Global Prompt Caching, a powerful new capability within our API gateway designed to optimize your AI operations. By intelligently storing prompt responses across every supported provider, this feature drastically reduces latency and cuts operational costs. Instead of processing identical requests repeatedly, our system serves cached results instantly, ensuring consistent performance even during high-traffic periods. Why pay full price for repeated inference on the same inputs? This update gives developers fine-grained control over cache lifetimes and hit rates, allowing for predictable budgeting and faster application response times. You can activate this functionality directly in your dashboard settings today. Start maximizing your efficiency now and deliver a snappier experience to your end-users without unnecessary API expenditure.
輸出 715 tok (+571 思考) 延遲 18.9 s
是否遵守限制(字數上限、禁用詞清單、只能有一句問句)、文字風格的特徵,以及長度控制。
30 秒上手 GLM-5
相容 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",
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",
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",
"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",
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")
.addUserMessage("Summarize this diff")
.reasoningEffort(ReasoningEffort.MEDIUM)
.build());
System.out.println(resp.choices().get(0).message().content().orElse(""));關於 GLM-5
- 相比前代,Z.AI 把參數量從 355B(啟用 32B)提升到 744B(啟用 40B),預訓練資料從 23T 增加到 28.5T token,並加入稀疏注意力與 Slime 非同步強化學習框架。
- 它提供 200K 上下文視窗、最高 128K 輸出 token、思考模式、函式呼叫、上下文快取與開源權重,Z.AI 稱其編碼與智慧體表現達到開源最先進水準。
- 除了程式碼之外,模型頁還點名了自家團隊瞄準的文件密集型工作:從合約與財務文件中抽取結構化資料、專業翻譯、客服品質檢驗,以及必須維持人設的角色扮演或分鏡寫作。
- 思考透過 thinking 物件設定,而這一代的預設值 enabled 意味著模型自行決定是否在作答前推理,而非被強制推理;推理軌跡會在獨立的 reasoning_content 欄位回傳,並先於答案串流輸出,先前輪次的軌跡預設會被移除。
- 工具呼叫最多接受 128 個函式,並可增量串流輸出工具參數,外部 MCP 工具可直接接入,支援 JSON object 輸出,重複前綴的快取為自動。
- 權重以 MIT License 釋出。
- Synthorai 透過其 OpenAI 相容端點提供 GLM-5,現有 SDK 無需改動即可使用。
常見問題
GLM-5 API 可以免費試用嗎?
可以,新帳號有 10 次試用呼叫和最高 $1 的免費額度,免綁卡。以輸入價 $1/M 計算,光是這筆額度就夠你對 GLM-5 發出約 125 次請求,每次約 8K token。
GLM-5 最擅長什麼?
擴展至 744B 參數,啟用 40B、稀疏注意力加非同步強化學習、開源權重,200K 上下文視窗。完整介紹請見「關於」一節,內容取自供應商官方的發布說明。
GLM-5 的價格是多少?
在 Synthorai 上,GLM-5 的輸入價是每百萬 token $1,輸出價是每百萬 token $3.2。這就是供應商官網價,平台不加價。快取命中的輸入 token 以 $0.2/M 計費。
GLM-5 的上下文長度是多少?
GLM-5 的上下文長度(上下文視窗)是 200K token。單次回覆最多輸出 131,072 個 token。
GLM-5 支援提示詞快取(prompt caching)嗎?
支援,而且全自動:由 Z.ai 處理的提示詞會自動快取,不用改程式碼。快取命中的輸入 token 以 $0.2/M 計費(未命中為 $1/M)。 提示詞快取指南 →
如何開通 GLM-5?
把現有 OpenAI SDK 的 base_url 指向 "https://synthorai.io/v1",model 設為 "glm-5" 就可以了。一把 API 金鑰就能呼叫閘道上的所有模型。
GLM-5 是開源的嗎?
是,權重以 MIT 授權釋出。不想自己準備 GPU 的話,這裡的託管版本按用量計費,不必自己架設基礎設施。 執行開放權重模型 →
相關模型
比較
本頁每一個數值都摘錄自供應商自己的文件(連結見上方),並附上查核日期。價格是放在整個目錄裡比較;各家供應商定義不一樣的規格,只說明差異,不畫成圖表比較。這裡沒有任何數據是我們自己量測的,也不做評分。