All use cases
Codex
Run Codex through AnyRouter
anyr codex signs you in, stores one sk-ar- key, and launches Codex against AnyRouter's OpenAI-compatible endpoint.
What this is for
Codex expects an OpenAI key and base URL. Using other models or one balance across tools means editing its environment by hand.
Steps, then copy
- 1.Install the anyr CLI.
- 2.Run anyr codex. First run signs you in or pastes an sk-ar- key.
- 3.Pin a model or effort with --model and --effort. Anything after -- goes to Codex.
anyr CLI
bash
curl -fsSL https://anyrouter.dev/setup.sh | bash
anyr codexEnv wrapper
bash
export OPENAI_BASE_URL="https://anyrouter.dev/api/v1"
export OPENAI_API_KEY="$ANYROUTER_API_KEY"Ready to try it
The guide has the full walkthrough. Sign up if you still need a key.
Next playbooks
- Run Claude Code through AnyRouterInstall 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.
- Run every coding agent through one URLClaude Code, Codex, OpenCode, Cursor, and other OpenAI-compatible tools share 271+ models, one balance, and one request log.
- Run OpenCode through AnyRouterOne 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.