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:
| Source | Example model |
|---|---|
| Z-AI key | z-ai/glm-4.7-flash |
| Moonshot Kimi key | moonshotai/kimi-k2.5 |
| Anthropic key | anthropic/claude-sonnet-4-6 |
| OpenAI key | openai/gpt-5.4-mini |
| AnyRouter credits | any supported model (paid fallback) |
-
Create an
sk-ar-key in Dashboard → Keys. It is the only key your tools need; provider keys stay in AnyRouter as BYOK credentials. -
In Dashboard → Presets, create a preset with name
Coding stack, slugcoding-stack, modefallback(fixed order) orweighted(traffic sharing), model selectionauto, 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 } } -
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. -
Call the preset as the model (
@preset/coding-stackalso 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"}] }' -
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 opencodeThe pinned
@preset/coding-stackwithautoapplies by default. Override per session with--model(a concrete id bypasses auto) and--effort(lowtomax); anything after--goes to the tool:anyr claude --model auto --effort high anyr codex --effort xhighSee 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