Skip to content

majiayu000/spellbook / skills/cliproxy-newapi-stack

cliproxy-newapi-stack

Flagged

在已经过独立验证的 CLIProxyAPI upstream 之上部署 NewAPI 计费层,把 Codex/Claude/Gemini/Qwen 等订阅账号包装成可计费的 OpenAI 兼容 API。本 Skill 不负责新建裸 CLIProxyAPI;负责 NewAPI Docker 部署、容器到宿主桥接、模型计费倍率、参数化额度修正、多账号 OAuth 凭据热加载和双路径验证。当用户说“给现有 cliproxy 加 NewAPI”“配置 NewAPI 渠道接已运行的 cliproxy”“NewAPI 价格不对”“给现有部署加账号”“172.17.0.1 容器网络”或“408 冷却放大故障”时触发。

FileKindSize
SKILL.mdskill md10.0 KB
agents/openai.yamlconfig248 B
references/multi-account.mdmarkdown2.6 KB
references/newapi-pricing.mdmarkdown2.8 KB
references/troubleshooting.mdmarkdown2.9 KB
scripts/add_codex_account.shexecutablescript2.9 KB
scripts/deploy_newapi.shexecutablescript1.9 KB
scripts/lib/validation.shscript3.3 KB
scripts/set_pricing.pyexecutablescript5.8 KB
scripts/test_security_validation.shexecutablescript3.1 KB
scripts/topup.shexecutablescript1.8 KB
scripts/verify_stack.shexecutablescript4.9 KB

references/multi-account.md

View on GitHub
# Multi-Account Operations (CLIProxyAPI)

CLIProxyAPI auto-rotates across all credential JSON files in `auth-dir`. Adding accounts is
**file-system level** — no code, no restart.

## Add a new OAuth account

Use `scripts/add_codex_account.sh` (provider configurable) or do it manually:

1. **Local OAuth** (browser must be on the local machine):
   ```bash
   cd <CLIProxyAPI-local-clone>
   go run ./cmd/server -<provider>-login -config config.yaml
   ```
   - For each provider use the matching flag:
     `-codex-login` `-claude-login` `-qwen-login` `-iflow-login` `-antigravity-login` `-login`(Gemini)
   - **Critical**: log out of any previous account in the browser first, or use an incognito
     window — otherwise OAuth will silently re-bind to the existing session and overwrite the
     same credential file.

2. **Capture filename**:
   ```bash
   ls -lt ~/.cli-proxy-api/<provider>-*.json | head
   ```
   New file is named `<provider>-<email>-[ts].json`.

3. **Sync to VPS**:
   ```bash
   scp -i <KEY> ~/.cli-proxy-api/<file> root@<HOST>:/root/.cli-proxy-api/
   ```

4. **Watcher hot-loads it** — log lines:
   ```
   auth file changed (CREATE): <file>, processing incrementally
   auth file changed (WRITE):  <file>, processing incrementally
   ```
   No service restart needed.

## How load-balancing actually works

- Selector ranks accounts by availability + freshness; **does not** keep a strict round-robin.
- A single account can serve many requests in a row if others are cooled / unavailable.
- 429 / quota exhaustion marks an account temporarily unavailable; selector switches to peer.
- Routing distribution is therefore *load-aware*, not *fair-share*.

## Verify both accounts are recognized

After adding, scan the log:
```bash
grep -oE 'codex-[A-Za-z0-9._@+-]+\.json' /root/CLIProxyAPI/cli-proxy-api.log \
  | sort | uniq -c
```
You may see only the new account during the first batch — that means the older account is
under-quota or cooling. Force the older one to fire by waiting (cooldown expiry) or running
many requests; both should appear over time.

## Remove an account

1. `rm /root/.cli-proxy-api/<provider>-<email>.json`
2. Watcher logs `auth file changed (REMOVE): ...`
3. The selector drops it from the rotation immediately.

## Subscription required

OAuth login success ≠ usable. The account must hold a valid subscription:
- Codex / GPT-5 family → ChatGPT **Plus** or **Pro**
- Claude `claude-*` → Claude **Pro** or **Max** (depending on model tier)
- Gemini → corresponding Google AI Pro tier

Without subscription, OAuth completes and tokens save, but `/v1/chat/completions` returns 401 /
402. Always probe with one real request after sync.
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall