What you’ll have working
By the end of this, GLM-5.3 is driving your coding agent on a real repo: 1M-token context, reasoning set to the right effort level, and no 400 errors from old GLM-5.2 flags. Target time: under 10 minutes if you already have a Z.ai account.
Pick one path. Wire the model. Fire a multi-file task. Then fix the three settings that burn quota or reject the request. (No account yet? Create it first – the rest is config, not philosophy.)
30-second background
GLM-5.3 is Z.ai’s flagship coding model (launched Aug 2026; API ~Aug 18). Same GLM-5.2 base – roughly 744B MoE, ~40B active – with gains from scaled post-training only. The official launch post puts the internal Code Bench jump near 50%. Terminal-Bench 3.0: 4.6 → 28.3. DeepSWE v1.1: 46.2 → 66.9. CyberGym 84.5, called SOTA on that suite.
Day-one specs (as of late 2026, Z.ai docs): text-only, 1M context, max 128K output. Reasoning stays on. Effort is low / high / max.
Method A vs Method B
Same weights. Two bills.
| Method A: GLM Coding Plan + agent | Method B: Pay-per-token API | |
|---|---|---|
| Best for | Daily coding in Claude Code, ZCode, Cline, OpenCode | Custom apps, scripts, batch jobs |
| Cost shape | Flat tiers from $18/mo (Lite 10k pts/wk; as of Sep 2026 plan docs) + 50% off-peak points | ~$1.40 in / $4.40 out per 1M tokens (cached in ~$0.26) |
| Setup | Subscribe + env vars (or a small helper if you use one) | API key + OpenAI-compatible client |
| Gotcha | Two quotas (5-hour + weekly) | Default effort = max → expensive thinking tokens |
Method A wins if you want the model inside an agent this week. Predictable weekly points, 1M window already aimed at repo work. Method B waits until you’re metering tokens in your own stack – fine, just not the beginner default.
Walkthrough: Coding Plan + Claude Code
- Create a Z.ai account and subscribe to a GLM Coding Plan (Lite is enough to test). Grab an API key from the console.
- Install Claude Code if you don’t have it.
- Optional fast path: some setups use
npx @z_ai/coding-helperto paste the key and write env vars. If that package isn’t available in your environment, use the manual block below – it’s the same end state. - Manual path – put this in
~/.claude/settings.json:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "your_zai_api_key",
"ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-4.7",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5.3[1m]",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.3[1m]",
"CLAUDE_CODE_AUTO_COMPACT_WINDOW": "1000000",
"API_TIMEOUT_MS": "3000000"
}
}
[1m] is a Claude Code selector for the million-token variant. Drop it and long-context repo work gets worse fast. Keep the Haiku slot on a cheaper small model so background sweeps don’t eat flagship points.
Pro tip: Peak is only Monday-Friday 14:00-18:00 UTC+8. Outside that window – and all weekend – model points bill at 50% (Coding Plan usage docs). US East workday? You’re almost entirely off-peak. Size the tier from that, not the headline weekly number.
Open a real project. Ask for something multi-file – “add a retry wrapper around the payment client and update the tests.” First tokens at high/max can sit there a while; that long API_TIMEOUT_MS exists for a reason.
Other agents: OpenAI-compatible base https://api.z.ai/api/coding/paas/v4 (or the Anthropic URL above), model glm-5.3, context 1000000, vision off.
Off-peak math changes who should buy Pro. If your evenings and weekends are when you actually ship, Lite’s 10k weekly points behave more like 20k of peak-equivalent work. If your team only codes through that four-hour China afternoon window, the same Lite tier feels tiny. The plan didn’t change – your clock did.
Raw API path (when you need it)
Minimal OpenAI-style call. Endpoint and flags match the official docs:
from openai import OpenAI
client = OpenAI(api_key="YOUR_KEY", base_url="https://api.z.ai/api/paas/v4/")
r = client.chat.completions.create(
model="glm-5.3",
messages=[{"role": "user", "content": "Refactor this module for idempotent retries."}],
temperature=1.0,
extra_body={
"thinking": {"type": "enabled"},
"reasoning_effort": "high"
},
max_tokens=8192,
)
Migration guide defaults: temperature 1.0, top_p 0.95 – tune one, not both. Stream with stream=True and read both reasoning_content and content deltas.
Edge cases that waste money or break calls
Is max effort worth ~25K extra output tokens for ~3 bench points? For daily agent loops, usually no – that’s the whole point of the next list.
- Disabled thinking → 400. GLM-5.3 rejects
thinking.type: "disabled"(docs migration note; failures show up as HTTP 400 / code 1210 on pay-as-you-go). Map UI “off” toenabled+reasoning_effort: "low". - Default effort is max. Turns out omitting
reasoning_effortis the expensive choice. Z.ai Code Bench: high ~31.4% at ~50K output tokens per task; max ~34.5% at ~75K. High for normal agent work; max only after the agent already failed twice. - clear_thinking. Chat template default is false (HF model card), so prior chain-of-thought stays in the multi-turn prompt. Pass
clear_thinking: truewhere your stack allows template kwargs, or you re-pay for old reasoning every turn. - Dual quotas on the plan. 5-hour rolling window and weekly cap – independent. Hit either and Coding Plan tool calls stop; they don’t silently drain wallet balance.
- Text only. Need screenshots or diagrams? This checkpoint won’t take them. Use a multimodal sibling or another model for vision; keep GLM-5.3 on the code path.
Local weights sit on Hugging Face (zai-org/GLM-5.3, late Aug 2026) under the GLM-5.3 License – vLLM / SGLang / Unsloth paths exist – but even aggressive quants want workstation-class RAM. API or Coding Plan until you have a concrete reason to self-host.
FAQ
Is GLM-5.3 free?
No. Coding Plan points or per-token API. Third-party “free tiers” are temporary promos – don’t build a workflow on them.
Which reasoning_effort should I set for coding?
Start with high. Picture a mid-size refactor in Claude Code: high usually returns a solid plan and burns fewer output tokens than max. Flip to max only when the agent loops or the checklist is still short. Low is for mechanical edits where you mostly want instruction-following, not a deep design pass.
Why did my old GLM-5.2 script stop working?
Two breaks show up constantly. Anything still sending thinking: {type: "disabled"} gets a hard error – use enabled + low (same fix as the edge list). And glm-5.3[1m] belongs in Claude Code env vars only; plain OpenAI-compatible clients want bare glm-5.3 on https://api.z.ai/api/paas/v4 (or the coding/paas variant). Last check: custom agent plugins sometimes still match on a 5.2-only name – update the allowlist before you debug sampling.
Next: subscribe Lite (or open the API console), paste the settings block, open one real repo, send a single multi-file task with effort set to high. Then open the usage page. Peak or off-peak? That one run tells you more about tier sizing than the pricing table.