Skip to content

Z.AI GLM

SuperQode supports GLM-5.3, GLM-5.3-Flash, and other GLM-5.x models through Z.AI's first-party General API with 1M context, preserved thinking (clear_thinking: false), and tool streaming (tool_stream: true). SuperQode owns the coding harness, tools, approvals, and workspace execution; Z.AI provides the model inference endpoint.

Important endpoint boundary

This integration intentionally uses Z.AI's public General API endpoints only:

International:   https://api.z.ai/api/paas/v4
China Mainland:  https://open.bigmodel.cn/api/paas/v4

It does not route to Z.AI's restricted GLM Coding Plan endpoints (/api/coding/paas/v4 or /api/anthropic). Z.AI restricts Coding Plan quota to officially approved coding tools, and SuperQode enforces this boundary until Z.AI grants explicit approval. Use a General API key created in the Z.AI developer platform (or BigModel console for China Mainland).

Setup

# Option 1: Save key + regional endpoint locally (~/.superqode/auth.json)
superqode auth login zai --region intl   # https://api.z.ai/api/paas/v4
superqode auth login zai --region cn     # https://open.bigmodel.cn/api/paas/v4

# Option 2: Environment variables
export ZAI_API_KEY=your-general-api-key
export ZAI_API_BASE=https://api.z.ai/api/paas/v4   # or https://open.bigmodel.cn/api/paas/v4

# Show provider details without making a model request
superqode connect setup zai

# Test and select a model
superqode connect zai glm-5.3
superqode connect zai glm-5.3-flash

Do not set ZAI_API_BASE to /api/coding/paas/v4 unless Z.AI has explicitly approved SuperQode for Coding Plan use. superqode auth login zai rejects Coding Plan URLs automatically.

Models and Preserved Thinking

  • glm-5.3 (1M context, 128k output): Flagship software engineering and agent model. Thinking stays enabled (low, high, or max effort) with clear_thinking: false enabled by default so reasoning_content is preserved across multi-turn tool calls.
  • glm-5.3-flash (1M context, multimodal): Fast hybrid MoE for interactive visual and agentic coding.
  • glm-5.2 / glm-5.1 / glm-5: Previous GLM-5 iterations remain supported.

Z.AI Web Search & Web Reader (General API)

SuperQode also supports Z.AI's public General API Web Search (POST /api/paas/v4/web_search) and Web Reader (POST /api/paas/v4/reader) directly inside the built-in web_search and web_fetch tools, reusing your existing ZAI_API_KEY and regional endpoint (api.z.ai or open.bigmodel.cn):

superqode websearch use zai
superqode websearch test "latest Python release notes" --provider zai

In the macOS app, pick Z.AI in Settings โ†’ Web Search and choose International or China Mainland in Connect โ†’ Z.AI.

TUI

From the TUI, either open the Z.AI profile or specify the provider and model:

:connect zai
:connect zai/glm-5.2

You can also launch directly into the Z.AI profile:

superqode --connect zai

Z.AI's general API is a BYOK route, so it is not shown on the Subscriptions screen. A paid GLM Coding Plan is available separately through :connect glm-cli.

GLM CLI (community ACP agent)

glm-acp-agent is a community-maintained ACP agent that uses GLM models as its reasoning engine. It is not a first-party Z.ai client, and it runs its own agent loop instead of the SuperQode harness:

npm install -g glm-acp-agent
:connect glm-cli

:connect acp glm reaches the same agent through the generic ACP picker.

Goal Route
Use GLM models inside the SuperQode harness :connect zai
Use the community GLM agent loop :connect glm-cli

ZCode

ZCode is Z.AI's official desktop harness for GLM-5.3. It is discoverable in the SuperQode Harness Hub under Coming soon, but it is not the same integration as either route above. ZCode currently owns its own desktop agent loop, tools, permissions, browser automation, review flow, and task history.

SuperQode does not claim direct ZCode support until Z.AI publishes a supported ACP server, headless CLI, or external agent SDK. Use :hub coming to inspect the tracked entry and its official documentation.

GLM-5.3 and GLM-5.2 harnesses

The glm53-coding template uses the first-party Z.AI general API, GLM-5.3 with preserved thinking (clear_thinking: false), tool streaming, 1M context, and glm-5.3-flash fallback:

superqode harness init my-glm-agent --template glm53-coding
superqode harness inspect --spec my-glm-agent.yaml --json
superqode --harness glm53-coding -p "Review this repository"

Default model routing (glm53-coding):

  1. zai/glm-5.3
  2. zai/glm-5.3-flash
  3. zai/glm-5.2
  4. zai/glm-5.1

(glm52-coding remains available for existing specs.)

Optional live smoke test

The automated suite never spends API quota by default. To run the paid live smoke test explicitly:

SUPERQODE_LIVE_ZAI=1 \
ZAI_API_KEY=your-general-api-key \
pytest tests/test_zai_provider.py -k live -q

Override the live model when necessary:

export SUPERQODE_LIVE_ZAI_MODEL=glm-5.1