One gatewayCoding agents
Use any coding agent with one key
Claude Code, Codex, OpenCode, Cursor, and other OpenAI-compatible tools share 406+ models, one balance, and one request log.
Set it up
Claude Code
$ export ANTHROPIC_BASE_URL="https://anyrouter.dev/api"$ export ANTHROPIC_API_KEY="$ANYROUTER_API_KEY"
- 1.Mint one AnyRouter key. If you hold provider keys, add them once on /byok.
- 2.Set the Anthropic env vars for Claude Code and the OpenAI env vars for Codex. Cursor and other tools take the same URL and key in their OpenAI-compatible model settings.
- 3.Start on anyrouter/auto so failover picks a model that is answering, or anyrouter/coding to run only on your own keys.
Why use this
Each coding agent wants its own provider key and base URL. Switching models or comparing cost means editing every tool separately.
Other ways to set it up
Codex
export OPENAI_BASE_URL="https://anyrouter.dev/api/v1"
export OPENAI_API_KEY="$ANYROUTER_API_KEY"OpenCode
anyr opencodeCursor
Cursor settings → Models → OpenAI-compatible custom model
Base URL: https://anyrouter.dev/api/v1
API key: your sk-ar- key
Model: anyrouter/codingEndpoints and key
- OpenAI-compatible
- https://anyrouter.dev/api/v1
- Anthropic-compatible
- https://anyrouter.dev/api
- Key
- ANYROUTER_API_KEY (sk-ar-…)
Using your own provider keys? Add each one once, then call anyrouter/byok. Bring your keys →