SiAPI.ai
Português (BR)

GLM-5.4 Setup: ZCode, Claude Code, Codex CLI and TRAE

By Cameron Voss

Published · 8 min read

TL;DR

GLM-5.4 is live for every GLM Coding Plan tier. Five routes reach it today: the ZCode desktop client, Claude Code, Codex CLI, TRAE, and free official chat apps. The pay-as-you-go API stays closed until the security review ends. Before you copy any config, one number is worth a second look: the model takes a 1M token context, and the official FAQ still suggests setting the client window to 512000 for better coding results.

In this article

What can run GLM-5.4 today?

A subscription. GLM-5.4 answers on every plan tier (Lite, Pro, Max), and new accounts can start on a free 5-day Start Plan instead of paying first.

The pay-as-you-go path is not open. The /api/paas/v4 endpoint exists, and the official status says it opens after the security review completes. The English platform homepage still lists GLM-5.3, the price list has no GLM-5.4 row, and open weights follow their own schedule. An integration built today against an open model switches to GLM-5.4 later by changing base_url and the model name.

Billing splits in two as well. Plan keys work on the coding endpoints and draw from the plan. Standard API keys draw from balance or resource packs and never touch the plan.

Which route fits you?

RouteWhat you needSetup effortWatch out forBest for
ZCode desktopCoding Plan login, or a Start PlanInstall and sign inRegion follows UI language; pick GLM-5.4 in the model selectorZero-config start, long agentic tasks
Claude CodePlan key plus settings.jsonAbout 5 minutesKeep the [1m] suffix on model names; open a new terminal after editsExisting Claude Code users
Codex CLIPlan key plus config.toml and models.jsonAbout 10 minuteswire_api must stay "responses"Responses API users, effort control
TRAE (China)TRAE Pro+ membership or aboveUpdate the appTRAE's Pro+ is TRAE's own tier, not the Zhipu planTRAE members
Pay-as-you-go APINot open yetWaitOfficial status: opens after security reviewServer integrations, later
GLM-5.4 five routes from a Coding Plan subscription
GLM-5.4 five routes from a Coding Plan subscription

Z.ai Chat and AutoClaw add a free lane: GLM-5.4 for chat, no plan attached. They cannot read your repository or run tools, but they show what the model can do before any payment.

All coding routes share three endpoints. China region: open.bigmodel.cn. Global region: api.z.ai.

ProtocolPathUse
OpenAI-compatible/api/coding/paas/v4Generic coding tools, Cline and similar
Anthropic-compatible/api/anthropicClaude Code
Responses/api/v1Codex CLI

Keep one region per setup. Mixing open.bigmodel.cn with api.z.ai in a single client is a common way to fail the first request.

How do you set up the ZCode desktop client?

1. Install ZCode 4.0.0 from zcode.z.ai. Builds cover macOS on Apple Silicon and Intel, Windows, and a Linux beta.

2. Sign in through browser authorization. On the China region, the same phone number as your BigModel account carries the plan over automatically; pasting a plan API key works as well.

3. Select GLM-5.4 in the model selector at the bottom right of the input box. When it is missing, upgrade the client and refresh under Settings, Model settings.

4. Set thinking effort to match the task. Levels are low, high, and max, and max is the default. High spends fewer points on routine edits.

The Start Plan gives new accounts 5 days with 3 million GLM-5.4 tokens plus 5 million GLM-5.3-Flash tokens per day, valid inside official clients.

How do you wire GLM-5.4 into Claude Code?

Node.js 18 or newer and a plan key are the base; native Windows also needs Git for Windows. Open ~/.claude/settings.json and fill the env block:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://open.bigmodel.cn/api/anthropic",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_PLAN_KEY",
    "ANTHROPIC_MODEL": "glm-5.4[1m]",
    "ANTHROPIC_SMALL_FAST_MODEL": "glm-5.3-flash[1m]",
    "CLAUDE_CODE_AUTO_COMPACT_WINDOW": "512000"
  }
}

Global accounts point ANTHROPIC_BASE_URL at https://api.z.ai/api/anthropic. The [1m] suffix turns on the 1M context mapping. Save the file, open a new terminal, run claude, and type /status: the settings source should point at your settings.json and the model line should read glm-5.4[1m]. A missing model usually means an old client; run claude update, which the docs tie to v2.1.140 and up. The /effort command moves thinking between low, medium, high, and max, and unknown values fall back to max.

Claude Code setup steps for GLM-5.4 with the env block
Claude Code setup steps for GLM-5.4 with the env block

What does the Codex CLI setup look like?

Install with npm install -g @openai/codex, then touch two files.

~/.codex/models.json declares the model:

{
  "glm-5.4": {
    "default_reasoning_level": "max",
    "context_window": 1048576,
    "max_context_window": 1048576,
    "effective_context_window_percent": 95,
    "default_reasoning_summary": "none"
  }
}

~/.codex/config.toml points Codex at Zhipu:

model_provider = "ZAI"
model = "glm-5.4"
model_context_window = 512000
model_reasoning_effort = "max"
model_catalog_json = "~/.codex/models.json"

[model_providers.ZAI]
base_url = "https://open.bigmodel.cn/api/v1"
experimental_bearer_token = "YOUR_PLAN_KEY"
wire_api = "responses"

The provider path is /api/v1, and wire_api must stay "responses" or Codex sends the wrong protocol. Restart after editing. Thinking tokens bill as output tokens, which makes high the sensible level for daily work and max something to save for the hard problems.

What about TRAE and the free chat apps?

TRAE shipped GLM-5.4 on day one, November 23, and gates it to TRAE Pro+ members and above. That tier belongs to TRAE's own membership system; the Lite, Pro, and Max levels of the GLM Coding Plan play no role here. Updating the app and signing in is the whole setup.

No budget at all still gets you Z.ai Chat and AutoClaw, with Zhipu Qingyan on the China side. Chat only, no repository, no tools. As a free first probe of the model, it does the job.

Why does the official FAQ suggest a 512000 context window?

Because the window in that recommendation is not the model's limit. The model accepts 1M tokens, and the FAQ still asks for a 512000 client window, with better coding results as the stated reason. The catalog number and the compact window control different things:

- 1048576 in the model catalog, or the [1m] suffix in Claude Code, tells the client what the model accepts.

- 512000 as the compact window (CLAUDE_CODE_AUTO_COMPACT_WINDOW, or model_context_window in Codex) tells the client when to start summarizing older turns.

GLM-5.4 context window decision card: 1M declared, 512000 recommended
GLM-5.4 context window decision card: 1M declared, 512000 recommended

Compaction is a client strategy and never changes the model. One international walkthrough sets the compact window to 1000000; the China docs ask for 512000. Following the official recommendation is the safe default.

How do the quota caps and points work?

Two ceilings apply to every plan:

Plan5-hour capWeekly cap
Lite2,000 points10,000 points
Pro12,000 points60,000 points
Max28,000 points140,000 points

The 5-hour pool refreshes on a rolling window; the weekly pool resets every 7 days. Points come from one formula:

points = (input x 4.6 + cached input x 1.1 + output x 16) / 10000

A run with 100K input, 10K output, and no cache costs 62 points. Serve 90K of that input from cache and the cost drops to 30.5 points. GLM-5.3 coefficients sit at 6.9, 1.7, and 24, so identical token counts burn noticeably fewer points on GLM-5.4, and the docs describe a 1.5x quota stretch when requests hit GLM-5.4.

Weekdays 14:00 to 18:00 UTC+8 bill at full points, and everything outside that window costs half. Running Claude Code and Codex in parallel spends the same pool: the points are shared, and both caps apply to the sum. Concurrency guidance from the docs is one project on Lite, one or two on Pro, and two or more on Max.

Which errors should you expect?

SymptomCauseFix
GLM-5.4 missing from the model listClient out of dateUpgrade the client, then refresh under Settings, Model settings
Model not found in Claude CodeClient too oldRun claude update; docs note v2.1.140 and up
Points deducted outside the planStandard key or non-designated toolUse the plan key from Personal Coding Plan, Plan Overview; check the usage page after a small task
Error 1113, insufficient balancePlan conditions not metThe plan never draws on balance or resource packs; check the key type and wait for the next 5-hour window
Config edits do nothingOld shell sessionOpen a new terminal, restart Codex
Requests fail on a mixed setupopen.bigmodel.cn and api.z.ai mixedKeep one region per setup

FAQ

Which clients support GLM-5.4 today?

ZCode desktop, Claude Code, Codex CLI, and TRAE work as coding clients, and Z.ai Chat plus AutoClaw cover the free chat side. Plan points only apply inside designated tools.

Can I call GLM-5.4 through the standard API today?

No. The pay-as-you-go path opens after the security review finishes, and open weights follow a separate schedule. Coding Plan routes are the only live access.

Do Claude Code and Codex share one quota?

Yes. Both clients draw from the same plan points, and the 5-hour and weekly caps apply to their combined usage.

Does the 512000 recommendation limit the model?

No. The model still accepts up to 1M tokens. The value only sets when your client begins compacting older turns.

Choosing between Lite, Pro, and Max is easier when the model prices sit next to the quota numbers. Our pricing page keeps both current.