glm-delegation
Delegates tasks to Z.ai GLM-5.x via the stock claude binary and an endpoint swap
Night Market Skill: ported from claude-night-market/conjure. For the full experience with agents, hooks, and commands, install the Claude Code plugin.
GLM Delegation
Overview
GLM ships no CLI of its own. Z.ai serves an Anthropic-compatible
endpoint, so the stock claude binary reaches GLM by changing two
environment variables and nothing else. This is the endpoint-swap
archetype: the redirection is environment, never argv.
GLM-5.3 was released on 2026-08-14 and claims a large coding gain over GLM-5.2 from post-training alone.
When To Use
delegation-coreselectedglmfor the task- A 1M-token context is wanted through
glm-5.3[1m] - A GLM Coding Plan subscription should absorb the work instead of the Anthropic quota
When NOT To Use
ZAI_API_KEYis unset. Verification refuses rather than sending an unauthenticated request- The
claudebinary is not installed. GLM has no fallback CLI
Prerequisites
Installation
Only the stock Claude Code binary is needed:
npm install -g @anthropic-ai/claude-code
Authentication
export ZAI_API_KEY="<your-zai-key>"
The delegation service builds the child environment from that one
variable. Z.ai requires ANTHROPIC_AUTH_TOKEN, not
ANTHROPIC_API_KEY. Putting the key in the wrong one is the most
common way to get a 401 here, so the service names the correct
variable and the overlay references ${ZAI_API_KEY} rather than
storing a secret.
Quick Start
Using the shared delegation executor
uv run python scripts/delegation_executor.py glm "Review this design" \
--files docs/
Through the Makefile
make -C plugins/conjure delegate-glm PROMPT='Review this design'
Direct CLI usage
ANTHROPIC_BASE_URL=https://api.z.ai/api/anthropic \
ANTHROPIC_AUTH_TOKEN="$ZAI_API_KEY" \
claude --model glm-5.3 -p "Review this design"
Smart Delegation
glm declares code_execution and large_context strengths and ranks
behind gemini, qwen and minimax in the candidate order. It declares
glm-5.3 as its default, glm-5.3[1m] for large context, and
glm-5.3-flash for fast response.
GLM-Specific Details
| Property | Value |
|---|---|
| Binary | claude (stock) |
| Base URL | https://api.z.ai/api/anthropic |
| Auth variable | ANTHROPIC_AUTH_TOKEN, from ZAI_API_KEY |
| Default model | glm-5.3 |
| Large context | glm-5.3[1m] |
| Fast response | glm-5.3-flash |
| OpenAI-compatible URL | https://api.z.ai/api/coding/paas/v4 |
The [1m] suffix is what unlocks the 1M-token window. Omitting it is
a documented setup mistake. Pair it with
CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000 when driving claude
directly.
Two operational notes. Environment changes only take effect in a
freshly launched shell, so an already-open session keeps reaching
Anthropic's real endpoint. And claude shows a first-run trust prompt
when it sees a non-Anthropic base URL. The -p non-interactive form
this service uses does not block on it.
Prices per 1M tokens, from the
Z.ai pricing page on
2026-10-26: glm-5.3 is $1.40 input and $4.40 output, and
glm-5.3-flash is $0.15 and $0.50. Both have a 1M-token context.
GLM_52 stays defined for callers that pin it.
The same archetype generalizes: MiniMax, Moonshot/Kimi, DeepSeek and
OpenRouter all expose Anthropic-compatible endpoints, so adding one is
a ServiceConfig with a different base URL.
Exit Criteria
-
clauderesolves on PATH and answersclaude --version -
ZAI_API_KEYis set, and--verifyreports the service available rather than naming an unset variable - The built command contains no
z.aiURL: the endpoint travels in the child environment, not argv - The child environment carries
ANTHROPIC_AUTH_TOKEN, notANTHROPIC_API_KEY - Output saved to
delegations/glm/YYYYMMDD_HHMMSS.md - This skill ran because
delegation-coreselectedglm
- Downloads
- Security audit
- Review
- Last updated
- 2d ago
- Current version
- v1.10.3
- License
- MIT-0
