Beta
Discord Download

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.

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:

  1. Install and start the service with brew install cliproxyapi and brew services start cliproxyapi. Its config file is $(brew --prefix)/etc/cliproxyapi.conf.
  2. Set api-keys in the config: these are the keys your coding agents send to the proxy. It listens on port 8317 unless you change port.
  3. Sign in to each account with its login flag, such as --codex-login or --claude-login (Docker guide).
  4. 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:

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.

  1. Download AutoRouter for macOS from autorouter.com.
  2. Open it, sign in or create a free account, sign in to your plans, allow Accessibility, and click Enable for each app.
  3. 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:

They differ most in where they run and what pays for requests:

ToolWhat it isRuns whereWhat paysSetup
CLIProxyAPIProxy that serves API endpoints from CLI sign-insYour machine or serverThe accounts you sign in to, or upstream keysInstall, config.yaml, log in each account, point each agent
AutoRouterMac app that adds 20+ models and picks one per taskA Mac app on each machineYour Claude, ChatGPT, Grok and Gemini plans first; Pro usage for other modelsInstall, sign in to plans, click Enable
Claude Code RouterLocal gateway with rules you writeYour machineYour API keys or imported sign-insAdd providers and keys, write rules
LiteLLMSelf-hosted gateway for a teamYour serversYour provider keysProxy with PostgreSQL, virtual keys
OpenRouterHosted API for hundreds of modelsOpenRouter's cloudOpenRouter credits, 5.5% fee on purchasesAPI key and three variables
Kong AI GatewayGateway for a company's AI trafficKonnect control plane, your data planeYour provider keysKonnect 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