Rust rewrite of CLIProxyAPI: drop-in compatible proxy for Claude, Codex, Gemini and OpenAI-compatible providers
Rust
0
587 commits
updated Oct 3, 2026
cliproxy-rs is a small server you run on your own computer. It lets your coding tools, such as Claude Code, Codex CLI or Cursor, use the AI subscriptions and API keys you already have, like a Claude Max plan or a ChatGPT plan, through one local address. A dashboard built into it shows which accounts work, how much of each plan's limits is left, and how to connect each tool.
It is a Rust rewrite of CLIProxyAPI. It reads the same config.yaml and the same account files, so you can switch between the two in either direction.
Run one command. On macOS or Linux:
curl -fsSL https://raw.githubusercontent.com/vayungodara/cliproxy-rs/master/install.sh | sh
On Windows, in PowerShell:
irm https://raw.githubusercontent.com/vayungodara/cliproxy-rs/master/install.ps1 | iex
It installs the latest release after checking its checksum, writes a config with new keys to ~/.cliproxy-rs, starts the proxy in the background and opens the dashboard in your browser. The keys stay in ~/.cliproxy-rs/keys.env and are never printed.
In the dashboard, sign in with the CLIPROXY_MANAGEMENT_KEY line from keys.env and choose Connect account.
Open Use with tools and copy the settings for Claude Code, Codex CLI or another tool.
Run the same command again to upgrade; your config and keys stay as they are. docs/INSTALL.md shows how to start the proxy when you log in.
docs/GETTING-STARTED.md walks through the same steps in more detail.
Using a subscription outside its official app can break the provider's terms, and providers have suspended accounts for it. Whether to do that is your call and your risk.
Paste this into Claude Code, Codex or another coding agent on the computer where you want the proxy:
Install and set up cliproxy-rs on this computer by following
https://github.com/vayungodara/cliproxy-rs/blob/master/docs/AI-SETUP.md exactly.
Do not sign in to any of my accounts or print my keys; tell me when it is my turn.
The agent runs the installer, which picks a free port without touching an existing CLIProxyAPI and keeps the keys in a file only you can read. It checks that the proxy answers, then hands the account sign-in to you.
The proxy serves the Anthropic Messages API at http://127.0.0.1:8317, the OpenAI API at http://127.0.0.1:8317/v1 and the Gemini API at http://127.0.0.1:8317, all with your client key. For Claude Code:
export ANTHROPIC_BASE_URL=http://127.0.0.1:8317
export ANTHROPIC_AUTH_TOKEN=your-client-key
claude
docs/CLIENTS.md has copy-paste setups for Claude Code, Codex CLI, Gemini CLI, Amp, OpenCode, Factory Droid, Cline, Roo Code, Kilo Code, Cursor, Zed, Continue, Aider and the OpenAI, Anthropic and Gemini SDKs.
Sign in to as many Claude and Codex accounts as you have, and choose how the proxy rotates between them: round-robin, fill-first, weighted-round-robin, or soonest-reset (experimental, a cliproxy-rs addition: spend the account whose weekly window resets soonest first). Session affinity keeps each conversation on one account so the provider's prompt cache stays warm, and an account that hits a limit rests while the others take over. docs/MULTI-ACCOUNT.md covers routing, cooldowns, the quota view, per-account proxies, Codex over WebSocket and reaching the proxy from your other machines over Tailscale.
cliproxy-rs serves the same routes and the same v8 Management API as CLIProxyAPI, so the community apps built on CLIProxyAPI should work with it, for example CPA-Manager-Plus, CLIProxyAPI Quota Inspector, ZeroLimit, Quotio, VibeProxy and CCS. We have not tested all of them. Apps that talk to a running server need only its address and management key; apps that start their own bundled CLIProxyAPI need an option to use an existing server instead. If an app does not work with cliproxy-rs, please open an issue.
install.sh (macOS and Linux) and install.ps1 (Windows), the commands in the quick start. They install the release binary, set it up and start it; --binary-only (-BinaryOnly on Windows) installs only the binary.SHA256SUMS file, on the releases page.Dockerfile.docs/INSTALL.md covers each one, starting the proxy at login, and removing it.
These are not in cliproxy-rs yet. They are planned, in no fixed order:
-tui).pprof debug listener.Keep access.api-keys set and server.host on 127.0.0.1 unless you need other machines to connect. Behind a tunnel or reverse proxy on the same machine, set server.trusted-proxies, or every internet client counts as local. The dashboard is built into the binary, and cliproxy-rs never downloads code to run. Running it safely explains each point, and SECURITY.md says how to report a vulnerability.
Go is faster on non-streaming throughput. On a 2-vCPU test machine with a local fake upstream (2026-10-03), CLIProxyAPI handled about 34% more non-streaming requests per second (1,568 against 1,168) and about 10% more plain streams (916 against 833). cliproxy-rs was faster on streams it translates between the Anthropic and OpenAI formats (793 against 564 per second, about 41% more) and used less than half of Go's memory: 17 MB at idle against 45 MB, and 25 to 50 MB under load against 58 to 104 MB. It answers its first request about 17 ms after launch, and the release binary is 36 MB against 69 MB. docs/BENCHMARKS.md has the method and every number.
The workspace is crates/cpa-core (config and account formats), crates/cpa-exec (one module per upstream provider), crates/cpa-translate (format translation), crates/cpa-server (routes, account selection and the Management API), crates/cliproxy (the binary) and ui/ (the dashboard, see ui/README.md). The workspace has 935 tests, run against local mock upstreams only; CI runs the whole suite on every push, with Go and PostgreSQL installed so the tests that compare against them run too. A differential harness sends the same 57 cases to CLIProxyAPI and cliproxy-rs and compares the results.
cargo fmt --all --check
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --locked
CONTRIBUTING.md explains how to send a change.
Built with some help from AI.
MIT. See LICENSE. CLIProxyAPI, which this project follows closely, is also MIT licensed.
Rust
79.1%
Go
15.5%
HTML
2.0%
Rust rewrite of CLIProxyAPI: drop-in compatible proxy for Claude, Codex, Gemini and OpenAI-compatible providers
Rust
0
587 commits
updated Oct 3, 2026
cliproxy-rs is a small server you run on your own computer. It lets your coding tools, such as Claude Code, Codex CLI or Cursor, use the AI subscriptions and API keys you already have, like a Claude Max plan or a ChatGPT plan, through one local address. A dashboard built into it shows which accounts work, how much of each plan's limits is left, and how to connect each tool.
It is a Rust rewrite of CLIProxyAPI. It reads the same config.yaml and the same account files, so you can switch between the two in either direction.
Run one command. On macOS or Linux:
curl -fsSL https://raw.githubusercontent.com/vayungodara/cliproxy-rs/master/install.sh | sh
On Windows, in PowerShell:
irm https://raw.githubusercontent.com/vayungodara/cliproxy-rs/master/install.ps1 | iex
It installs the latest release after checking its checksum, writes a config with new keys to ~/.cliproxy-rs, starts the proxy in the background and opens the dashboard in your browser. The keys stay in ~/.cliproxy-rs/keys.env and are never printed.
In the dashboard, sign in with the CLIPROXY_MANAGEMENT_KEY line from keys.env and choose Connect account.
Open Use with tools and copy the settings for Claude Code, Codex CLI or another tool.
Run the same command again to upgrade; your config and keys stay as they are. docs/INSTALL.md shows how to start the proxy when you log in.
docs/GETTING-STARTED.md walks through the same steps in more detail.
Using a subscription outside its official app can break the provider's terms, and providers have suspended accounts for it. Whether to do that is your call and your risk.
Paste this into Claude Code, Codex or another coding agent on the computer where you want the proxy:
Install and set up cliproxy-rs on this computer by following
https://github.com/vayungodara/cliproxy-rs/blob/master/docs/AI-SETUP.md exactly.
Do not sign in to any of my accounts or print my keys; tell me when it is my turn.
The agent runs the installer, which picks a free port without touching an existing CLIProxyAPI and keeps the keys in a file only you can read. It checks that the proxy answers, then hands the account sign-in to you.
The proxy serves the Anthropic Messages API at http://127.0.0.1:8317, the OpenAI API at http://127.0.0.1:8317/v1 and the Gemini API at http://127.0.0.1:8317, all with your client key. For Claude Code:
export ANTHROPIC_BASE_URL=http://127.0.0.1:8317
export ANTHROPIC_AUTH_TOKEN=your-client-key
claude
docs/CLIENTS.md has copy-paste setups for Claude Code, Codex CLI, Gemini CLI, Amp, OpenCode, Factory Droid, Cline, Roo Code, Kilo Code, Cursor, Zed, Continue, Aider and the OpenAI, Anthropic and Gemini SDKs.
Sign in to as many Claude and Codex accounts as you have, and choose how the proxy rotates between them: round-robin, fill-first, weighted-round-robin, or soonest-reset (experimental, a cliproxy-rs addition: spend the account whose weekly window resets soonest first). Session affinity keeps each conversation on one account so the provider's prompt cache stays warm, and an account that hits a limit rests while the others take over. docs/MULTI-ACCOUNT.md covers routing, cooldowns, the quota view, per-account proxies, Codex over WebSocket and reaching the proxy from your other machines over Tailscale.
cliproxy-rs serves the same routes and the same v8 Management API as CLIProxyAPI, so the community apps built on CLIProxyAPI should work with it, for example CPA-Manager-Plus, CLIProxyAPI Quota Inspector, ZeroLimit, Quotio, VibeProxy and CCS. We have not tested all of them. Apps that talk to a running server need only its address and management key; apps that start their own bundled CLIProxyAPI need an option to use an existing server instead. If an app does not work with cliproxy-rs, please open an issue.
install.sh (macOS and Linux) and install.ps1 (Windows), the commands in the quick start. They install the release binary, set it up and start it; --binary-only (-BinaryOnly on Windows) installs only the binary.SHA256SUMS file, on the releases page.Dockerfile.docs/INSTALL.md covers each one, starting the proxy at login, and removing it.
These are not in cliproxy-rs yet. They are planned, in no fixed order:
-tui).pprof debug listener.Keep access.api-keys set and server.host on 127.0.0.1 unless you need other machines to connect. Behind a tunnel or reverse proxy on the same machine, set server.trusted-proxies, or every internet client counts as local. The dashboard is built into the binary, and cliproxy-rs never downloads code to run. Running it safely explains each point, and SECURITY.md says how to report a vulnerability.
Go is faster on non-streaming throughput. On a 2-vCPU test machine with a local fake upstream (2026-10-03), CLIProxyAPI handled about 34% more non-streaming requests per second (1,568 against 1,168) and about 10% more plain streams (916 against 833). cliproxy-rs was faster on streams it translates between the Anthropic and OpenAI formats (793 against 564 per second, about 41% more) and used less than half of Go's memory: 17 MB at idle against 45 MB, and 25 to 50 MB under load against 58 to 104 MB. It answers its first request about 17 ms after launch, and the release binary is 36 MB against 69 MB. docs/BENCHMARKS.md has the method and every number.
The workspace is crates/cpa-core (config and account formats), crates/cpa-exec (one module per upstream provider), crates/cpa-translate (format translation), crates/cpa-server (routes, account selection and the Management API), crates/cliproxy (the binary) and ui/ (the dashboard, see ui/README.md). The workspace has 935 tests, run against local mock upstreams only; CI runs the whole suite on every push, with Go and PostgreSQL installed so the tests that compare against them run too. A differential harness sends the same 57 cases to CLIProxyAPI and cliproxy-rs and compares the results.
cargo fmt --all --check
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --locked
CONTRIBUTING.md explains how to send a change.
Built with some help from AI.
MIT. See LICENSE. CLIProxyAPI, which this project follows closely, is also MIT licensed.
Rust
79.1%
Go
15.5%
HTML
2.0%