新用戶 免費註冊,送 10 次呼叫,最高 $1,免綁卡。

GLM-5.2

發布於 2026-06-16

chat程式碼推理工具呼叫提示詞快取

GLM-5.2 是 Z.AI 為長程任務時代打造的旗艦,把上下文視窗擴展到 1M token,輸出最高 128K;文件強調要讓 1M 上下文在專案規模的工作中真正可用。

輸入
文字 $1.4/M
輸出
文字 $4.4/M
快取讀取
$0.26/M
上下文
1M
相較 GPT-4o
便宜約 72%

Benchmark 成績

高於同儕均值無人分數更高26 / 701 / 70
GLM-5.2 其他被測模型 同儕均值 無人分數更高
SWE-Bench Pro
62.1%
GDPval-AA v2 Elo · 642-1861
1510
Harvey Lab-AA
91%
GPQA Diamond
91.2%
MCP-Atlas
82.6%

廠商公布: Alibaba (Qwen) Anthropic ByteDance DeepSeek Google MiniMax Moonshot OpenAI Tencent Z.ai

價格在同類中的位置

價格在 60 個同類模型中的位置

輸入$1.4/M
$0.05 · Qwen3 VL Flash GPT-5.4 Pro · $30
輸出$4.4/M
$0.275 · DeepSeek V4 Flash GPT-5.4 Pro · $180
快取讀取$0.26/M
$0.0028 · DeepSeek V4 Flash GPT-5.4 Pro · $15

這條線顯示該模型的價格,在 Synthorai 上同類模型裡處於什麼位置。兩端標出了最便宜和最貴的那個。這裡是基礎價,批次、區域與快取寫入的折扣見價格頁。

規格與限制

Token

上下文視窗(廠商規格) 1,000,000
最大輸出(廠商規格) 131,072

提示詞快取

快取方式 自動

思考

廠商參數 thinking.type + reasoning_effort
可選值 thinking.type enabled · disabled; reasoning_effort none · minimal · low · medium · high · xhigh · max (none and minimal skip thinking, low and medium map to high, xhigh maps to max)
預設值 enabled,reasoning_effort 為 max:唯一帶力度旋鈕的 GLM,而且預設就落在最高等級 請求未指定時生效
可關閉 支援
思考行為 思考軌跡透過 reasoning_content 回傳;在標準 API 端點上,先前輪次的軌跡預設會被清除,而交錯思考要生效,thinking 區塊必須與工具結果一併回傳。
參數 reasoning_effort
取值 minimal · low · medium · high 閘道側參數面——以上方廠商映射為準

模型

模態 文字 → 文字
參數量 總參數 744B · 啟用 40B MoE
授權條款 MIT

長程任務旗艦(744B-A40B),具備可用的 1M token 上下文 / 128K 最大輸出、可設定的思考力度等級,以及 1M 上下文下的 IndexShare 稀疏注意力效率。

依據 Z.ai 官方文件 ↗

單一提示詞 — 經由閘道測量

提示詞 Explain to a CFO, in exactly three sentences, why our LLM bill doubled after we enabled reasoning. 檢查 恰好 3 句

GLM-5.2 通過 · 3 sentences

Enabling reasoning means the LLM now generates thousands of invisible "thinking" tokens to systematically work through complex problems before producing a final answer. Because our cloud providers bill for these internal processing steps at the same rate as standard output, our billable token volume per query has doubled. While this increases our direct API costs, it drastically reduces error rates and manual review labor, ultimately lowering our total cost per resolved transaction.

輸出 1223 tok (+1138 思考) 延遲 17.1 s

指令遵循(恰好三句,可數)、受眾適配(面向 CFO 的語氣),以及下方 token 計量所暴露的隱藏思考計費缺口。

提示詞 This function is supposed to return the longest run of consecutive equal items, but callers report it is off by one on single-element inputs and misses runs that end at the last index. Fix it and explain the bug in one paragraph. 檢查 修復通過測試

GLM-5.2 未命中 · 1/8 cases (fails [1])

```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 […]

輸出 4097 tok (+4036 思考) 延遲 58.4 s

修復是否真的正確(可執行)、解釋的資訊密度,以及在一個邊界明確的任務上的 token 效率。

提示詞 Extract a JSON object with fields {company, quarter, revenue_usd_m, growth_pct, guidance} from this text. Use null for anything not stated; add no other fields. 檢查 合法 JSON,schema 精確

GLM-5.2 通過 · 5/5 fields, guidance "withheld"

```json { "company": "Meridian Robotics", "quarter": "September quarter", "revenue_usd_m": 412, "growth_pct": 11, "guidance": "withheld" } ```

輸出 1947 tok (+1893 思考) 延遲 30.9 s

schema 服從度(不臆造欄位)、幻覺壓力(guidance 明確被暫緩給出),以及結構化輸出路徑的差異。

提示詞 Write a 120-word product announcement for an API gateway feature that caches prompts across providers. Forbidden words: "seamless", "unlock", "game-changer", "revolutionize", "empower". Exactly one sentence must be a question. 檢查 120 詞,0 個禁用詞

GLM-5.2 通過 · 120 words, 0 banned, 1 question

We are introducing Caching for our API Gateway, the smartest way to optimize your workflows. Why pay for the exact same response twice? Now, you can automatically store and reuse prompt results across multiple AI providers, drastically reducing latency and overall operational costs. If a user submits a duplicate query, the gateway serves the cached answer instantly, regardless of whether you route to OpenAI, Anthropic, or others. This directly translates to faster applications and significantly lower monthly API bills. You can easily configure your specific caching rules within the developer dashboard and watch your efficiency soar. Stop wasting your valuable tokens on completely redundant computations. Upgrade to the latest gateway version today and experience the future of intelligent prompt management.

輸出 11125 tok (+10984 思考) 延遲 114.8 s

約束服從度(字數預算、禁用詞表、唯一的那句問句)、文風指紋,以及長度控制。

30 秒用上 GLM-5.2

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.2",
    messages=[{"role": "user", "content": "Summarize this diff"}],
    reasoning_effort="medium",
)
print(resp.choices[0].message.content)

關於 GLM-5.2

  • 相對 GLM-5.1,官方頁面強調更穩定的長程任務執行、在超長上下文中更一致地遵循工程規範、具備多檔案重構的專案級理解,以及行動端與用戶端開發的完整端上除錯循環,另有小程式與小遊戲開發和研究復現。
  • 更長視窗背後的效率手段也已公開:IndexShare 方案讓一個輕量索引器服務每四層 transformer,降低 1M 上下文下的每 token 算力,改進的多 token 預測層則提高了投機解碼的接受率。
  • 它也是這條產品線中唯一具備 reasoning_effort 控制項的模型,文件化的一組層級在實務上收斂為跳過思考、high 設定與最高設定三種,而託管 API 預設為最高設定,因此一個什麼都不設的請求就是一個會努力思考的請求。
  • 思考的其餘行為與 GLM-5 產品線一致,推理軌跡回傳在獨立欄位中,工具呼叫、MCP、JSON 輸出與自動快取同樣沿用。
  • 權重以 MIT 授權釋出。
  • 在 Synthorai 上呼叫 GLM-5.2 時,OpenAI 相容端點讓它成為長上下文智慧體負載的直接替換式升級。

常見問題

GLM-5.2 API 可以免費試用嗎?

可以,新帳號可獲得 10 次試用呼叫和最高 $1 的免費額度,無需信用卡。以輸入 $1.4/M 計算,光是這筆額度就足以對 GLM-5.2 發出約 89 次 ~8K token 的請求。

GLM-5.2 最擅長什麼?

上下文擴展至可用的 1M token、專案級理解與多檔案重構、移動開發的真機除錯閉環。完整能力請見「關於」一節,內容取自廠商官方發布說明。

GLM-5.2 的價格是多少?

在 Synthorai 上,GLM-5.2 輸入 $1.4/百萬 token、輸出 $4.4/百萬 token,即廠商牌價,無平台加價。快取命中的輸入 token 以 $0.26/M 計費。

GLM-5.2 支援提示詞快取(prompt caching)嗎?

支援,且全自動:由 Z.ai 供應的提示詞會自動快取,無需改程式碼。快取命中的輸入 token 以 $0.26/M 計費(未命中 $1.4/M)。 提示詞快取指南 →

如何開通 GLM-5.2?

把現有 OpenAI SDK 的 base_url 指向 "https://synthorai.io/v1",model 設為 "glm-5.2" 即可。一組 API key 通用閘道上的所有模型。

GLM-5.2 是開源的嗎?

是,權重以 MIT 授權 發布(官方儲存庫連結見「關於」一節)。也可以省下 GPU:這裡的託管版本按用量計費,無需自建基礎設施。 執行開放權重模型 →

相關模型

對比

本頁每個值都轉錄自廠商自己的文件(連結見上),並帶有核對日期。價格在全目錄範圍內比較;各廠商定義不同的規格值,只說明差異而不作圖表對比。此處沒有任何由我們測量的資料,也不做評分。

取得 API 金鑰 算算你的成本 →