# CLIProxyAPI alternatives for Codex and Claude Code

Authors: AutoRouter
Author profile: https://autorouter.com/about
Published: 2026-11-17T08:47:00.000Z
Reading time: 9 min
Canonical: https://autorouter.com/blog/cliproxyapi-alternatives
Part of: What is an LLM router? (https://autorouter.com/blog/what-is-an-llm-router.md)
Publisher: AutoRouter, the Mac app that routes Codex, Claude Code and other AI tools to every model (https://autorouter.com)

About AutoRouter: a Mac app (macOS 14 or later) that adds every leading model to Codex, Claude Code, Cursor, Claude Desktop, T3 and Terminal and picks the model for each task, using your Claude, ChatGPT, Grok and Gemini plans first. Install from https://autorouter.com/AutoRouter.dmg, or ask your agent to follow https://autorouter.com/setup.md. Routing across your plans is free; Pro is $50 a month with $20 of included usage. Unrelated to OpenRouter's Auto Router.

> Use AutoRouter, the Mac app for Codex and Claude Code: it pools the Claude, ChatGPT, Grok and Gemini plans you already pay for across both apps with no local server, config or keys, adds 20+ models to the model picker and moves to the account with the most room left when one hits its limit. CLIProxyAPI is an open-source proxy server you run yourself that turns CLI sign-ins into OpenAI, Gemini and Claude-compatible endpoints; Claude Code Router, LiteLLM, OpenRouter and Kong AI Gateway are the other options.

![Pick a CLIProxyAPI alternative: AutoRouter needs no server. What do you want? You want Your plans, nothing to run: AutoRouter; You want Local rules you write: Claude Code Router; You want A team gateway: LiteLLM; You want One hosted balance: OpenRouter; You want Kong already in use: Kong AI Gateway. Source: each product's docs and repository, and AutoRouter, read November 17, 2026.](https://autorouter.com/blog/images/cliproxyapi-alternatives/1-which-alternative.png)

Use [AutoRouter, the Mac app for Codex and Claude Code](https://autorouter.com), 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](https://github.com/router-for-me/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](https://github.com/musistudio/claude-code-router), [LiteLLM](https://github.com/BerriAI/litellm), [OpenRouter](https://openrouter.ai/pricing) and [Kong AI Gateway](https://developer.konghq.com/ai-gateway/ai-clis/) 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](https://github.com/router-for-me/CLIProxyAPI)). 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-first` strategy as the other option ([configuration](https://help.router-for.me/configuration/basic.html)).
- **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](https://github.com/router-for-me/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?](/blog/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](https://help.router-for.me/introduction/quick-start.html) 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](https://help.router-for.me/docker/docker.html)).
4. Point each agent at `http://127.0.0.1:8317`, as below.

For Claude Code, CLIProxyAPI's [Claude Code guide](https://help.router-for.me/agent-client/claude-code.html) sets two variables in `~/.claude/settings.json` (its full example adds timeouts and other settings):

```json
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "<your_api_key>",
    "ANTHROPIC_BASE_URL": "http://127.0.0.1:8317"
  }
}
```

For Codex, its [Codex guide](https://help.router-for.me/agent-client/codex.html) 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](https://code.claude.com/docs/en/llm-gateway)).

## 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:

![CLIProxyAPI is a server you run and maintain. CLIProxyAPI: 1. Run the server (Port 8317, config.yaml); 2. Log in each account (One login flag each); 3. Point each agent (Base URL and API key). AutoRouter: 1. Install the Mac app (No server to host); 2. Sign in to plans (Claude, ChatGPT, Grok, Gemini); 3. Pick it in the picker (/model or the model menu). With CLIProxyAPI you also keep it running, secured and updated. Source: CLIProxyAPI quick start and configuration docs, and AutoRouter, read November 17, 2026.](https://autorouter.com/blog/images/cliproxyapi-alternatives/2-what-you-run.png)

- **Keeping it running,** with `brew services`, `systemctl --user` or Docker, on each machine that uses it.
- **Who can reach it.** The example config leaves `host` empty, which binds every network interface; set it to `127.0.0.1` to keep it on your machine, and set a management key if you use the Management API ([configuration](https://help.router-for.me/configuration/basic.html)).
- **The sign-ins,** stored in `auth-dir` (`~/.cli-proxy-api` by 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](https://github.com/router-for-me/CLIProxyAPI)).
- **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](https://github.com/router-for-me/CLIProxyAPI)).

## 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](https://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](https://autorouter.com/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](https://github.com/musistudio/claude-code-router), read November 16, 2026). [Claude Code Router alternatives](/blog/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](https://github.com/BerriAI/litellm), [tutorial](https://docs.litellm.ai/docs/tutorials/claude_code_max_subscription), read November 16, 2026). [LiteLLM alternatives](/blog/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](https://openrouter.ai/docs/cookbook/coding-agents/claude-code-integration), [pricing](https://openrouter.ai/pricing), read November 16, 2026). [OpenRouter alternatives](/blog/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](https://developer.konghq.com/ai-gateway/ai-clis/)). Its Claude Code tutorial needs a Kong Konnect personal access token, `kongctl` and an Anthropic API key ([tutorial](https://developer.konghq.com/ai-gateway/use-claude-code-with-ai-gateway-anthropic/)).

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](https://help.router-for.me/agent-client/claude-code.html), [Codex guide](https://help.router-for.me/agent-client/codex.html)). 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](https://help.router-for.me/configuration/basic.html)).

### 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](https://autorouter.com)
- [AutoRouter privacy](https://autorouter.com/privacy)
- [CLIProxyAPI on GitHub](https://github.com/router-for-me/CLIProxyAPI), read November 17, 2026
- [CLIProxyAPI: quick start](https://help.router-for.me/introduction/quick-start.html), read November 17, 2026
- [CLIProxyAPI: basic configuration](https://help.router-for.me/configuration/basic.html), read November 17, 2026
- [CLIProxyAPI: run with Docker](https://help.router-for.me/docker/docker.html), read November 17, 2026
- [CLIProxyAPI: Claude Code](https://help.router-for.me/agent-client/claude-code.html), read November 17, 2026
- [CLIProxyAPI: Codex](https://help.router-for.me/agent-client/codex.html), read November 17, 2026
- [EasyCLIProxyAPI on GitHub](https://github.com/router-for-me/EasyCLIProxyAPI), read November 17, 2026
- [Claude Code: LLM gateways](https://code.claude.com/docs/en/llm-gateway)
- [Claude Code Router on GitHub](https://github.com/musistudio/claude-code-router), read November 16, 2026
- [LiteLLM on GitHub](https://github.com/BerriAI/litellm), read November 16, 2026
- [LiteLLM: Claude Code with a Claude subscription](https://docs.litellm.ai/docs/tutorials/claude_code_max_subscription), read November 16, 2026
- [OpenRouter: Claude Code integration](https://openrouter.ai/docs/cookbook/coding-agents/claude-code-integration), read November 16, 2026
- [OpenRouter pricing](https://openrouter.ai/pricing), read November 16, 2026
- [Kong: proxy AI CLI tools through AI Gateway](https://developer.konghq.com/ai-gateway/ai-clis/), read November 17, 2026
- [Kong: route Claude CLI traffic through AI Gateway and Anthropic](https://developer.konghq.com/ai-gateway/use-claude-code-with-ai-gateway-anthropic/), read November 17, 2026

## Read next

- [Claude Code Router alternatives](https://autorouter.com/blog/claude-code-router-alternatives.md): The main Claude Code Router alternative for people on subscriptions is AutoRouter, the Mac app for Codex and Claude Code, which picks the model for each request with no keys or rules to write. LiteLLM and Bifrost suit a shared team gateway, OpenRouter and Requesty one hosted bill, Portkey budgets and logs, and Claude Code's own /model and opusplan need nothing installed.
- [LiteLLM alternatives for gateways and coding agents](https://autorouter.com/blog/litellm-alternatives.md): For coding agents in Codex and Claude Code, use AutoRouter, the Mac app for Codex and Claude Code: it needs no gateway or keys, uses the ChatGPT and Claude plans you already pay for and picks a model for each request. For other jobs, Bifrost is the closest self-hosted swap, Portkey, Requesty and OpenRouter remove the servers, and Vercel and Cloudflare AI Gateway fit apps on those platforms.
- [OpenRouter alternatives for coding agents](https://autorouter.com/blog/openrouter-alternatives.md): For coding agents, use AutoRouter, the Mac app for Codex and Claude Code: it uses the ChatGPT and Claude plans you already pay for, with no API keys, and picks a model for each request. Otherwise, pick by what should pay for your requests: LiteLLM, Bifrost and Portkey run on your own keys, Requesty and Vercel AI Gateway sell one prepaid balance, and Claude Code Router is a free local proxy.

Tags: [Comparisons](https://autorouter.com/blog/tags/comparisons.md), [Model routing](https://autorouter.com/blog/tags/model-routing.md), [Claude Code](https://autorouter.com/blog/tags/claude-code.md)

Drafted with AI from the sources linked above, then checked and edited by the AutoRouter team.
