Skip to content

Commit 26c298c

Browse files
authored
Merge branch 'main' into plus
2 parents 5ab9afa + 938af75 commit 26c298c

167 files changed

Lines changed: 44888 additions & 704 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docker-image.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
name: docker-image
22

33
on:
4+
workflow_dispatch:
45
push:
56
tags:
67
- v*
78

89
env:
910
APP_NAME: CLIProxyAPI
10-
DOCKERHUB_REPO: eceasy/cli-proxy-api
11+
DOCKERHUB_REPO: ${{ secrets.DOCKERHUB_USERNAME }}/cli-proxy-api-plus
1112

1213
jobs:
1314
docker_amd64:

.gitignore

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
# Binaries
22
cli-proxy-api
3+
cliproxy
4+
/server
35
*.exe
46

7+
58
# Configuration
69
config.yaml
710
.env
8-
11+
.mcp.json
912
# Generated content
1013
bin/*
1114
logs/*
1215
conv/*
1316
temp/*
1417
refs/*
18+
tmp/*
1519

1620
# Storage backends
1721
pgstore/*
@@ -46,7 +50,15 @@ GEMINI.md
4650
.bmad/*
4751
_bmad/*
4852
_bmad-output/*
53+
.mcp/cache/
4954

5055
# macOS
5156
.DS_Store
5257
._*
58+
59+
# Opencode
60+
.beads/
61+
.opencode/
62+
.cli-proxy-api/
63+
.venv/
64+
*.bak

.goreleaser.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2
22

33
builds:
4-
- id: "cli-proxy-api"
4+
- id: "cli-proxy-api-plus"
55
env:
66
- CGO_ENABLED=0
77
goos:
@@ -13,11 +13,11 @@ builds:
1313
- amd64
1414
- arm64
1515
main: ./cmd/server/
16-
binary: cli-proxy-api
16+
binary: cli-proxy-api-plus
1717
ldflags:
18-
- -s -w -X 'main.Version={{.Version}}' -X 'main.Commit={{.ShortCommit}}' -X 'main.BuildDate={{.Date}}'
18+
- -s -w -X 'main.Version={{.Version}}-plus' -X 'main.Commit={{.ShortCommit}}' -X 'main.BuildDate={{.Date}}'
1919
archives:
20-
- id: "cli-proxy-api"
20+
- id: "cli-proxy-api-plus"
2121
format: tar.gz
2222
format_overrides:
2323
- goos: windows

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ ARG VERSION=dev
1212
ARG COMMIT=none
1313
ARG BUILD_DATE=unknown
1414

15-
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w -X 'main.Version=${VERSION}' -X 'main.Commit=${COMMIT}' -X 'main.BuildDate=${BUILD_DATE}'" -o ./CLIProxyAPI ./cmd/server/
15+
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w -X 'main.Version=${VERSION}-plus' -X 'main.Commit=${COMMIT}' -X 'main.BuildDate=${BUILD_DATE}'" -o ./CLIProxyAPIPlus ./cmd/server/
1616

1717
FROM alpine:3.22.0
1818

1919
RUN apk add --no-cache tzdata
2020

2121
RUN mkdir /CLIProxyAPI
2222

23-
COPY --from=builder ./app/CLIProxyAPI /CLIProxyAPI/CLIProxyAPI
23+
COPY --from=builder ./app/CLIProxyAPIPlus /CLIProxyAPI/CLIProxyAPIPlus
2424

2525
COPY config.example.yaml /CLIProxyAPI/config.example.yaml
2626

@@ -32,4 +32,4 @@ ENV TZ=Asia/Shanghai
3232

3333
RUN cp /usr/share/zoneinfo/${TZ} /etc/localtime && echo "${TZ}" > /etc/timezone
3434

35-
CMD ["./CLIProxyAPI"]
35+
CMD ["./CLIProxyAPIPlus"]

README.md

Lines changed: 7 additions & 194 deletions
Original file line numberDiff line numberDiff line change
@@ -1,205 +1,18 @@
1-
# CLI Proxy API
1+
# CLIProxyAPI Plus
22

3-
English | [中文](README_CN.md) | [日本語](README_JA.md)
3+
English | [Chinese](README_CN.md)
44

5-
A proxy server that provides OpenAI/Gemini/Claude/Codex compatible API interfaces for CLI.
5+
This is the Plus version of [CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI), adding support for third-party providers on top of the mainline project.
66

7-
It now also supports OpenAI Codex (GPT models) and Claude Code via OAuth.
7+
All third-party provider support is maintained by community contributors; CLIProxyAPI does not provide technical support. Please contact the corresponding community maintainer if you need assistance.
88

9-
So you can use local or multi-account CLI access with OpenAI(include Responses)/Gemini/Claude-compatible clients and SDKs.
10-
11-
## Sponsor
12-
13-
[![z.ai](https://assets.router-for.me/english-5-0.jpg)](https://z.ai/subscribe?ic=8JVLJQFSKB)
14-
15-
This project is sponsored by Z.ai, supporting us with their GLM CODING PLAN.
16-
17-
GLM CODING PLAN is a subscription service designed for AI coding, starting at just $10/month. It provides access to their flagship GLM-4.7 & (GLM-5 Only Available for Pro Users)model across 10+ popular AI coding tools (Claude Code, Cline, Roo Code, etc.), offering developers top-tier, fast, and stable coding experiences.
18-
19-
Get 10% OFF GLM CODING PLAN:https://z.ai/subscribe?ic=8JVLJQFSKB
20-
21-
---
22-
23-
<table>
24-
<tbody>
25-
<tr>
26-
<td width="180"><a href="https://www.packyapi.com/register?aff=cliproxyapi"><img src="./assets/packycode.png" alt="PackyCode" width="150"></a></td>
27-
<td>Thanks to PackyCode for sponsoring this project! PackyCode is a reliable and efficient API relay service provider, offering relay services for Claude Code, Codex, Gemini, and more. PackyCode provides special discounts for our software users: register using <a href="https://www.packyapi.com/register?aff=cliproxyapi">this link</a> and enter the "cliproxyapi" promo code during recharge to get 10% off.</td>
28-
</tr>
29-
<tr>
30-
<td width="180"><a href="https://www.aicodemirror.com/register?invitecode=TJNAIF"><img src="./assets/aicodemirror.png" alt="AICodeMirror" width="150"></a></td>
31-
<td>Thanks to AICodeMirror for sponsoring this project! AICodeMirror provides official high-stability relay services for Claude Code / Codex / Gemini CLI, with enterprise-grade concurrency, fast invoicing, and 24/7 dedicated technical support. Claude Code / Codex / Gemini official channels at 38% / 2% / 9% of original price, with extra discounts on top-ups! AICodeMirror offers special benefits for CLIProxyAPI users: register via <a href="https://www.aicodemirror.com/register?invitecode=TJNAIF">this link</a> to enjoy 20% off your first top-up, and enterprise customers can get up to 25% off!</td>
32-
</tr>
33-
<tr>
34-
<td width="180"><a href="https://shop.bmoplus.com/?utm_source=github"><img src="./assets/bmoplus.png" alt="BmoPlus" width="150"></a></td>
35-
<td>Huge thanks to BmoPlus for sponsoring this project! BmoPlus is a highly reliable AI account provider built strictly for heavy AI users and developers. They offer rock-solid, ready-to-use accounts and official top-up services for ChatGPT Plus / ChatGPT Pro (Full Warranty) / Claude Pro / Super Grok / Gemini Pro. By registering and ordering through <a href="https://shop.bmoplus.com/?utm_source=github">BmoPlus - Premium AI Accounts & Top-ups</a>, users can unlock the mind-blowing rate of <b>10% of the official GPT subscription price (90% OFF)</b>!</td>
36-
</tr>
37-
<tr>
38-
<td width="180"><a href="https://www.lingtrue.com/register"><img src="./assets/lingtrue.png" alt="LingtrueAPI" width="150"></a></td>
39-
<td>Thanks to LingtrueAPI for its sponsorship of this project! LingtrueAPI is a global large - model API intermediary service platform that provides API calling services for various top - notch models such as Claude Code, Codex, and Gemini. It is committed to enabling users to connect to global AI capabilities at low cost and with high stability. LingtrueAPI offers special discounts to users of this software: register using <a href="https://www.lingtrue.com/register">this link</a>, and enter the promo code "LingtrueAPI" when making the first recharge to enjoy a 10% discount.</td>
40-
</tr>
41-
<tr>
42-
<td width="180"><a href="https://poixe.com/i/m8kvep"><img src="./assets/poixeai.png" alt="PoixeAI" width="150"></a></td>
43-
<td>Thanks to Poixe AI for sponsoring this project! Poixe AI provides reliable LLM API services. You can leverage the platform's API endpoints to seamlessly build AI-powered products. Additionally, you can become a vendor by providing AI API resources to the platform and earn revenue. Register through the exclusive CLIProxyAPI <a href="https://poixe.com/i/m8kvep">referral link</a> and receive a bonus of $5 USD on your first top-up.</td>
44-
</tr>
45-
</tbody>
46-
</table>
47-
48-
## Overview
49-
50-
- OpenAI/Gemini/Claude compatible API endpoints for CLI models
51-
- OpenAI Codex support (GPT models) via OAuth login
52-
- Claude Code support via OAuth login
53-
- Qwen Code support via OAuth login
54-
- iFlow support via OAuth login
55-
- Amp CLI and IDE extensions support with provider routing
56-
- Streaming and non-streaming responses
57-
- Function calling/tools support
58-
- Multimodal input support (text and images)
59-
- Multiple accounts with round-robin load balancing (Gemini, OpenAI, Claude, Qwen and iFlow)
60-
- Simple CLI authentication flows (Gemini, OpenAI, Claude, Qwen and iFlow)
61-
- Generative Language API Key support
62-
- AI Studio Build multi-account load balancing
63-
- Gemini CLI multi-account load balancing
64-
- Claude Code multi-account load balancing
65-
- Qwen Code multi-account load balancing
66-
- iFlow multi-account load balancing
67-
- OpenAI Codex multi-account load balancing
68-
- OpenAI-compatible upstream providers via config (e.g., OpenRouter)
69-
- Reusable Go SDK for embedding the proxy (see `docs/sdk-usage.md`)
70-
71-
## Getting Started
72-
73-
CLIProxyAPI Guides: [https://help.router-for.me/](https://help.router-for.me/)
74-
75-
## Management API
76-
77-
see [MANAGEMENT_API.md](https://help.router-for.me/management/api)
78-
79-
## Amp CLI Support
80-
81-
CLIProxyAPI includes integrated support for [Amp CLI](https://ampcode.com) and Amp IDE extensions, enabling you to use your Google/ChatGPT/Claude OAuth subscriptions with Amp's coding tools:
82-
83-
- Provider route aliases for Amp's API patterns (`/api/provider/{provider}/v1...`)
84-
- Management proxy for OAuth authentication and account features
85-
- Smart model fallback with automatic routing
86-
- **Model mapping** to route unavailable models to alternatives (e.g., `claude-opus-4.5``claude-sonnet-4`)
87-
- Security-first design with localhost-only management endpoints
88-
89-
When you need the request/response shape of a specific backend family, use the provider-specific paths instead of the merged `/v1/...` endpoints:
90-
91-
- Use `/api/provider/{provider}/v1/messages` for messages-style backends.
92-
- Use `/api/provider/{provider}/v1beta/models/...` for model-scoped generate endpoints.
93-
- Use `/api/provider/{provider}/v1/chat/completions` for chat-completions backends.
94-
95-
These routes help you select the protocol surface, but they do not by themselves guarantee a unique inference executor when the same client-visible model name is reused across multiple backends. Inference routing is still resolved from the request model/alias. For strict backend pinning, use unique aliases, prefixes, or otherwise avoid overlapping client-visible model names.
96-
97-
**[Complete Amp CLI Integration Guide](https://help.router-for.me/agent-client/amp-cli.html)**
98-
99-
## SDK Docs
100-
101-
- Usage: [docs/sdk-usage.md](docs/sdk-usage.md)
102-
- Advanced (executors & translators): [docs/sdk-advanced.md](docs/sdk-advanced.md)
103-
- Access: [docs/sdk-access.md](docs/sdk-access.md)
104-
- Watcher: [docs/sdk-watcher.md](docs/sdk-watcher.md)
105-
- Custom Provider Example: `examples/custom-provider`
9+
The Plus release stays in lockstep with the mainline features.
10610

10711
## Contributing
10812

109-
Contributions are welcome! Please feel free to submit a Pull Request.
110-
111-
1. Fork the repository
112-
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
113-
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
114-
4. Push to the branch (`git push origin feature/amazing-feature`)
115-
5. Open a Pull Request
116-
117-
## Who is with us?
118-
119-
Those projects are based on CLIProxyAPI:
120-
121-
### [vibeproxy](https://github.com/automazeio/vibeproxy)
122-
123-
Native macOS menu bar app to use your Claude Code & ChatGPT subscriptions with AI coding tools - no API keys needed
124-
125-
### [Subtitle Translator](https://github.com/VjayC/SRT-Subtitle-Translator-Validator)
126-
127-
Browser-based tool to translate SRT subtitles using your Gemini subscription via CLIProxyAPI with automatic validation/error correction - no API keys needed
128-
129-
### [CCS (Claude Code Switch)](https://github.com/kaitranntt/ccs)
130-
131-
CLI wrapper for instant switching between multiple Claude accounts and alternative models (Gemini, Codex, Antigravity) via CLIProxyAPI OAuth - no API keys needed
132-
133-
### [Quotio](https://github.com/nguyenphutrong/quotio)
134-
135-
Native macOS menu bar app that unifies Claude, Gemini, OpenAI, Qwen, and Antigravity subscriptions with real-time quota tracking and smart auto-failover for AI coding tools like Claude Code, OpenCode, and Droid - no API keys needed.
136-
137-
### [CodMate](https://github.com/loocor/CodMate)
138-
139-
Native macOS SwiftUI app for managing CLI AI sessions (Codex, Claude Code, Gemini CLI) with unified provider management, Git review, project organization, global search, and terminal integration. Integrates CLIProxyAPI to provide OAuth authentication for Codex, Claude, Gemini, Antigravity, and Qwen Code, with built-in and third-party provider rerouting through a single proxy endpoint - no API keys needed for OAuth providers.
140-
141-
### [ProxyPilot](https://github.com/Finesssee/ProxyPilot)
142-
143-
Windows-native CLIProxyAPI fork with TUI, system tray, and multi-provider OAuth for AI coding tools - no API keys needed.
144-
145-
### [Claude Proxy VSCode](https://github.com/uzhao/claude-proxy-vscode)
146-
147-
VSCode extension for quick switching between Claude Code models, featuring integrated CLIProxyAPI as its backend with automatic background lifecycle management.
148-
149-
### [ZeroLimit](https://github.com/0xtbug/zero-limit)
150-
151-
Windows desktop app built with Tauri + React for monitoring AI coding assistant quotas via CLIProxyAPI. Track usage across Gemini, Claude, OpenAI Codex, and Antigravity accounts with real-time dashboard, system tray integration, and one-click proxy control - no API keys needed.
152-
153-
### [CPA-XXX Panel](https://github.com/ferretgeek/CPA-X)
154-
155-
A lightweight web admin panel for CLIProxyAPI with health checks, resource monitoring, real-time logs, auto-update, request statistics and pricing display. Supports one-click installation and systemd service.
156-
157-
### [CLIProxyAPI Tray](https://github.com/kitephp/CLIProxyAPI_Tray)
158-
159-
A Windows tray application implemented using PowerShell scripts, without relying on any third-party libraries. The main features include: automatic creation of shortcuts, silent running, password management, channel switching (Main / Plus), and automatic downloading and updating.
160-
161-
### [霖君](https://github.com/wangdabaoqq/LinJun)
162-
163-
霖君 is a cross-platform desktop application for managing AI programming assistants, supporting macOS, Windows, and Linux systems. Unified management of Claude Code, Gemini CLI, OpenAI Codex, Qwen Code, and other AI coding tools, with local proxy for multi-account quota tracking and one-click configuration.
164-
165-
### [CLIProxyAPI Dashboard](https://github.com/itsmylife44/cliproxyapi-dashboard)
166-
167-
A modern web-based management dashboard for CLIProxyAPI built with Next.js, React, and PostgreSQL. Features real-time log streaming, structured configuration editing, API key management, OAuth provider integration for Claude/Gemini/Codex, usage analytics, container management, and config sync with OpenCode via companion plugin - no manual YAML editing needed.
168-
169-
### [All API Hub](https://github.com/qixing-jk/all-api-hub)
170-
171-
Browser extension for one-stop management of New API-compatible relay site accounts, featuring balance and usage dashboards, auto check-in, one-click key export to common apps, in-page API availability testing, and channel/model sync and redirection. It integrates with CLIProxyAPI through the Management API for one-click provider import and config sync.
172-
173-
### [Shadow AI](https://github.com/HEUDavid/shadow-ai)
174-
175-
Shadow AI is an AI assistant tool designed specifically for restricted environments. It provides a stealthy operation
176-
mode without windows or traces, and enables cross-device AI Q&A interaction and control via the local area network (
177-
LAN). Essentially, it is an automated collaboration layer of "screen/audio capture + AI inference + low-friction delivery",
178-
helping users to immersively use AI assistants across applications on controlled devices or in restricted environments.
179-
180-
### [ProxyPal](https://github.com/buddingnewinsights/proxypal)
181-
182-
Cross-platform desktop app (macOS, Windows, Linux) wrapping CLIProxyAPI with a native GUI. Connects Claude, ChatGPT, Gemini, GitHub Copilot, Qwen, iFlow, and custom OpenAI-compatible endpoints with usage analytics, request monitoring, and auto-configuration for popular coding tools - no API keys needed.
183-
184-
> [!NOTE]
185-
> If you developed a project based on CLIProxyAPI, please open a PR to add it to this list.
186-
187-
## More choices
188-
189-
Those projects are ports of CLIProxyAPI or inspired by it:
190-
191-
### [9Router](https://github.com/decolua/9router)
192-
193-
A Next.js implementation inspired by CLIProxyAPI, easy to install and use, built from scratch with format translation (OpenAI/Claude/Gemini/Ollama), combo system with auto-fallback, multi-account management with exponential backoff, a Next.js web dashboard, and support for CLI tools (Cursor, Claude Code, Cline, RooCode) - no API keys needed.
194-
195-
### [OmniRoute](https://github.com/diegosouzapw/OmniRoute)
196-
197-
Never stop coding. Smart routing to FREE & low-cost AI models with automatic fallback.
198-
199-
OmniRoute is an AI gateway for multi-provider LLMs: an OpenAI-compatible endpoint with smart routing, load balancing, retries, and fallbacks. Add policies, rate limits, caching, and observability for reliable, cost-aware inference.
13+
This project only accepts pull requests that relate to third-party provider support. Any pull requests unrelated to third-party provider support will be rejected.
20014

201-
> [!NOTE]
202-
> If you have developed a port of CLIProxyAPI or a project inspired by it, please open a PR to add it to this list.
15+
If you need to submit any non-third-party provider changes, please open them against the [mainline](https://github.com/router-for-me/CLIProxyAPI) repository.
20316

20417
## License
20518

0 commit comments

Comments
 (0)