GLM Setup (Z.ai in Claude Code & More)
Connect Tempreon to Z.ai's GLM models by running GLM inside Claude Code, OpenCode, or Cline — your Bridge stays the same across all of them.
Ready to connect? Your Bridges page walks you through it step by step.
Open your Bridges pageOverview
GLM is Z.ai's model family — GLM-5.3 is the current flagship — and the GLM Coding Plan has become a popular way to run a frontier-class open model inside familiar coding harnesses. GLM plugs into Claude Code, OpenCode, and Cline; because MCP lives in the harness rather than the model, your Tempreon Bridge works identically in all of them.
Connected, your AI running GLM loads your Core Imprint, searches your Knowledge Vault, and remembers what it learns — the same intelligence layer you use across every other tool. Swapping the model changes nothing about your Bridge.
Quick path: point Claude Code at Z.ai's Anthropic-compatible endpoint via ~/.claude/settings.json → restart → connect Tempreon exactly as in the Claude Code guide.
Prerequisites
- A Z.ai account with a GLM Coding Plan API key (Lite, Pro, or Max — from $18/mo as of August 2026; pricing may change)
- Claude Code installed (for route A), or OpenCode/Cline (for route B)
- A Tempreon account with at least one available Bridge slot
Step-by-Step Setup
Route A: GLM Coding Plan inside Claude Code
Z.ai runs an Anthropic-compatible endpoint, so Claude Code can drive GLM directly. Add an env block to ~/.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"
}
}
Four details that trip people up:
- The base URL is
/api/anthropic— not/api/paas/v4, which is Z.ai's general OpenAI-style endpoint and won't work here. (If a different tool needs an OpenAI-protocol URL, a Coding Plan wants the coding-only endpoint/api/coding/paas/v4rather than the general one, so calls draw on the plan instead of account balance.) - The variable is
ANTHROPIC_AUTH_TOKEN— notANTHROPIC_API_KEY - The
[1m]suffix on the model id is an opt-in for GLM's 1M-token context, paired with theCLAUDE_CODE_AUTO_COMPACT_WINDOWvalue above — not a required id form. Bareglm-5.3is equally valid and simply runs without the 1M window. If Claude Code says the[1m]model does not exist, update Claude Code - Restart your Claude Code session after changing the settings; env changes don't apply to a running session
Set every model tier rather than just one. Z.ai's installer maps all three tiers to GLM-4.7 by default, so naming only the Sonnet tier can leave the others on an older model without any error to tell you.
Then connect Tempreon exactly as in the Claude Code guide:
claude mcp add --transport http tempreon https://api.tempreon.com/functions/v1/tempreon-mcp/mcp
and run /mcp inside Claude Code to complete the browser OAuth. The URL is also shown in your Bridges dashboard. If you already had Tempreon connected before switching to GLM, there's nothing to redo — MCP is harness-side, so the Bridge carries over untouched.
Route B: GLM in OpenCode or Cline
The same principle applies elsewhere: OpenCode and Cline both run GLM (via Z.ai's provider or OpenRouter), and both speak MCP at the harness level, so Tempreon connects the same way regardless of which model is active. For OpenCode, follow the OpenCode guide — the Tempreon config is identical whether the session runs GLM, Claude, or anything else.
Note (as of September 2026): You can't add Tempreon at chat.z.ai directly. The Connectors page you'll find there binds chat channels — Discord, Lark, WeChat — and Z.ai's in-chat tool picker offers only its own first-party tools, with no field for your own server URL. Neither is a custom MCP surface, so the harness is the route. If you'd rather stay inside Z.ai's own tooling, its desktop agent ZCode does support remote MCP servers with browser sign-in: add the server under Settings → MCP, then use the Open authorization button on its row to authorize in your browser.
Troubleshooting
GLM never responds, or auth errors from Z.ai. Check the two usual suspects: the base URL must be https://api.z.ai/api/anthropic (not /api/paas/v4), and the key must be in ANTHROPIC_AUTH_TOKEN (not ANTHROPIC_API_KEY).
Settings changed but nothing happened. Restart the Claude Code session — the env block is read at startup.
Tempreon connection fails immediately. Check the URL ends in /mcp — no trailing slash. The full URL is https://api.tempreon.com/functions/v1/tempreon-mcp/mcp.
GLM works but Tempreon tools are missing. The env block only swaps the model; the Bridge is configured separately. Run /mcp in Claude Code to check Tempreon's status and complete OAuth if it's pending.
Not sure which side is broken. Model errors mention Z.ai, quotas, or the model name; Bridge errors mention the tempreon server or OAuth. They're independent — fix them separately.
Also connect: Kimi · OpenCode · Claude Code
Try saying...
- "Start my session." — triggers
session_startto load your Core Imprint - "Remember: GLM handles the refactor work; keep commit messages in English." — stores a preference that persists across models and harnesses
- "What do you know about me from Tempreon?" — a quick end-to-end test
Frequently asked questions
- When I'm running GLM in Claude Code, how do I authorize Tempreon — does the Z.ai key handle it?
- No. The Z.ai key only routes the model; Tempreon authorizes separately through Claude Code's normal Bridge OAuth. After adding the server with claude mcp add, run /mcp inside Claude Code to complete the browser OAuth. The two are independent, so a Z.ai model key never authorizes the Bridge and vice versa.
- Where do I configure GLM and Tempreon when running Z.ai's model inside Claude Code?
- These live in two places. Point Claude Code at GLM by adding an env block to ~/.claude/settings.json with ANTHROPIC_AUTH_TOKEN set to your Z.ai key, ANTHROPIC_BASE_URL set to https://api.z.ai/api/anthropic, and the model tiers set to glm-5.3[1m]. The [1m] suffix is an opt-in that enables GLM's 1M-token context, paired with the compaction window setting — it is not a required id form, and bare glm-5.3 works too, just without the 1M window. If Claude Code reports that the [1m] model does not exist, update Claude Code. Tempreon itself is added separately with claude mcp add, exactly as in the Claude Code guide, since the Bridge is harness-side.
- GLM never responds or throws auth errors from Z.ai in Claude Code. What are the usual causes?
- Two settings usually cause it. The base URL must be https://api.z.ai/api/anthropic, not the /api/paas/v4 OpenAI-style endpoint, and your key must be in ANTHROPIC_AUTH_TOKEN, not ANTHROPIC_API_KEY. After correcting either one, restart the Claude Code session, because the env block is only read at startup.