with one click
new
配置 new-api 中转站信息(站点地址、认证令牌等)
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
配置 new-api 中转站信息(站点地址、认证令牌等)
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| name | new |
| description | 配置 new-api 中转站信息(站点地址、认证令牌等) |
| allowed-tools | ["Bash","Read","Write"] |
引导用户完成 new-api 额度查询的首次配置。不依赖任何外部 CLI 工具。
读取配置文件:
%USERPROFILE%\.claude-newapi-quota\config.json~/.claude-newapi-quota/config.json如果已存在且内容完整,告知用户当前配置的站点,并询问是要修改还是新增站点。
首先展示预置公益站点列表,让用户选择序号(可多选)或手动输入:
请选择站点(输入序号,或输入自定义地址):
1. 42公益站 https://api.42w.shop
2. 6655翻译小站 https://translate-api.6655.pp.ua
3. 霸气公益平台 https://ai.121628.xyz
4. 薄荷API https://x666.me
5. 冰の公益站 https://icoe.pp.ua
6. newapi.kl https://newapi.kl.edu.kg
7. 呆瓜API https://api.daigua.icu
8. WONG公益站 https://wzw.pp.ua
0. 手动输入自定义站点地址
用户选择后,用对应的名称和地址自动填入。如果选 0,让用户手动输入站点地址和名称。
依次逐个询问用户(不要一次性全问):
1(面板个人信息页可见)创建目录(如不存在)并写入 JSON 配置:
{
"sites": {
"<站点名称>": {
"base_url": "<用户提供>",
"auth_type": "access_token",
"access_token": "<用户提供的令牌>",
"user_id": <用户ID>,
"quota_per_unit": 500000,
"currency_symbol": "$"
}
},
"active": "<站点名称>",
"cache_ttl_seconds": 30,
"display": {
"low_balance_threshold": 1,
"show_used": true,
"show_requests": false,
"compact": false
}
}
如果已有配置,合并新站点到 sites 中,不覆盖已有站点(除非用户明确要修改)。
用 curl 测试:
curl -s -H "Authorization: Bearer <token>" -H "New-Api-User: <user_id>" "<base_url>/api/user/self"
如果返回包含 quota 字段,告知用户连接成功并展示当前余额。
如果失败,告知错误原因但不删除配置,让用户可以用 /newapi-setup 重新修改。
读取 ~/.claude/settings.json(Windows 为 %USERPROFILE%\.claude\settings.json)。
找到本插件安装路径下的 bin/cnq-statusline.js。
Windows 用:
dir /s /b "%USERPROFILE%\.claude\plugins\cache\newapi-quota-marketplace\newapi-quota\*\bin\cnq-statusline.js"
macOS/Linux 用:
ls ~/.claude/plugins/cache/newapi-quota-marketplace/newapi-quota/*/bin/cnq-statusline.js
拿到绝对路径后,将路径中的反斜杠 \ 全部替换为正斜杠 /,然后在 settings.json 中添加或更新 statusLine 字段(合并,不覆盖已有配置):
"statusLine": {
"type": "command",
"command": "node <绝对路径,用正斜杠>",
"padding": 0
}
示例(Windows):
"statusLine": {
"type": "command",
"command": "node C:/Users/xxx/.claude/plugins/cache/newapi-quota-marketplace/newapi-quota/0.1.0/bin/cnq-statusline.js",
"padding": 0
}
告知用户:
/newapi 随时查询额度/newapi-setup 修改配置或添加新站点配置 Opus 4.7 思维链回显(扩展思考 + 思考摘要 + 详细模式)
一键安装 Claude Code 完整中文语言包(UI界面 + AI回复 + 加载动画 + 提示语 + 注释 + commit 全中文化)
一键美化 Claude Code CLI 整体界面(主题、状态栏、显示风格、动效、全屏等)
配置 Claude 官方账户底部状态栏,实时显示 5h/7d 用量
配置智谱 GLM Coding Plan,设置 API Key 并启用底部状态栏实时显示用量
配置 MiniMax Token Plan,设置 API Key 并启用底部状态栏实时显示用量