Z.ai (Zhipu)
Z.ai は Zhipu(智譜)のAPIで、GLM 背後のラボです。Flash ラインが永久無料枠 —— glm-4.7-flash と glm-4.5-flash。GLM-5、GLM-5.2、glm-4.7 はトークン課金です。OpenAI互換アドレスは open.bigmodel.cn/api/paas/v4。
Z.ai は Zhipu(智譜)のAPIで、GLM 背後のラボです。Flash ラインが永久無料枠 —— glm-4.7-flash と glm-4.5-flash。GLM-5、GLM-5.2、glm-4.7 はトークン課金です。OpenAI互換アドレスは open.bigmodel.cn/api/paas/v4。
open.bigmodel.cn は中国本土の電話番号を求めます。z.ai の国際ポータルはメールのみで、別アカウント扱い。同時実行はアカウントとモデルごとにコンソールへ表示されます。Flash チャットの上限は200Kです。
- 無料モデル
- 4
- 最大コンテキスト
- 200K
- 無料プラン
- GLM Flashモデルが無料
- 条件
- 電話番号認証、カード不要
エンドポイント
ベースURL
https://open.bigmodel.cn/api/paas/v4環境変数
ZHIPU_API_KEYレート制限
Concurrency set per account in the console- OpenAI互換
- テキスト
- 画像
- 動画
- 推論
コード例
npm install openaiimport OpenAI from 'openai'
const client = new OpenAI({
baseURL: 'https://open.bigmodel.cn/api/paas/v4',
apiKey: process.env.ZHIPU_API_KEY
})
const response = await client.chat.completions.create({
model: 'glm-4.7-flash',
messages: [{ role: 'user', content: 'Explain closures in one paragraph.' }]
})
console.log(response.choices[0].message.content)pip install openaiimport os
from openai import OpenAI
client = OpenAI(
base_url="https://open.bigmodel.cn/api/paas/v4",
api_key=os.environ["ZHIPU_API_KEY"],
)
response = client.chat.completions.create(
model="glm-4.7-flash",
messages=[{"role": "user", "content": "Explain closures in one paragraph."}],
)
print(response.choices[0].message.content)curl https://open.bigmodel.cn/api/paas/v4/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ZHIPU_API_KEY" \
-d '{
"model": "glm-4.7-flash",
"messages": [{"role": "user", "content": "Explain closures in one paragraph."}]
}'知っておくべきこと
- 無料なのはFlashシリーズ(glm-4.7-flash、glm-4.5-flash)。glm-4.7、glm-5、glm-5.2 はトークン課金です。
- open.bigmodel.cn は中国本土の電話番号を求めます。z.ai の国際ポータルはメールのみです。
無料で利用できるモデル4
- GLM 4.7 Flash
glm-4.7-flash - GLM 4.5 Flash
glm-4.5-flash - GLM 4.6 Flash
glm-4.6-flash - GLM 4 Flash
glm-4-flash