Skip to content
AnyRouter CLI

Any coding agent. One command.

Install the native anyr binary (alias ar), then launch Claude Code, Codex, or Grok Build through the AnyRouter gateway. One key, automatic failover, zero config files.

Installs anyr and ar into ~/.local/bin — no Node required

Browser PKCE or paste an sk-ar- key. anyr auth login works too.

anyr
✓ Signed in as you@anyrouter.dev
✓ Gateway reachable · 122 models · auto-failover
· Opening launcher…
01

How it routes

One CLI, any agent

Sign in once — by browser, pasted key, or device code for headless machines — then the CLI hands off to the real Claude Code, Codex, or Grok Build binary, which routes through the AnyRouter Gateway.

You install with curl | bash, then run anyr claude. The first time, it asks you to sign in once — by browser, by pasting a key, or with a device code for headless machines. It then launches the real Claude Code, Codex, or Grok Build binary, injecting the base URL, key, and model into that launcher only. The agent's own API calls land on the AnyRouter Gateway, which can reach any of 206+ models.
terminalanyr claudesign in onceAnyRouter CLIbrowser · paste · device codelauncherreal agent binaryClaude CodeCodexGrok BuildAPI requestsAnyRouter Gateway206+ models · auto-failover

One command. Sign in once. Any agent, any model, one gateway.

02

Launchers

Pick your agent

Install once with curl | bash, then one CLI wraps the agents you already use. The same stored key powers every launcher.

Claude Code

Anthropic-compatible

anyr claude --model z-ai/glm-5.2Setup guide

Codex

OpenAI-compatible

anyr codex --model anthropic/claude-sonnet-4.6 --effort xhighSetup guide

Grok Build

xAI Grok CLI

anyr grok --model auto --effort highSetup guide
03

In the terminal

What it looks like in use

Run any launcher with no flags for a guided menu — pick model, effort, and hub, then launch. Or pass flags and it skips straight through.

anyr
▲ AnyRouter

accountdefault sk-ar-v1-****…****

modelanyrouter/free

agentclaude

credits-

↑↓/jk move ↵ select q/esc quit

Sign in once — then every launcher reuses the same key

CLI docs

One gateway under every agent

The pieces the terminal is standing on — the catalog, the failover, the key handling.

Catalog

122+ models behind one --model flag

  • anthropic/claude-sonnet-4.6
  • openai/gpt-5.1-codex
  • z-ai/glm-5.2
  • google/gemini-3.1-pro
  • deepseek/deepseek-v4-flash
  • moonshotai/kimi-k3
  • x-ai/grok-4.5
  • mistralai/mistral-medium-3.5-128b
  • minimax/m3

Pass any id to --model, or auto to let a preset choose. Full list at /models.

Failover

Reroutes when a provider fails

On 429s and provider errors the gateway retries the next upstream — the agent never notices.

Security

Credentials never touch your shell

$ anyr claude

✓ key injected into the child process only

✓ no env vars or files left after exit

The launcher spawns the real agent binary with auth scoped to that process. Exit, and it's gone.

Launchers

Every agent, one spelling

  • anyr claude
  • anyr codex --model openai/gpt-5.1-codex
  • anyr claude --hub frontend-eng
  • anyr grok --effort high
  • anyr pi
  • anyr opencode
  • anyr skills sync --hub frontend-eng

One stored key powers every launcher — flags skip the menu, no flags open it.

04

Skills & Knowledge Hub

Load a hub straight into a session

A hub is your agent's context (skills, prompts, knowledge, and plugins) managed in the dashboard and pulled to any machine. Point a launcher at one and it syncs, shows you exactly what landed, then starts your agent with that context already in place.

SkillsPromptsKnowledgePlugins
anyr claude --hub my-hub
$anyr claude --hub my-hub
·Syncing my-hub from anyrouter.dev …
✓commit-style · skill ✓ clean
✓api-conventions · skill ✓ clean
✓prd-template · prompt ✓ clean
✓architecture.md · knowledge ✓ clean
⚠legacy-helper · skill ⚠ review · external fetch
✕untrusted-import · skill ✕ blocked · not synced
✓4 items written · 1 flagged · 1 blocked → ~/.anyrouter/hubs/my-hub
▶Launching Claude Code · --plugin-dir ~/.anyrouter/hubs/my-hub
·skills loaded as anyrouter-my-hub:commit-style, anyrouter-my-hub:api-conventions …
✓✓ ready — your agent starts with that context in place

Pick a hub, or let it list them

Pass --hub my-hub to load one directly, or run a launcher on its own and the CLI lists every hub you can see so you can pick one interactively.

Every item carries a scan verdict

Each skill, prompt, and doc is scanned for prompt injection before it can sync. Flagged items never reach your machine.

Loaded with --plugin-dir

The hub syncs to ~/.anyrouter/hubs/<slug> as a self-contained plugin, then launches with --plugin-dir pointed at it. Your ~/.claude/skills is never touched.

Browse skills & hubs
05

Everything else

Swap models, no config edits

Change --model and AnyRouter handles routing, failover, and billing. Per- project defaults live in anyrouter.yaml, checked in so the whole team gets the same setup.

terminalbash
# Swap models without touching config
anyr claude --model z-ai/glm-5.2
 
# Let a preset pick the model, set reasoning depth
anyr claude --model auto --effort high
 
# Same key works for Codex
anyr codex --model anthropic/claude-sonnet-4.6 --effort xhigh
anyrouter.yamlyaml
project root
# defaults for every launcher
default: @preset/coding-stack
effort: high
hub: my-hub
 
# per-launcher overrides
claude:
model: anthropic/claude-sonnet-4.6
 
codex:
model: z-ai/glm-5.2
effort: xhigh
 
# auto-failover on these statuses
fallback: [ 429, 401, 5xx ]

Your config follows you

Keys, presets, and hubs live in AnyRouter and load on any machine. Sign in and your whole setup is just there.

Clean exit, every time

Credentials live only in the agent's process. When it exits, they're gone, with no env vars or files left behind.

Interactive when you want it

No flags: arrow through models, effort, and hubs before launch. Pass flags: it skips straight through.

All keyboard, no mouse

↑↓ to navigate, ←→ to change, Enter to launch. Scriptable too.

First run: sign in once, choose a model, and the CLI launches the real agent binary with credentials injected only into that process.
  1. 01Sign in once
  2. 02Pick any model
  3. 03Launch the real agent

Try it in your terminal

Free to start. Install the binary, sign in once, then every coding session routes through AnyRouter.

Then run ar auth login and ar claude