Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/majiayu000/spellbook/cliproxy-newapi-stacknpx skills add majiayu000/spellbook --skill cliproxy-newapi-stackgit clone --depth 1 https://github.com/majiayu000/spellbookWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/majiayu000/spellbook/cliproxy-newapi-stack)<a href="https://agentmods.dev/skills/majiayu000/spellbook/cliproxy-newapi-stack"><img src="https://agentmods.dev/badge/skills/majiayu000/spellbook/cliproxy-newapi-stack.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00171 | $0.03083 |
| Opus 5 | $0.00086 | $0.01541 |
| Sonnet 5 | $0.00034 | $0.00617 |
| Haiku 4.5 | $0.00017 | $0.00308 |
Grade C, and why
cliproxy-newapi-stack scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Reaches for credential fileshighPrivilege escalation
SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.
SSH_TARGET=root@<HOST> SSH_KEY=~/.ssh/id_ed25519 PORT=8200 \ How it starts
The opening of the file, as written. The whole thing — 235 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLIProxyAPI + NewAPI Metering Stack
在用户已有并已验证的 CLIProxyAPI upstream 前增加 NewAPI
(calciumion/new-api) 计费、限流和多用户 token 层。本 Skill 不安装裸
CLIProxyAPI,也不调用其他部署 Skill 补齐这个前置条件。
所有"完成"结论必须基于本会话命令输出(W-16)。价格和额度变更后必须真发一次请求并查
logs.quota 与本次请求的 token 数和目标价格相符。
Operating Contract
- Direct actions: 只读检查、配置备份和本地 dry-run 可直接执行。
- Escalate before: 安装容器、修改既有 upstream、重启服务、改防火墙或写生产额度前必须取得本次任务的明确授权。
- Evidence-backed pushback: 密钥只从环境变量或密码管理器读取;要求明文落盘或公网暴露原始端口时,展示具体风险并改用 tunnel/TLS。
- Feedback loop: 每次变更后重跑 upstream、NewAPI 和精确计费验证;任一步骤无法取得真实状态时停止并报告,不用默认值伪造成功。
0. 前置确认(必问)
- SSH 目标:
root@HOST是否能免密 - 端口分配:
CLIPROXY_PORT(默认8317)、NEWAPI_PORT(默认8200) - upstream 证据:CLIProxyAPI 已在目标主机运行,当前会话能通过用户批准的 SSH tunnel 或 loopback 请求验证健康、模型列表和认证;证据不足就停止,不猜测、 不自动安装裸 upstream
- 登录账号供应商:
codex/claude/qwen/iflow/gemini - 价格输入格式:每个虚拟模型给我 input / cached / output 三个 USD per 1M 数字
- 客户端机器:要在哪些机器上落
BASE_URL环境变量
安全默认:本地 OAuth + scp 同步;NewAPI 仅绑定 VPS loopback,通过 SSH tunnel 完成首次注册。公网访问必须走已配置 TLS 的反向代理,不能直接开放 NewAPI 原始 HTTP 端口。
Phase 1 — 验证现有 CLIProxyAPI upstream
先记录现有服务的进程、监听地址、健康响应、模型列表和配置备份位置。任何一项 无法验证都停止。只有用户在当前消息批准修改这个既有 upstream 时,才执行以下 两个补丁:
-
加稳定性开关到
/root/CLIProxyAPI/config.yaml:disable-cooling: true原因见
references/troubleshooting.md"CLIProxyAPI cooldown 原理"。 若漏改,30 并发 5KB payload 会出现混合 ~50% 503。 -
不要把 CLIProxyAPI 端口暴露到公网(与裸部署不同):
- 先用
ip -4 addr show docker0确认 Docker bridge 地址,再把host绑定到该地址(常见值为172.17.0.1) - 删除已有的公网
ufw allow <CLIPROXY_PORT>/tcp;管理访问统一走 SSH tunnel,不保留公网 admin 后门
- 先用
Phase 2 — 部署 NewAPI 容器
IMAGE='calciumion/new-api@sha256:<VERIFIED_DIGEST>' \
SSH_TARGET=root@<HOST> SSH_KEY=~/.ssh/id_ed25519 PORT=8200 \
scripts/deploy_newapi.sh
脚本只绑定远端 127.0.0.1:8200。首次注册前保持防火墙关闭该端口,建立
SSH tunnel:
ssh -N -L 8200:127.0.0.1:8200 -i <KEY> <SSH_TARGET>
仅访问本机 http://127.0.0.1:8200 完成 root 账号注册,并把密码保存到密码
管理器。注册和登录验证成功后,再配置带 TLS 的 Caddy/Nginx 反向代理;先
验证 HTTPS、认证和来源限制,再按需开放 443/tcp。禁止开放 <NEWAPI_PORT>。
What ships with it
11 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- agents/openai.yaml 248 B
- references/multi-account.md 2.6 KB
- references/newapi-pricing.md 2.8 KB
- references/troubleshooting.md 2.9 KB
- scripts/add_codex_account.sh 2.9 KB runs code
- scripts/deploy_newapi.sh 1.9 KB runs code
- scripts/lib/validation.sh 3.3 KB runs code
- scripts/set_pricing.py 5.8 KB runs code
- scripts/test_security_validation.sh 3.1 KB runs code
- scripts/topup.sh 1.8 KB runs code
- scripts/verify_stack.sh 4.9 KB runs code
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 235 lines · 171 tokens per session scan C 23ec1657f9df
cliproxy-newapi-stack is a skill published in the GitHub repository majiayu000/spellbook (265 stars, last pushed 4d ago), licensed MIT. It adds 171 tokens to every session and 3,083 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it C with 1 finding (reaches for credential files). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
general-video
The fallback workflow for authoring custom HyperFrames video compositions at any length or format — longer or multi-scene pieces, brand / sizzle reels, montages, title cards, static loops, and freeform compositions. Input- and length-agnostic. If a specialized workflow clearly fits the input — a marketed product, a…
session-scan
Compute metrics for Claude Code sessions. Discovers via ccrider, filters trivial, computes friction/opportunity/fingerprint scores. Use for broad session triage.
vc-autopilot
Emit and validate the provisional goal block for Autopilot Mode. Owns the 9-field format and resume detection from a pasted goal block.
manage-schemas
Creates, views, edits, deletes, and validates note schemas for the MCP Task Orchestrator in .taskorchestrator/config.yaml — the templates that define which notes agents must fill at each workflow phase. Also recommends schema designs from a library of workflow patterns (autonomous coding loops, spec-driven teams…
vc-audit-vc
Audit agent harness health: Claude/Codex agent parity, skill registry consistency, README.md sync, and protocol file wiring. Use when agents, skills, README.md, or development-protocol files move, split, or drift.
lov-env-management
统一管理平台、账号与多组 API Key,维护有效期和启用状态,安全同步到 zsh 或用户会话环境,并提供脱敏 Dashboard;用户说“管理环境变量”“rotate API keys”时使用。.