Claude Code + minirouter
Environment variables for using Claude Code with MiniRouter's Anthropic-compatible Messages endpoint.
Settings
Shell environment, or env in ~/.claude/settings.json
In order
- ANTHROPIC_BASE_URLhttps://api.minirouter.sh
Use the bare host. Claude Code adds /v1/messages itself.
- ANTHROPIC_AUTH_TOKEN$MINIROUTER_KEY
Claude Code sends this value as a Bearer token.
- ANTHROPIC_MODELzai/glm-5.3-flash
Use the full ID of a tool-capable model from the live catalog.
export MINIROUTER_KEY=mr-live-YOUR-KEY-HERE
export ANTHROPIC_BASE_URL=https://api.minirouter.sh
export ANTHROPIC_AUTH_TOKEN="$MINIROUTER_KEY"
export ANTHROPIC_MODEL="zai/glm-5.3-flash"
claude --model "$ANTHROPIC_MODEL"Recommended models · 4
All models →- Modelzai/glm-5.3-flashWhyBest current balance of coding ability, agentic performance, context and cost.→
- Modelopenai/gpt-5.6-solWhyHigher-intelligence option when task quality matters more than spend.→
- Modelspacexai/grok-4.6WhyStrong agentic alternative with a 500K-token window.→
- Modelgoogle/gemini-3.8-flashWhyMultimodal coding alternative with a 1M-token window.→
Only rows confirmed in the current live catalog are linked. A plain row is included as a reference. Paste ids exactly as written, author/name.
When it fails
- SymptomClaude Code calls api.anthropic.com instead of MiniRouterCodeclient-side
ANTHROPIC_BASE_URL was not exported into the shell that launched Claude Code. Set it to the bare MiniRouter host, then start a new Claude Code process from that shell.
- SymptomThe selected model name is rejectedCodeunknown_model
Claude aliases such as sonnet and opus are not MiniRouter model IDs. Pass a full author/name ID from the current catalog with --model. docs/errors#unknown_model →
- Symptom401 on every requestCodeinvalid_api_key
Wrong or rotated key. Keys start with mr-live-; after a rotation the old key keeps working for 24 hours, then dies. docs/errors#invalid_api_key →
- Symptom402 before any tokens arriveCodeinsufficient_credits
Balance below the estimated cost of the request. Top up (from $0.50 with direct Solana payments) — and watch the x-minirouter-balance-usd header, the low-balance signal every response carries. docs/errors#insufficient_credits →
Every API error string carries a URL resolving to /docs/errors.
Other coding agents and editors
- CodexTerminal and IDE coding agent
- CursorAI code editor
- ClineVS Code extension
- Roo CodeVS Code extension (archived upstream 2026-05-15)
- Kilo CodeVS Code extension
- OpenCodeTerminal agent
- ContinueVS Code / JetBrains extension
- AiderTerminal pair programmer
- LiteLLMProxy / SDK (feeds Aider, Open WebUI, and any LiteLLM client)
- ZedEditor