Run every coding agent through one URL
Claude Code, Codex, OpenCode, Cursor, and other OpenAI-compatible tools share 209+ models, one balance, and one request log.
The problem
What this is for
Each coding agent wants its own provider key and base URL. Switching models or comparing cost means editing every tool separately.
What to do
Three steps, then copy
- 1.Mint one AnyRouter key.
- 2.Set Anthropic env vars for Claude Code, and OpenAI env vars for Codex, Cursor, and similar tools.
- 3.Start on anyrouter/auto so failover picks a model that is answering.
export ANTHROPIC_BASE_URL="https://anyrouter.dev/api"
export ANTHROPIC_API_KEY="$ANYROUTER_API_KEY"export OPENAI_BASE_URL="https://anyrouter.dev/api/v1"
export OPENAI_API_KEY="$ANYROUTER_API_KEY"anyr opencodeReady to try it
The guide has the full walkthrough. Sign up if you still need a key.
Related
Next playbooks
Run Claude Code through AnyRouter
Install the anyr CLI, then anyr claude — it injects the base URL, key, and model. Env vars are the fallback if you already run claude yourself.
OpenGrok Bot + Herdr + Anyr CLI coding loop
A live coding agent on a repo checkout: Grok Bot assigns the goal, Herdr shows the box, and the anyr CLI launches Claude Code through AnyRouter.
OpenRun OpenCode through AnyRouter
One CLI command injects an AnyRouter provider for the session, or add a custom provider in opencode.json — one key, the Chat Completions catalog, and request logs.
Open