GLM 5.3 Flash Xploded in Claude Code.
Run glm-5.3-flash-xploded as the model behind Claude Code through MagmaRouter, with a hard spend cap on the key and no prompt retention.
The model MagmaRouter sells, and the only one on this page that is both uncensored and able to drive the agent. A million tokens of context, tool calling and vision, at $0.23 in and $0.92 out per million. Point Claude Code at it and there is no second model to configure: the refusal training is off the same model doing the work.
| Model id | glm-5.3-flash-xploded |
|---|---|
| Context | 1M tokens |
| Input price | $0.230 / million tokens |
| Output price | $0.920 / million tokens |
| Tool calling | Supported |
Set it up
Point Claude Code's base URL at MagmaRouter (no /v1), set the auth token to your key, name this model, and set the context length to its real value of 1,048,576:
# Put these in your shell profile, then run: claude
export ANTHROPIC_BASE_URL=https://api.magmarouter.com
export ANTHROPIC_AUTH_TOKEN=rl-...
export ANTHROPIC_MODEL=glm-5.3-flash-xploded
export ANTHROPIC_DEFAULT_HAIKU_MODEL=glm-5.3-flash-xploded
export CLAUDE_CODE_MAX_CONTEXT_TOKENS=1048576
Or put the same values under env in ~/.claude/settings.json:
// ~/.claude/settings.json
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.magmarouter.com",
"ANTHROPIC_AUTH_TOKEN": "rl-...",
"ANTHROPIC_MODEL": "glm-5.3-flash-xploded",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-5.3-flash-xploded",
"CLAUDE_CODE_MAX_CONTEXT_TOKENS": "1048576"
}
}
ANTHROPIC_DEFAULT_HAIKU_MODEL is the cheap background model, set to glm-5.3-flash-xploded above. CLAUDE_CODE_MAX_CONTEXT_TOKENS is set because Claude Code assumes 200K for an id it does not recognise. Use ANTHROPIC_AUTH_TOKEN and leave ANTHROPIC_API_KEY unset. Full setup and every caveat is in the Claude Code guide.
FAQ
Can GLM 5.3 Flash Xploded edit files and run commands in Claude Code?
Yes. It supports tool calling, which is what Claude Code needs to use its Read, Edit, Write and Bash tools. A model without tool calling could only chat.
How much does it cost?
$0.230 per million input tokens and $0.920 per million output tokens through MagmaRouter, margin already included. Put a spend cap on the key so an agent loop cannot overrun it.
Is this an official Anthropic setup?
No. Anthropic does not officially support routing Claude Code to non-Claude models through a gateway. It works because MagmaRouter translates the Messages API, but it is not a configuration Anthropic backs.