Z.ai (GLM)

Configure jambonz to use Z.ai’s GLM models over its OpenAI-compatible API.

Z.ai (Zhipu AI) serves its GLM family of models behind an OpenAI-compatible API. The wire is OpenAI-compatible (chat completions, streaming, tools), so the integration is straightforward — jambonz talks to it via a base URL override.

Two endpoints are available:

  • Global (default) — https://api.z.ai/api/paas/v4
  • Chinahttps://open.bigmodel.cn/api/paas/v4

Get credentials

  1. Sign in at the global console (z.ai) or the China console (open.bigmodel.cn).
  2. Open API Keys and create a key.
  3. Copy the value.

Configure in jambonz

In the portal: Account → LLM Services → + Add LLM Service → Z.ai.

API Key
stringRequired

The key from Z.ai’s console.

Base URL
string

Defaults to https://api.z.ai/api/paas/v4 (global). Set to https://open.bigmodel.cn/api/paas/v4 for the China (BigModel) endpoint, or to your own proxy.

Click Test to verify.

Use in an agent verb

1session.agent({
2 llm: {
3 vendor: 'zai',
4 model: 'glm-4.6',
5 llmOptions: {
6 systemPrompt: 'You are a helpful voice assistant.',
7 },
8 },
9 stt: { vendor: 'deepgram', language: 'en-US' },
10 tts: { vendor: 'cartesia', voice: 'sonic-english' },
11 turnDetection: 'krisp',
12 bargeIn: { enable: true },
13 actionHook: '/agent-complete',
14}).send();

Available models

Model idNotes
glm-4.6GLM 4.6 — flagship, strong reasoning and tool use
glm-4.5GLM 4.5
glm-4.5-airLighter/faster variant — good for low-latency voice turns

Check the Z.ai model catalog for the live list.

Quirks & errors

Global vs China: keep vendor: 'zai' constant — only the Base URL (in the portal credential) differs between the global Z.ai endpoint and the China BigModel endpoint. Keys are not interchangeable across endpoints.

Tool-calling capability varies by model. GLM 4.6 handles tools well; lighter -air variants may be less consistent. Test thoroughly before relying on function calling.

401 — key revoked, copied with whitespace, or used against the wrong region’s endpoint. Regenerate in the console and confirm the Base URL matches.