How to Unify AI Subscriptions with AnyRouter

Put your Z-AI, Kimi, OpenAI, and Anthropic accounts behind one AnyRouter preset and launch Claude Code through it.

Create one preset (coding-stack) that layers your provider accounts, with AnyRouter credits as a last-resort backup. Your tools use a single model name; AnyRouter handles provider choice, fallback, and logs.

With model selection auto, AnyRouter picks the highest-priority healthy model in the preset, then moves down the order:

SourceExample model
Z-AI keyz-ai/glm-4.7-flash
Moonshot Kimi keymoonshotai/kimi-k2.5
Anthropic keyanthropic/claude-sonnet-4-6
OpenAI keyopenai/gpt-5.4-mini
AnyRouter creditsany supported model (paid fallback)
  1. Create an sk-ar- key in Dashboard → Keys. It is the only key your tools need; provider keys stay in AnyRouter as BYOK credentials.

  2. In Dashboard → Presets, create a preset with name Coding stack, slug coding-stack, mode fallback (fixed order) or weighted (traffic sharing), model selection auto, and paid fallback on if you want credits to cover outages or exhausted BYOK quota. Add models in the order to try:

    {
      "models": [
        "z-ai/glm-4.7-flash",
        "moonshotai/kimi-k2.5",
        "anthropic/claude-sonnet-4-6",
        "openai/gpt-5.4-mini"
      ],
      "temperature": 0.2,
      "provider": { "allow_fallbacks": true }
    }
  3. On each model row, choose a source or click Add provider account: pick the provider, paste its key, add an alias (such as zai-personal), and save to validate. AnyRouter stores it encrypted as a BYOK source attached to this preset.

  4. Call the preset as the model (@preset/coding-stack also works). A rate-limited, unhealthy, or out-of-quota source falls through to the next:

    curl https://anyrouter.dev/api/v1/chat/completions \
      -H "Authorization: Bearer sk-ar-your-key" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "coding-stack",
        "messages": [{"role": "user", "content": "Review this patch"}]
      }'
  5. Launch tools through the CLI. The first run lets you paste the key or log in at anyrouter.dev, and saves ~/.anyrouter/config.yaml:

    curl -fsSL https://anyrouter.dev/cli.sh | bash
    anyr claude
    anyr codex
    anyr opencode

    The pinned @preset/coding-stack with auto applies by default. Override per session with --model (a concrete id bypasses auto) and --effort (low to max); anything after -- goes to the tool:

    anyr claude --model auto --effort high
    anyr codex --effort xhigh

    See the AnyRouter CLI reference.

Use BYOK when you already have provider credits, contracts, or special limits, and AnyRouter credits as the backup. Most teams run BYOK first and paid fallback second.

AnyRouter routes requests to third-party models. Models and outputs are provided as is, with no warranty; you use them at your own risk. Disclaimer