新帳號 免費註冊,送 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 成績

高於平均沒有模型更高25 / 801 / 80
GLM-5.2 其他有成績的模型 其他模型平均 ★ 沒有模型分數更高
SWE-Bench Pro
62.1%
Cybergym
77.2%
Finance Agent v2
49.7%
Harvey Lab-AA
91%
GPQA Diamond
91.2%
Agents' Last Exam
23.8%

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

價格在同類中的位置

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

輸入$1.4/M
$0.1 · Dola Seed 2.0 Mini GPT-5.4 Pro · $30
輸出$4.4/M
$0.275 · DeepSeek V4 Flash GPT-5.4 Pro · $180
快取讀取$0.26/M
$0.01 · Claude Haiku 5.5 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 的輸入價是每百萬 token $1.4,輸出價是每百萬 token $4.4。這就是供應商官網價,平台不加價。快取命中的輸入 token 以 $0.26/M 計費。

GLM-5.2 的上下文長度是多少?

GLM-5.2 的上下文長度(上下文視窗)是 1M token。單次回覆最多輸出 131,072 個 token。

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 金鑰就能呼叫閘道上的所有模型。

GLM-5.2 是開源的嗎?

是,權重以 MIT 授權釋出(官方儲存庫連結見「關於」一節)。不想自己準備 GPU 的話,這裡的託管版本按用量計費,不必自己架設基礎設施。 執行開放權重模型 →

相關模型

比較

本頁每一個數值都摘錄自供應商自己的文件(連結見上方),並附上查核日期。價格是放在整個目錄裡比較;各家供應商定義不一樣的規格,只說明差異,不畫成圖表比較。這裡沒有任何數據是我們自己量測的,也不做評分。

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