Skip to content

Commit 1ed1f7b

Browse files
authored
Merge branch 'dev' into main
2 parents c354f88 + 3b0cc91 commit 1ed1f7b

118 files changed

Lines changed: 9979 additions & 7283 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.

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ VisionCoder is also offering our users a limited-time <a href="https://coder.vis
5757
- OpenAI Codex support (GPT models) via OAuth login
5858
- Claude Code support via OAuth login
5959
- Grok Build support via OAuth login
60-
- Amp CLI and IDE extensions support with provider routing
6160
- Streaming, non-streaming, and WebSocket responses where supported
6261
- Function calling/tools support
6362
- Multimodal input support (text and images)
@@ -189,6 +188,10 @@ Multi-agent orchestration for AI coding assistants. Runs CLIProxyAPI as a local
189188

190189
Windows desktop UI that manages CLIProxyAPI and Perplexity WebUI Scraper from a single interface, inspired by Quotio and VibeProxy. Connect OAuth providers (Claude, Gemini CLI, Codex, Kimi, Antigravity), custom API keys, and Perplexity session accounts, then point any coding agent at the local endpoint.
191190

191+
### [Quotio Desktop](https://github.com/xiaocoss/quotio-desktop)
192+
193+
Cross-platform (Tauri) port of Quotio for Windows, macOS and Linux. Manages a pool of AI accounts (Codex, Claude Code, GitHub Copilot, Gemini CLI, Antigravity, Kiro, Cursor, Trae, GLM) through CLIProxyAPI, with per-account 5-hour/weekly quota bars, Codex rate-limit reset credits with one-click reset, smart scheduling, usage statistics, and multi-instance Codex — no API keys needed.
194+
192195
> [!NOTE]
193196
> If you developed a project based on CLIProxyAPI, please open a PR to add it to this list.
194197

README_CN.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ Shadow AI 是一款专为受限环境设计的 AI 辅助工具。提供无窗口
186186

187187
Windows 桌面 UI,通过单一界面管理 CLIProxyAPI 和 Perplexity WebUI Scraper,灵感来自 Quotio 和 VibeProxy。连接 OAuth 提供商(Claude、Gemini CLI、Codex、Kimi、Antigravity)、自定义 API 密钥和 Perplexity 会话账号,然后将任意编程智能体指向本地端点。
188188

189+
### [Quotio Desktop](https://github.com/xiaocoss/quotio-desktop)
190+
191+
Quotio 的跨平台(Tauri)移植版,支持 Windows / macOS / Linux。通过 CLIProxyAPI 管理多账号代理池(Codex、Claude Code、GitHub Copilot、Gemini CLI、Antigravity、Kiro、Cursor、Trae、GLM),提供每账号 5 小时 / 每周额度进度条、Codex 主动重置次数与一键重置、智能调度、用量统计及 Codex 多开实例,无需 API 密钥。
192+
189193
> [!NOTE]
190194
> 如果你开发了基于 CLIProxyAPI 的项目,请提交一个 PR(拉取请求)将其添加到此列表中。
191195

README_JA.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ PackyCodeは当ソフトウェアのユーザーに特別割引を提供して
5555
- OAuthログインによるOpenAI Codexサポート(GPTモデル)
5656
- OAuthログインによるClaude Codeサポート
5757
- OAuthログインによるGrok Buildサポート
58-
- プロバイダールーティングによるAmp CLIおよびIDE拡張機能のサポート
5958
- ストリーミング、非ストリーミング、および対応環境でのWebSocketレスポンス
6059
- 関数呼び出し/ツールのサポート
6160
- マルチモーダル入力サポート(テキストと画像)
@@ -184,6 +183,10 @@ AIコーディングアシスタント向けのマルチエージェントオー
184183

185184
CLIProxyAPIとPerplexity WebUI Scraperをひとつのインターフェースで管理するWindowsデスクトップUI。QuotioとVibeProxyにインスパイアされ、OAuthプロバイダー(Claude、Gemini CLI、Codex、Kimi、Antigravity)、カスタムAPIキー、Perplexityセッションアカウントを接続し、任意のコーディングエージェントをローカルエンドポイントに向けることができます。
186185

186+
### [Quotio Desktop](https://github.com/xiaocoss/quotio-desktop)
187+
188+
Quotio のクロスプラットフォーム(Tauri)移植版(Windows / macOS / Linux 対応)。CLIProxyAPI 経由で複数の AI アカウント(Codex、Claude Code、GitHub Copilot、Gemini CLI、Antigravity、Kiro、Cursor、Trae、GLM)のプールを管理し、アカウントごとの 5 時間 / 週間クォータバー、Codex のリセットクレジットとワンクリックリセット、スマートスケジューリング、使用統計、Codex マルチインスタンスに対応。API キー不要。
189+
187190
> [!NOTE]
188191
> CLIProxyAPIをベースにプロジェクトを開発した場合は、PRを送ってこのリストに追加してください。
189192

config.example.yaml

Lines changed: 14 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ pprof:
6161
plugins:
6262
enabled: false
6363
dir: "plugins"
64+
# Additional plugin store registries. The built-in official registry is always included.
65+
# store-sources:
66+
# - "https://example.com/cliproxy-plugins/registry.json"
6467
configs:
6568
example:
6669
enabled: true
@@ -116,15 +119,20 @@ max-retry-interval: 30
116119
# When true, disable auth/model cooldown scheduling globally (prevents blackout windows after failure states).
117120
disable-cooling: false
118121

119-
# disable-image-generation supports: false (default), true, or "chat".
122+
# disable-image-generation supports: false (default), true, "chat", or "passthrough".
120123
# - true: disable image_generation everywhere (also returns 404 for /v1/images/generations and /v1/images/edits).
121124
# - "chat": disable image_generation injection on non-images endpoints, but keep /v1/images/generations and /v1/images/edits enabled.
125+
# - "passthrough": never inject or strip image_generation on non-images endpoints (forward the client payload unchanged); behaves like "chat" on /v1/images/* endpoints.
122126
disable-image-generation: false
123127

124128
# Base model used when proxying gpt-image-2 via the hosted image_generation tool (Responses API).
125129
# Must start with "gpt-" (case-insensitive). If unset or invalid, defaults to "gpt-5.4-mini".
126130
# gpt-image-2-base-model: "gpt-5.4-mini"
127131

132+
# How long video IDs returned by /openai/v1/videos and xAI video creation stay bound
133+
# to the credential that created them. Default: 3h.
134+
video-result-auth-cache-ttl: "3h"
135+
128136
# Core auth auto-refresh worker pool size (OAuth/file-based auth token refresh).
129137
# When > 0, overrides the default worker count (16).
130138
# auth-auto-refresh-workers: 16
@@ -140,8 +148,8 @@ routing:
140148
strategy: "round-robin" # round-robin (default), fill-first
141149
# Enable universal session-sticky routing for all clients.
142150
# Session IDs are extracted from: metadata.user_id (Claude Code session format),
143-
# X-Session-ID, Session_id (Codex), X-Amp-Thread-Id (Amp CLI),
144-
# X-Client-Request-Id (PI), conversation_id, or first few messages hash.
151+
# X-Session-ID, Session_id (Codex), X-Client-Request-Id (PI), conversation_id,
152+
# or first few messages hash.
145153
# Automatic failover is always enabled when bound auth becomes unavailable.
146154
session-affinity: false # default: false
147155
# How long session-to-auth bindings are retained. Default: 1h
@@ -323,48 +331,13 @@ nonstream-keepalive-interval: 0
323331
# - "imagen-3.0-generate-002"
324332
# - "imagen-*"
325333

326-
# Amp Integration
327-
# ampcode:
328-
# # Configure upstream URL for Amp CLI OAuth and management features
329-
# upstream-url: "https://ampcode.com"
330-
# # Optional: Override API key for Amp upstream (otherwise uses env or file)
331-
# upstream-api-key: ""
332-
# # Per-client upstream API key mapping
333-
# # Maps client API keys (from top-level api-keys) to different Amp upstream API keys.
334-
# # Useful when different clients need to use different Amp accounts/quotas.
335-
# # If a client key isn't mapped, falls back to upstream-api-key (default behavior).
336-
# upstream-api-keys:
337-
# - upstream-api-key: "amp_key_for_team_a" # Upstream key to use for these clients
338-
# api-keys: # Client keys that use this upstream key
339-
# - "your-api-key-1"
340-
# - "your-api-key-2"
341-
# - upstream-api-key: "amp_key_for_team_b"
342-
# api-keys:
343-
# - "your-api-key-3"
344-
# # Restrict Amp management routes (/api/auth, /api/user, etc.) to localhost only (default: false)
345-
# restrict-management-to-localhost: false
346-
# # Force model mappings to run before checking local API keys (default: false)
347-
# force-model-mappings: false
348-
# # Amp Model Mappings
349-
# # Route unavailable Amp models to alternative models available in your local proxy.
350-
# # Useful when Amp CLI requests models you don't have access to (e.g., Claude Opus 4.5)
351-
# # but you have a similar model available (e.g., Claude Sonnet 4).
352-
# model-mappings:
353-
# - from: "claude-opus-4-5-20251101" # Model requested by Amp CLI
354-
# to: "gemini-claude-opus-4-5-thinking" # Route to this available model instead
355-
# - from: "claude-sonnet-4-5-20250929"
356-
# to: "gemini-claude-sonnet-4-5-thinking"
357-
# - from: "claude-haiku-4-5-20251001"
358-
# to: "gemini-2.5-flash"
359-
360334
# Global OAuth model name aliases (per channel)
361335
# These aliases rename model IDs for both model listing and request routing.
362336
# Supported channels: gemini-cli, vertex, aistudio, antigravity, claude, codex, kimi, xai.
363-
# NOTE: Aliases do not apply to gemini-api-key, codex-api-key, claude-api-key, openai-compatibility, vertex-api-key, or ampcode.
337+
# NOTE: Aliases do not apply to gemini-api-key, codex-api-key, claude-api-key, openai-compatibility, or vertex-api-key.
364338
# NOTE: Because aliases affect the merged /v1 model list and merged request routing, overlapping
365-
# client-visible names can become ambiguous across providers. /api/provider/{provider}/... helps
366-
# you select the protocol surface, but inference backend selection can still follow the resolved
367-
# model/alias. For strict backend pinning, use unique aliases/prefixes or avoid overlapping names.
339+
# client-visible names can become ambiguous across providers. For strict backend pinning, use
340+
# unique aliases/prefixes or avoid overlapping names.
368341
# You can repeat the same name with different aliases to expose multiple client model names.
369342
# oauth-model-alias:
370343
# gemini-cli:

examples/plugin/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
EXAMPLES := simple model auth frontend-auth executor protocol-format request-translator request-normalizer response-translator response-normalizer thinking usage cli management-api host-callback
1+
EXAMPLES := simple model auth frontend-auth executor protocol-format request-translator request-normalizer response-translator response-normalizer thinking usage cli management-api host-callback host-callback-auth-files host-model-callback
22
LANGUAGES := go c rust
33
BIN_DIR := $(CURDIR)/bin
44
BUILD_DIR := $(BIN_DIR)/build

examples/plugin/README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ This directory contains standard dynamic library plugin examples for the CLIProx
44

55
## Layout
66

7-
- `simple/`: full provider-native skeleton that declares every supported capability.
7+
- `simple/`- : Go-only plugin resource that calls host auth file callbacks (, , , ).
8+
- : full provider-native skeleton that declares every supported capability.
89
- `model/`: model capability only.
910
- `auth/`: auth provider capability only.
1011
- `frontend-auth/`: frontend auth provider capability only.
@@ -22,6 +23,7 @@ This directory contains standard dynamic library plugin examples for the CLIProx
2223
- `cli/`: command-line capability only.
2324
- `management-api/`: Management API and resource capability only.
2425
- `host-callback/`: minimal plugin resource that demonstrates host callbacks.
26+
- `host-callback-auth-files/`: Go-only plugin resource that calls host auth file callbacks.
2527
- `host-model-callback/`: Go-only plugin resource that calls the host model execution callbacks.
2628

2729
Most standard capability examples contain `go/`, `c/`, and `rust/` subdirectories. Specialized examples may provide only the implementation language they need.
@@ -39,6 +41,22 @@ plugins:
3941
fast: false
4042
```
4143
44+
45+
46+
## Host Auth Files Callback
47+
48+
`host-callback-auth-files` declares the Management API capability and exposes a browser resource named `Host Auth Files`. The resource demonstrates `host.auth.list`, `host.auth.get` (physical JSON file), `host.auth.get_runtime`, and `host.auth.save`.
49+
50+
```yaml
51+
plugins:
52+
configs:
53+
host-callback-auth-files:
54+
enabled: true
55+
priority: 1
56+
```
57+
58+
See `host-callback-auth-files/README.md` for URL examples.
59+
4260
## Host Model Callback
4361

4462
`host-model-callback` declares the Management API capability and exposes a browser resource named `Host Model Callback`. The resource calls `host.model.execute` for non-streaming requests and `host.model.execute_stream` plus `host.model.stream_read` for streaming requests. It demonstrates explicit stream close with `host.model.stream_close` and an `implicit_close=true` option for RPC-scope host cleanup.

examples/plugin/README_CN.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# 标准动态库插件示例
1+
- :仅 Go 实现的插件资源,演示 host 凭证文件回调(、、、)。
2+
- # 标准动态库插件示例
23

34
本目录包含 CLIProxyAPI C ABI 的标准动态库插件示例。
45

@@ -22,6 +23,7 @@
2223
- `cli/`:只演示命令行扩展能力。
2324
- `management-api/`:只演示 Management API 和资源扩展能力。
2425
- `host-callback/`:使用最小插件资源演示宿主回调。
26+
- `host-callback-auth-files/`:仅 Go 实现的插件资源,演示 host 凭证文件回调。
2527
- `host-model-callback/`:仅 Go 实现的插件资源,演示调用宿主模型执行回调。
2628

2729
多数标准能力示例都包含 `go/``c/``rust/` 三个子目录。专用示例可能只提供所需的实现语言。
@@ -39,6 +41,22 @@ plugins:
3941
fast: false
4042
```
4143
44+
45+
46+
## Host Auth Files 回调
47+
48+
`host-callback-auth-files` 声明 Management API 能力,并暴露名为 `Host Auth Files` 的浏览器资源,演示 `host.auth.list`、`host.auth.get`(物理 JSON 文件)、`host.auth.get_runtime` 与 `host.auth.save`。
49+
50+
```yaml
51+
plugins:
52+
configs:
53+
host-callback-auth-files:
54+
enabled: true
55+
priority: 1
56+
```
57+
58+
详见 `host-callback-auth-files/README.md`。
59+
4260
## Host Model Callback
4361

4462
`host-model-callback` 声明 Management API 能力,并暴露名为 `Host Model Callback` 的浏览器资源。该资源在非流式请求中调用 `host.model.execute`,在流式请求中调用 `host.model.execute_stream` 和 `host.model.stream_read`。它演示了通过 `host.model.stream_close` 显式关闭流,也提供 `implicit_close=true` 用于演示 RPC 作用域结束时的宿主隐式清理。
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Host Callback Auth Files Plugin
2+
3+
This Go-only plugin demonstrates how a plugin-owned browser resource can call the host auth file callbacks:
4+
5+
- `host.auth.list`
6+
- `host.auth.get`
7+
- `host.auth.get_runtime`
8+
- `host.auth.save`
9+
10+
## Purpose and Scope
11+
12+
The plugin registers a Management API resource named `Host Auth Files` at `/status`. CPA exposes it under:
13+
14+
```text
15+
/v0/resource/plugins/host-callback-auth-files/status
16+
```
17+
18+
The resource reads URL query parameters, calls the host auth callbacks, and renders the result in HTML. It does not implement executor, translator, auth provider, or scheduler capabilities.
19+
20+
## Build
21+
22+
From this directory:
23+
24+
```bash
25+
cd go
26+
go build -buildmode=c-shared -o host-callback-auth-files.dylib .
27+
rm -f host-callback-auth-files.dylib host-callback-auth-files.h
28+
```
29+
30+
Use the platform extension expected by your target system:
31+
32+
- `.dylib` on macOS
33+
- `.so` on Linux
34+
- `.dll` on Windows
35+
36+
## Configuration
37+
38+
Build the dynamic library and place it under the configured plugin directory with a basename that matches the plugin ID. For example, `plugins/host-callback-auth-files.dylib` maps to `plugins.configs.host-callback-auth-files`.
39+
40+
```yaml
41+
plugins:
42+
enabled: true
43+
dir: "plugins"
44+
configs:
45+
host-callback-auth-files:
46+
enabled: true
47+
priority: 1
48+
```
49+
50+
This plugin does not define plugin-specific configuration fields.
51+
52+
## Resource URL Examples
53+
54+
List all auth files:
55+
56+
```text
57+
http://localhost:8080/v0/resource/plugins/host-callback-auth-files/status?op=list
58+
```
59+
60+
Read physical JSON by auth index:
61+
62+
```text
63+
http://localhost:8080/v0/resource/plugins/host-callback-auth-files/status?op=get&auth_index=<AUTH_INDEX>
64+
```
65+
66+
Read runtime info by auth index:
67+
68+
```text
69+
http://localhost:8080/v0/resource/plugins/host-callback-auth-files/status?op=runtime&auth_index=<AUTH_INDEX>
70+
```
71+
72+
Save physical JSON:
73+
74+
```text
75+
http://localhost:8080/v0/resource/plugins/host-callback-auth-files/status?op=save&name=example-auth.json&json=%7B%22type%22%3A%22gemini%22%2C%22email%22%3A%22demo%40example.com%22%2C%22api_key%22%3A%22demo-key%22%7D
76+
```
77+
78+
## Parameters
79+
80+
- `op`: one of `list`, `get`, `runtime`, `save`. Default is `list`.
81+
- `auth_index`: required for `get` and `runtime`.
82+
- `name`: required for `save`. Must end with `.json`.
83+
- `json`: required for `save`. Must be valid JSON.
84+
85+
## Notes
86+
87+
- `host.auth.get` returns the physical auth file JSON.
88+
- `host.auth.get_runtime` returns runtime credential metadata.
89+
- `host.auth.save` writes the JSON to the auth directory and upserts the runtime auth record.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module github.com/router-for-me/CLIProxyAPI/v7/examples/plugin/host-callback-auth-files/go
2+
3+
go 1.26.0
4+
5+
require github.com/router-for-me/CLIProxyAPI/v7 v7.0.0
6+
7+
replace github.com/router-for-me/CLIProxyAPI/v7 => ../../../..

0 commit comments

Comments
 (0)