A fork of router-for-me/CLIProxyAPI, optimized for use with CodeTeam - CE.
Connect the accounts. Route the requests. Keep the tools working.
CodeTeam - CE is optional: this fork also works with other compatible clients and agent workflows.
Different coding tools expect different model APIs. Accounts have different quotas, models, and reset windows. CLIProxyAPI gives those tools a common gateway while keeping provider credentials and connection settings on the server.
This is Codedaptive's fork of router-for-me/CLIProxyAPI. It tracks the upstream proxy and retains regression coverage for Claude Code's auto-mode safeguard pass-through. Our quota routing, spend analysis, and planning features live in the companion repositories below.
- Connects clients and providers. Serves OpenAI Chat Completions and Responses, Anthropic Messages, and Gemini-compatible interfaces, with provider translation, streaming, and tool calling where supported.
- Manages multiple accounts. Supports provider API keys and supported OAuth login flows, model aliases, credential selection, and retry/fallback behavior.
- Hosts routing extensions. Loads the optional Codedaptive QuotaRouter for reset-first scheduling, desktop affinity, model/effort roles, and weekly reserves.
- Exposes management and usage data. The v8 Management API supports the companion dashboard and its separate usage collector.
- Preserves native Claude auto-mode fields. The safeguard regression tests cover request and response transport; eligibility still comes from the upstream account and model. See the auto-mode guide.
Model availability comes from your connected accounts and provider catalogs. Protocol compatibility does not make every provider's tools or session state interchangeable.
The three CLIProxy repositories form one stack. Each has a separate job and can be updated independently:
| Project | What it does |
|---|---|
| CLIProxyAPI | Serves model APIs, connects provider accounts, and loads native plugins. |
| CLIProxyAPI-QuotaRouter | Selects accounts by quota/reset policy, keeps desktop sessions attached, and routes model/effort roles. |
| CLIProxyAPI-MgmtCenterWithForecasting | Manages the proxy and adds usage history, spend analysis, quota forecasts, and subscription planning. |
These Codedaptive projects complement the stack on the agent side:
- CodeTeam - CE runs a coordinated team of coding agents. Its agents can use the proxy for model access and the router's role names for task-specific model preferences.
- MOOTx01 CE gives agents persistent memory across sessions, models, and machines.
- CodeGraph Hub supplies a shared code knowledge graph for finding symbols, callers, and change impact.
MOOTx01 and CodeGraph connect to the agents through their own integrations; they are optional and are not installed by the proxy.
- Go 1.26.10 or the compatible toolchain selected by go.mod, plus Git.
- A provider API key or a supported account login.
- Optional: the QuotaRouter plugin for account/role policies, and the management center plus Node.js collector for historical reporting.
For the full stack, follow the Codedaptive setup guide. For the proxy alone:
git clone https://github.com/codedaptive/CLIProxyAPI.git
cd CLIProxyAPI
go build -o cli-proxy-api ./cmd/server
cp config.example.yaml config.yamlEdit config.yaml before starting:
- Set
server.hostto127.0.0.1for an initial local setup. - Replace
access.api-keyswith your own inference client key. - Set
management.secret-keyto a separate management key. - Configure the provider credentials or login flow you intend to use.
./cli-proxy-api --config config.yamlOpen http://127.0.0.1:8317/management.html and sign in with the management key.
Point compatible clients at the proxy using the client key. The two keys serve
different purposes.
The core's default panel is the upstream management UI. To get Codedaptive's Overview, Spend Analysis, and Subscription Planning, build and serve the companion management center. Its setup guide includes the collector and HTTPS configuration.
| Path | Purpose |
|---|---|
cmd/server/ |
Proxy executable and command-line entry point |
internal/api/ |
Client endpoints, management API, middleware, and modules |
internal/runtime/executor/ |
Provider request execution |
internal/translator/ |
Protocol translation |
internal/thinking/ |
Reasoning/effort normalization and provider mapping |
internal/usage/ |
Usage recording and token accounting |
sdk/ |
Embeddable service and plugin APIs |
examples/ |
SDK clients and plugin examples |
config.example.yaml |
Annotated v8 configuration |
docs/ |
Management, SDK, discovery, and auto-mode guides |
- Full-stack installation and updates
- v8 Management API
- SDK usage and advanced integration
- Plugin examples
- Claude Code auto-mode compatibility
- LAN discovery
- Upstream project reference, including provider and ecosystem links
- Upstream translations: 简体中文 · 日本語
go test ./...
go build -o cli-proxy-api ./cmd/serverSee AGENTS.md for repository conventions. Exercise integration changes with a separate configuration, credential directory, and test instance.
The current source baseline is upstream v8.0.67. Build this repository to obtain its fork changes; upstream releases contain the upstream core. Check Codedaptive releases for explicitly published fork artifacts.
The core, native router, dashboard HTML, and collector have separate update paths. Replacing separately hosted dashboard HTML does not restart inference. A core binary upgrade needs a controlled service restart; follow the setup guide's backup and rollback steps.
Open a Codedaptive core issue with the version, provider/protocol, reproduction steps, and redacted logs. Send reporting/UI issues to the management center and routing-policy issues to the QuotaRouter. Pull requests should include focused tests and explain any upstream behavior they change.
Keep API keys, OAuth tokens, auth files, and private configuration out of issues and commits. Use the provider access methods permitted for your account.
MIT. This fork builds on the work of router-for-me/CLIProxyAPI and its contributors. Original license notices and the upstream README are retained. Codedaptive maintains this fork and its companion tools; it is not affiliated with the model providers.