Your plans in every picker, no proxy to run
AutoRouter connects your Claude and ChatGPT plans directly and puts frontier and open-weight models in the Codex and Claude Code pickers, with no proxy, YAML or keys, and picks one for each turn. One prompt to your coding agent switches you over.
config.yaml
port8317auth-dir~/.cli-proxy-apiclaude-api-keysk-ant-…4d2copenai-compatibilityopenrouter, sk-or-…b780
2keys
AutoRouter
Picks a model for each turnClaude Opus 5.5Claude plan
GPT-6.2 SolChatGPT plan
Kimi K3.1 ProPro
0keys
See what carries over
Hand this prompt to your coding agent. It reads your config.yaml on your Mac, stops the proxy, switches you over and keeps a backup. Compare the two
Paste it into Claude Code or Codex. It switches you over, carries your rules across and keeps a backup of your old config. It never prints a key.
Switch me from CLIProxyAPI to AutoRouter now. Don't ask whether to; I want it done.
1. Read how Claude Code and Codex reach CLIProxyAPI today: the env block in ~/.claude/settings.json, any .claude/settings.json or .claude/settings.local.json in this project, ANTHROPIC_* lines (exports, aliases and functions) in my shell profiles (~/.zshrc, ~/.zprofile, ~/.bashrc, ~/.bash_profile, ~/.config/fish/config.fish), and [model_providers.*] in ~/.codex/config.toml. Find CLIProxyAPI's config.yaml: the --config in its running command (ps -ax | grep -i cli-proxy-api), the folder it runs from, ~/.cli-proxy-api/config.yaml, or Homebrew's /opt/homebrew/etc/cliproxyapi.conf (/usr/local/etc on Intel). Read its port (port, or server.port in version 8's layout), its client keys (api-keys, or access.api-keys), and its upstream providers with their base URLs, models and aliases (claude-api-key, codex-api-key, gemini-api-key and openai-compatibility, or the groups under api-keys in version 8). List the sign-in files in its auth-dir (~/.cli-proxy-api by default) by name only; never open them, since they hold sign-in tokens. Mask every API key to its last four characters before any output reaches this chat, wherever it sits in a line: an alias or a one-line command can set one mid-line, so filter every file you read and never cat or grep one raw. Never print, copy or send a full key.
2. Back up before changing anything: copy each of ~/.claude/settings.json, ~/.codex/config.toml and ~/.codex/auth.json that exists to the same path with .backup-$(date +%Y%m%d) added. Copy config.yaml beside itself with .backup-$(date +%Y%m%d) added, and leave the auth-dir as it is. Delete nothing.
3. Hand over before AutoRouter writes any settings, so the old setup can't fight it. In ~/.claude/settings.json, remove only these keys from the env block, with jq or python3 and without printing the file: ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY, ANTHROPIC_CUSTOM_HEADERS, ANTHROPIC_MODEL, ANTHROPIC_SMALL_FAST_MODEL, CLAUDE_CODE_SUBAGENT_MODEL and every ANTHROPIC_DEFAULT_*_MODEL; also the top-level "model" if it names a model rather than an alias like opus or sonnet. That is your one edit to that file, and the backup undoes it. For the same variables in a project's .claude settings or in my shell profiles, show me each line with its file and line number to remove; don't edit those files. Stop CLIProxyAPI: brew services stop cliproxyapi if Homebrew runs it, docker stop its container (or docker compose down in its folder) if Docker does, otherwise kill the cli-proxy-api process on its port (8317 by default). If ~/.codex/auth.json holds only a placeholder key for the proxy, such as sk-dummy, have me run `codex login` and sign in with ChatGPT. Leave the [model_providers.cliproxyapi] table: AutoRouter replaces Codex's model and model_provider itself. Then I open a new terminal so the old variables are gone.
4. Set up AutoRouter now by following https://autorouter.com/setup.md, with its rules: I do every sign-in in the browser, you never ask for a password or use sudo, and from here on you never edit ~/.claude/settings.json or ~/.codex/config.toml.
5. Carry my setup over. Get AutoRouter's models: curl -sH "Accept: text/markdown" https://autorouter.com/models. Map each of my models to the AutoRouter model that covers it; a newer version of the same family counts. Write a plain-English rule only for a model setting that says what the model is for: the Opus or subagent model as "Use Kimi K3.1 Pro for planning and reasoning.", the Haiku or small, fast model as "Use DeepSeek V4.1 Flash for background tasks." AutoRouter picks a model for each turn, so the main model and the Sonnet slot need no rule. List the rules for me to add in the AutoRouter app: Routing, then Add a rule. Local models (localhost, Ollama) stay where they are.
6. Finish with setup.md's confirm step, then a short summary: models carried over, rules to add, keys I no longer need, where the backups are, and how to go back (disable each app in AutoRouter's settings, then copy the backups back over ~/.claude/settings.json, ~/.codex/config.toml and ~/.codex/auth.json, start CLIProxyAPI again, and add back the shell lines I removed).
Questions
What people ask before they switch.
What does CLIProxyAPI do well?
It turns Claude, ChatGPT, Gemini and other subscription sign-ins into OpenAI, Anthropic, Gemini and Responses endpoints, balancing across several accounts and API keys with routing strategies and a management API. It’s one free binary that runs anywhere, through Homebrew or Docker.
When should I keep CLIProxyAPI?
Keep it on Windows or Linux, to share sign-ins with other tools and servers, or to pool accounts behind one endpoint you run yourself. AutoRouter runs on macOS 14 or later inside your coding tools. Free connects two subscriptions and Pro connects any number.
Why is there no paste box?
CLIProxyAPI’s config is YAML, and this page reads JSON, TOML and environment variables only. The prompt has your coding agent read config.yaml on your Mac instead, and mask every key to its last four characters before anything reaches the chat. Its sign-in files are listed by name and never opened.
What happens to my sign-ins?
AutoRouter connects your Claude and ChatGPT plans itself: you sign in once in its app, and it uses those plans first. CLIProxyAPI’s sign-in files stay where they are, so going back is a restart away.
What happens to local models and models AutoRouter doesn’t carry?
A model served on your machine stays where it is. Models are matched by name, ignoring vendor prefixes and snapshot dates, and an older model counts as the newer one AutoRouter carries in its line. Keep the key for any model that isn’t in the list.
Does AutoRouter run on Windows or Linux?
Not yet. AutoRouter is a Mac app for macOS 14 or later. It works in Codex, the Claude Code CLI, Cursor, Claude Desktop, T3 and Terminal.
What does AutoRouter cost?
Free is $0 a month and connects two subscriptions. Pro is $50 a month with $20 of usage included each month, connects any number of subscriptions and adds every other model. New accounts get a week of Pro, or until $20 of usage is spent.