glm-5 API
Z.ai / GLM
透過 RunAPI 使用 GLM 系列的 glm-5。按次計費,無訂閱費,失敗的生成不收費。
可直接上線
·
text
·
可商用
# Base URL
https://runapi.ai
# Endpoints
POST /v1/chat/completions
POST /v1/responses
POST /v1/messages
POST /v1beta/models/glm-5:generateContent
POST /v1beta/models/glm-5:streamGenerateContent
curl https://runapi.ai/v1/chat/completions \
-H "Authorization: Bearer $RUNAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5",
"messages": [
{
"role": "user",
"content": "閱讀這個多檔案 repository,找出失敗的整合測試,並提出 patch,同時說明根本原因。"
}
]
}'
from openai import OpenAI
client = OpenAI(
base_url="https://runapi.ai/v1",
api_key="your-runapi-key"
)
response = client.chat.completions.create(
model="glm-5",
messages=[{"role": "user", "content": "閱讀這個多檔案 repository,找出失敗的整合測試,並提出 patch,同時說明根本原因。"}]
)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://runapi.ai/v1",
apiKey: "your-runapi-key"
});
const response = await client.chat.completions.create({
model: "glm-5",
messages: [{ role: "user", content: "閱讀這個多檔案 repository,找出失敗的整合測試,並提出 patch,同時說明根本原因。" }]
});
切換 variant
OVERVIEW
glm-5 在 GLM 系列中,兼顧品質與成本的最佳平衡。
- 以美元按次計費
- 生成失敗不收費
- 模型支援時可串流輸出
- Model skill setup
PRICING
價格
失敗的生成不收費
Chat completion
Input
$1.00
/ 1M tokens
Output
$1.60
/ 1M tokens
Cache read
$0.20
Cache write 5m
Free
Cache write 1h
Free
規格表
技術細節
| Model ID | glm-5 |
| 供應商 | Z.ai |
| 模態 | text |
| 任務類型 | synchronous |
| 計費單位 | 1K tokens |
| API endpoint | /v1/chat/completions |
| /v1/responses | |
| /v1/messages | |
| /v1beta/models/glm-5:generateContent | |
| /v1beta/models/glm-5:streamGenerateContent | |
| 商用授權 | 是 — 已透過 API 包含 |
| 目錄狀態 | 可直接上線 |
SKILLS
快速開始 — glm-5
相同格式 · variant 固定在 model 中
| Endpoint | Protocol |
|---|---|
| /v1/chat/completions | OpenAI compatible |
| /v1/responses | OpenAI Responses |
| /v1/messages | Anthropic compatible |
| /v1beta/models/glm-5:generateContent | Gemini generateContent |
| /v1beta/models/glm-5:streamGenerateContent | Gemini streamGenerateContent |
運作方式
四步驟使用 glm-5
01
安裝
安裝此 model line 的 model skill。
02
設定
將 model 欄位設定為此頁面顯示的完整 model ID。
03
呼叫
使用您的 prompt、inputs 和 callback 設定送出型別化請求。
04
接收
讀取 RunAPI 的 task 回應、webhook callback 或快取輸出 URL。
DIFFERENCES
glm-5 有什麼不同
VS GLM-4.5
744B / 啟用 40B;200K 上下文;77.8% SWE-bench Verified
355B / 啟用 32B;128K 上下文;旗艦開放權重 MoE baseline
VS GLM-4.5-AIR
744B / 啟用 40B;200K 上下文;77.8% SWE-bench Verified
較輕量的 GLM-4.5 層級,適合快速、低成本日常工作
VS GLM-4.6
744B / 啟用 40B;200K 上下文;77.8% SWE-bench Verified
200K 上下文;首個運行於 Cambricon 晶片的 GLM;更銳利的程式碼生成
使用情境
最適合
客服支援
從私有知識庫回答顧客問題,減少工單量。
文件分析
起草合約摘要,並標示關鍵條款供律師審閱。
程式碼生成
在 CI 中自動產生單元測試、程式碼審查與重構建議。
FAQ
關於 glm-5 的常見問題
模型 ID 在不同版本之間會保持穩定嗎?
RunAPI 會維持 model ID 穩定,並在不改變請求格式的情況下處理相容版本更新。
這個 variant 的速率限制是多少?
每個金鑰的速率限制會依使用方案而調整。請查看定價頁面以了解目前限制。
之後可以切換 variant 嗎?
可以——variant 只是旗標。只要變更 model 參數即可切換。
它支援串流嗎?
只要支援串流,RunAPI 就會端到端串流。
我該在哪裡回報品質問題?
請在公開 GitHub repo 提交 issue,或寄信給支援。
GLM 的其他 variant
glm-4.5-air
最便宜
4.5-air
Input $0.10 / 1M tokens | Output $0.55 / 1M tokens
glm-4.5
4.5
Input $0.41 / 1M tokens | Output $1.61 / 1M tokens
glm-4.6
4.6
Input $0.60 / 1M tokens | Output $1.22 / 1M tokens
glm-4.7
4.7
Input $0.60 / 1M tokens | Output $1.19 / 1M tokens
glm-5.2
5.2
Input $0.70 / 1M tokens | Output $2.20 / 1M tokens
glm-5-turbo
最快
5-turbo
Input $1.20 / 1M tokens | Output $2.00 / 1M tokens
glm-5.1
5.1
Input $1.40 / 1M tokens | Output $2.20 / 1M tokens
其他模型的替代方案
立即開始