cliproxy-newapi-stack — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited cliproxy-newapi-stack (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
把 OAuth 订阅账号 (codex/claude/gemini/qwen/iflow) 通过 CLIProxyAPI 暴露为 OpenAI 兼容 API,再用 NewAPI (calciumion/new-api) 在前面套一层计费/限流/多用户 token。 姊妹 skill cliproxy-deploy 只负责裸 CLIProxyAPI;本 skill 在其上加 metering 层并补全踩过的坑。
所有"完成"结论必须基于本会话命令输出(W-16)。价格和额度变更后必须真发一次请求并查 logs.quota 不为 0。
root@HOST 是否能免密CLIPROXY_PORT(默认 8317)、NEWAPI_PORT(默认 8200)<HOST>:<CLIPROXY_PORT> 跑通?没就先跑cliproxy-deploy skill
codex / claude / qwen / iflow / geminiBASE_URL 环境变量降级路径:默认走"本地 OAuth + scp 同步 + UFW 开 NewAPI 端口 + SQLite 直写价格"。
裸部署已在 cliproxy-deploy skill 完成;本 skill 不重复其内容,只补丁两个点:
/root/CLIProxyAPI/config.yaml: disable-cooling: true原因见 references/troubleshooting.md "CLIProxyAPI cooldown 原理"。 若漏改,30 并发 5KB payload 会出现混合 ~50% 503。
host: "" 仍可,但仅给容器访问,外部公网走 NewAPI 入口即可ufw allow <CLIPROXY_PORT> 想保留作为 admin 后门也行,但要换强 keySSH_TARGET=root@<HOST> SSH_KEY=~/.ssh/id_ed25519 NEWAPI_PORT=8200 \
scripts/deploy_newapi.sh脚本完成后 UFW 放行:
ssh -i <KEY> <SSH_TARGET> "ufw allow <NEWAPI_PORT>/tcp && ufw status | grep <NEWAPI_PORT>"首次访问 http://<HOST>:<NEWAPI_PORT> 完成 root 账号注册(NewAPI 不预置默认密码)。 保存账号密码到密码管理器(不要写进 skill / 日志 / 提交)。
NewAPI 后台 → "渠道" → 新建 → OpenAI 类型:
http://172.17.0.1:<CLIPROXY_PORT>⚠️ 不能写 `127.0.0.1` — 容器里的 127.0.0.1 是容器自己。详见 references/troubleshooting.md "容器网络速记"。
cpa_xxx keygpt-5.4,gpt-5.3-codex,gpt-5.3-codex-spark,gpt-5.4-mini,gpt-5.2
references/troubleshooting.md。NewAPI 后台 → "令牌" → 新建:
client-default 之类标识unlimited 或一个大数(实际计费由 user.quota 控制)sk-xxx(这是客户端的 BASE_API_KEY)用 scripts/set_pricing.py(基于实测 USD/1M 自动算出三个倍率):
SSH_TARGET=root@<HOST> SSH_KEY=~/.ssh/id_ed25519 \
scripts/set_pricing.py \
--model gpt-5.4 --input 2.5 --cached 0.25 --output 15 \
--model gpt-5.3-codex --input 1.75 --cached 0.175 --output 14脚本会:合并写入 options 表的 ModelRatio / CacheRatio / CompletionRatio,重启容器。
⚠️ 倍率语义见 references/newapi-pricing.md —— CacheRatio / CompletionRatio 是相对 输入价的倍数,不是绝对单价。ModelRatio 在不同 fork 里可能除以 2,第一次配置务必发请求 看 logs.quota 实际值匹配预期。
NewAPI 在线充值通常未配,最快走 SQLite 直写:
SSH_TARGET=root@<HOST> SSH_KEY=~/.ssh/id_ed25519 \
scripts/topup.sh <user_id> <quota>
# 例:1 1000000000 → 1B quota ≈ USD 2000 (默认 QuotaPerUnit=500000)如果要让用户自助充值,NewAPI 后台 → 系统 → 支付:
TopUpLink 等字段scripts/topup.sh) 是合法主路径把以下三行追加到客户端的 ~/.zshrc 或 ~/.bashrc:
export BASE_URL="http://<HOST>:<NEWAPI_PORT>/v1"
export BASE_API_KEY="<NEWAPI_TOKEN>" # sk-xxx
export BASE_MODEL="<虚拟模型名>" # 如 gpt-5.4source 一下生效。
跨多台机器同步时(W-14 文件归属):单台单台手动 SSH 改各自的 rc 文件,避免并行写覆盖。
不需要重启服务,CLIProxyAPI 有 file watcher。
最简单:
PROVIDER=codex \
SSH_TARGET=root@<HOST> SSH_KEY=~/.ssh/id_ed25519 \
CLIPROXY_LOCAL=<本地 CLIProxyAPI 仓库路径> \
scripts/add_codex_account.sh脚本流程:
go run ./cmd/server -<provider>-login -config config.yaml覆盖回去)
~/.cli-proxy-api/<provider>-*.json,把新文件 scp 到 VPSauth file changed (CREATE)详见 references/multi-account.md(含订阅条件、轮询语义、删除账号、验证方法)。
HOST=<HOST> SSH_TARGET=root@<HOST> SSH_KEY=~/.ssh/id_ed25519 \
CLIPROXY_PORT=<CLIPROXY_PORT> NEWAPI_PORT=<NEWAPI_PORT> \
CLIPROXY_KEY=<cpa_xxx> NEWAPI_TOKEN=<sk-xxx> MODEL=<虚拟模型> \
scripts/verify_stack.sh通过判定:
logs 里对应 request_id 行 quota > 0任一不满足都不得声称"部署完成"。
| 文件 | 用途 |
|---|---|
scripts/deploy_newapi.sh | NewAPI 容器一键部署 + 健康自检 |
scripts/set_pricing.py | 用 USD/1M 三参数自动写 NewAPI ratios |
scripts/topup.sh | 直接 SQLite 改 users.quota |
scripts/verify_stack.sh | 双路径 + 计费日志验证 |
scripts/add_codex_account.sh | OAuth 登录 + 同步凭据 + watcher 校验 |
agents/openai.yaml | 需要第二模型复核计费/部署方案时的 agent 配置 |
references/newapi-pricing.md | ModelRatio / CacheRatio / CompletionRatio / QuotaPerUnit 完整语义 + 计算示例 |
references/troubleshooting.md | 容器网络、cooldown、PUT 不生效、UFW 等踩坑表 |
references/multi-account.md | 多账号轮询语义 + 加号 / 删号 / 订阅条件 |
http://127.0.0.1:<port>(容器内自指)CacheRatio 当绝对单价(实际是相对输入的倍数)/api/option/ PUT 不验证(已知该接口可能静默失败)cpa_ key 和 NewAPI 的 sk- token 共享给同一类客户端logs.quotadisable-cooling: true 的情况下做高并发压测~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.