Claude Code + minirouter

Environment variables for using Claude Code with MiniRouter's Anthropic-compatible Messages endpoint.

Base URLhttps://api.minirouter.sh/v1
Get a keyhttps://minirouter.sh/key
Get a key — no account

Settings

Shell environment, or env in ~/.claude/settings.json

In order

  1. ANTHROPIC_BASE_URLhttps://api.minirouter.sh

    Use the bare host. Claude Code adds /v1/messages itself.

  2. ANTHROPIC_AUTH_TOKEN$MINIROUTER_KEY

    Claude Code sends this value as a Bearer token.

  3. ANTHROPIC_MODELzai/glm-5.3-flash

    Use the full ID of a tool-capable model from the live catalog.

Shell
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 →

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 MiniRouter
    Codeclient-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 rejected
    Codeunknown_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 request
    Codeinvalid_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 arrive
    Codeinsufficient_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

Agent setup: /setup · API reference: /docs