CLIProxyAPI alternatives for Codex and Claude Code
AutoRouter9 min read
Use AutoRouter, the Mac app for Codex and Claude Code, if you want your subscriptions in your coding agents without running a proxy: it pools the Claude, ChatGPT, Grok and Gemini plans you already pay for across Codex and Claude Code with no local server, config file or keys. It shows up in the model picker, adds 20+ models, sends each task to the model that fits, and moves to the account with the most room left when one hits its limit. CLIProxyAPI is an open-source proxy server you install and run yourself; it exposes OpenAI, Gemini, Claude, Codex and Grok-compatible API endpoints backed by CLI account sign-ins. Claude Code Router, LiteLLM, OpenRouter and Kong AI Gateway cover the other jobs people use it for.
AutoRouter wrote this post, and it competes with every tool below. Each claim about another product comes from that product's own docs or repository, linked where it is used and read on November 17, 2026 unless the sentence says otherwise.
What is CLIProxyAPI?
CLIProxyAPI is a proxy server, written in Go and MIT licensed, that serves OpenAI (including Responses), Gemini and Claude-compatible API endpoints from the accounts you sign in to with coding CLIs (README). Any client or SDK that speaks one of those formats can point at it, including Claude Code and Codex. It is busy: version 8.0.76 shipped on November 17, 2026, and the repository had about 58,800 GitHub stars that day.
- Sign-ins it supports: OAuth for Codex, Claude Code and Grok Build, plus Gemini API, AI Studio, Vertex AI, Gemini CLI and Antigravity accounts, Kimi, Muse Code and Devin, as its README lists them.
- Several accounts at once: round-robin load balancing across multiple Gemini, OpenAI, Claude and Grok accounts, with a
fill-firststrategy as the other option (configuration). - Other upstreams: any OpenAI-compatible provider, such as OpenRouter, added in the config file.
- Extras: a Management API, a plugin system, a Go SDK for embedding the proxy, and a desktop client, EasyCLIProxyAPI, with a configuration UI and one-click start and stop.
Out of the box, CLIProxyAPI chooses among accounts: it picks which signed-in credential serves a request for the model your client names, rotating through accounts or filling one first. Picking a model for each task is left to your client or a plugin. What is an LLM router? explains the kinds of routers these tools are built on.
How do you install and run CLIProxyAPI?
Install the server, sign in to each account, then point each coding agent at it. The quick start offers Homebrew on macOS, an installer script or the AUR on Linux, a release download or the desktop app on Windows, a Docker image, or a build from source with go build. On a Mac:
- Install and start the service with
brew install cliproxyapiandbrew services start cliproxyapi. Its config file is$(brew --prefix)/etc/cliproxyapi.conf. - Set
api-keysin the config: these are the keys your coding agents send to the proxy. It listens on port 8317 unless you changeport. - Sign in to each account with its login flag, such as
--codex-loginor--claude-login(Docker guide). - Point each agent at
http://127.0.0.1:8317, as below.
For Claude Code, CLIProxyAPI's Claude Code guide sets two variables in ~/.claude/settings.json (its full example adds timeouts and other settings):
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "<your_api_key>",
"ANTHROPIC_BASE_URL": "http://127.0.0.1:8317"
}
}
For Codex, its Codex guide adds a [model_providers.cliproxyapi] table to ~/.codex/config.toml with base_url = "http://127.0.0.1:8317/v1" and wire_api = "responses". While ANTHROPIC_AUTH_TOKEN is set, it replaces your claude.ai login in Claude Code (Anthropic docs).
What do you run and maintain with CLIProxyAPI?
You run the whole thing: the server process, its config file, its API keys, the folder of account sign-ins, and every update. CLIProxyAPI's docs leave these to you:
- Keeping it running, with
brew services,systemctl --useror Docker, on each machine that uses it. - Who can reach it. The example config leaves
hostempty, which binds every network interface; set it to127.0.0.1to keep it on your machine, and set a management key if you use the Management API (configuration). - The sign-ins, stored in
auth-dir(~/.cli-proxy-apiby default), one login per account. - Usage tracking. Since version 6.10.0, CLIProxyAPI ships no built-in usage statistics and points to separate community tools (README).
- Updates. New releases ship often; you install them through Homebrew, the AUR or a new Docker image, while the EasyCLIProxyAPI desktop client updates itself (README).
How is AutoRouter different from CLIProxyAPI?
AutoRouter has no server for you to run and no keys or config to write: you sign in to your plans in a Mac app, and it shows up in the model picker you already use. AutoRouter, the Mac app for Codex and Claude Code, adds 20+ frontier and open-weight models to both apps. Choose a model to send requests straight to it, or choose AutoRouter and it works out how hard each task is: hard work gets the strongest model your plans cover, and quick work doesn't burn the plan.
- Download AutoRouter for macOS from autorouter.com.
- Open it, sign in or create a free account, sign in to your plans, allow Accessibility, and click Enable for each app.
- Start a new session and choose AutoRouter as the model: in Codex, from the model menu under the message box; in Claude Code, with
/model.
Enabling an app adds AutoRouter to its own settings (Codex's config.toml, Claude Code's settings.json) after saving a copy of each file, and disabling it in AutoRouter switches it back. Connect Claude, ChatGPT, Grok and Gemini plans, and any of them can run in either app, so your Claude plan works inside Codex and your ChatGPT plan inside Claude Code. When one account reaches its limit, AutoRouter moves on to the account with the most room left before it spends any credit.
Free costs $0 a month and connects two subscriptions. Pro costs $50 a month with $20 of included usage each month, connects any number of plans and adds every other model at the provider's price plus 10%. New accounts get Pro free for their first month, or until $20 of usage is spent, whichever comes first.
The trade-offs are real. CLIProxyAPI is open source, costs nothing to download, runs on macOS, Linux and Windows, and keeps requests between your machine and each provider. AutoRouter runs on macOS 14 or later, and its requests pass through AutoRouter's servers on their way to each provider; it doesn't store transcripts, but keeps the message that opens each request, up to 4,000 characters, to review routing (AutoRouter privacy).
Which other CLIProxyAPI alternatives are there?
Four more tools cover what people use CLIProxyAPI for, each best at one job:
- Claude Code Router is best if you want a local gateway with routing rules you write. It is an MIT-licensed gateway on your own machine that sends Claude Code, Codex and other agents to the providers and models you choose, with your API keys or an imported local sign-in (GitHub, read November 16, 2026). Claude Code Router alternatives compares it in depth.
- LiteLLM is best for a platform team that wants one self-hosted gateway, with virtual keys, budgets and logs. It calls 100+ LLMs in the OpenAI format, and its Claude Code tutorial needs version 1.81.14 or later with PostgreSQL (GitHub, tutorial, read November 16, 2026). LiteLLM alternatives covers the self-hosted field.
- OpenRouter is best for one prepaid balance across hundreds of models with nothing to run. Claude Code connects with three environment variables, and OpenRouter charges a 5.5% fee on credit purchases on its Standard plan (guide, pricing, read November 16, 2026). OpenRouter alternatives compares the hosted options.
- Kong AI Gateway is best for a company that already runs Kong. It proxies Claude Code, Codex CLI and Qwen Code CLI to providers to log requests, track costs across teams and enforce rate limits (Kong docs). Its Claude Code tutorial needs a Kong Konnect personal access token,
kongctland an Anthropic API key (tutorial).
They differ most in where they run and what pays for requests:
| Tool | What it is | Runs where | What pays | Setup |
|---|---|---|---|---|
| CLIProxyAPI | Proxy that serves API endpoints from CLI sign-ins | Your machine or server | The accounts you sign in to, or upstream keys | Install, config.yaml, log in each account, point each agent |
| AutoRouter | Mac app that adds 20+ models and picks one per task | A Mac app on each machine | Your Claude, ChatGPT, Grok and Gemini plans first; Pro usage for other models | Install, sign in to plans, click Enable |
| Claude Code Router | Local gateway with rules you write | Your machine | Your API keys or imported sign-ins | Add providers and keys, write rules |
| LiteLLM | Self-hosted gateway for a team | Your servers | Your provider keys | Proxy with PostgreSQL, virtual keys |
| OpenRouter | Hosted API for hundreds of models | OpenRouter's cloud | OpenRouter credits, 5.5% fee on purchases | API key and three variables |
| Kong AI Gateway | Gateway for a company's AI traffic | Konnect control plane, your data plane | Your provider keys | Konnect token, kongctl, provider and model entities |
Questions
Does CLIProxyAPI work with Claude Code and Codex?
Yes. Its docs set Claude Code's ANTHROPIC_BASE_URL to the proxy and add it to Codex as a model provider with wire_api = "responses" (Claude Code guide, Codex guide). It also documents OpenCode, Droid, Grok Build and Pi.
What port does CLIProxyAPI use?
Port 8317, set by port in its config file. The example config binds every network interface while host is empty, so set host: "127.0.0.1" to accept requests only from your own machine (configuration).
Does AutoRouter need a local server?
No. AutoRouter is a Mac app: you sign in to your plans, click Enable for each app, and pick AutoRouter with /model in Claude Code or from the model menu in Codex. There are no keys or endpoints to set up.
Does AutoRouter work with OpenCode?
Not yet. OpenCode and Pi support in AutoRouter are coming soon. Today it works with Codex (the app and the CLI), the Claude Code CLI, Cursor, Claude Desktop, T3 and Terminal.
Sources
- AutoRouter
- AutoRouter privacy
- CLIProxyAPI on GitHub, read November 17, 2026
- CLIProxyAPI: quick start, read November 17, 2026
- CLIProxyAPI: basic configuration, read November 17, 2026
- CLIProxyAPI: run with Docker, read November 17, 2026
- CLIProxyAPI: Claude Code, read November 17, 2026
- CLIProxyAPI: Codex, read November 17, 2026
- EasyCLIProxyAPI on GitHub, read November 17, 2026
- Claude Code: LLM gateways
- Claude Code Router on GitHub, read November 16, 2026
- LiteLLM on GitHub, read November 16, 2026
- LiteLLM: Claude Code with a Claude subscription, read November 16, 2026
- OpenRouter: Claude Code integration, read November 16, 2026
- OpenRouter pricing, read November 16, 2026
- Kong: proxy AI CLI tools through AI Gateway, read November 17, 2026
- Kong: route Claude CLI traffic through AI Gateway and Anthropic, read November 17, 2026