it's free*.ai

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モデルが無料
条件
電話番号認証、カード不要

エンドポイント

ベースURLhttps://open.bigmodel.cn/api/paas/v4
環境変数ZHIPU_API_KEY
レート制限Concurrency set per account in the console

コード例

npm install openai
import 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)

知っておくべきこと

無料で利用できるモデル4