Skip to content

The anyr CLI

Launch Claude Code, opencode or Codex through AnyRouter with one key and automatic failover.

Install · macOS and Linux
curl -fsSL https://anyrouter.dev/setup.sh | bash
Log in and run
anyr login
anyr claude

Installs anyr and ar into ~/.local/bin. No Node required. Windows is not supported yet.

Use your coding agent through AnyRouter

  • Claude Code
    anyr claude --model anyrouter/auto

    Launch Claude Code routed through AnyRouter. anyrouter/auto picks from top models and fails over.

  • opencode
    anyr opencode --model anyrouter/free

    Launch opencode routed through AnyRouter. anyrouter/free stays on $0 models.

  • Codex
    anyr codex --model anyrouter/auto

    Launch Codex routed through AnyRouter. Same key, same presets.

How it works

  1. 01

    Log in

    anyr login opens your browser. Over SSH it switches to a device code.

  2. 02

    Key saved

    The CLI gets a key and stores it locally, in the OS keychain by default.

  3. 03

    Agent launched

    anyr claude, anyr opencode or anyr codex starts the real agent pointed at AnyRouter.

First time? Run anyr login