ccs-balance
Manifest valid★ 3Sync cc-switch provider balances and track token usage & cost by day/month/total with relay-aware currency settings.
ccs-balance
DSH 插件:同步 cc-switch 各 provider 的余额,并统计 DSH 会话的 token 用量与花费。
功能
- 余额页:拉取 cc-switch 中每个 provider 的余额(支持 newapi / general / DeepSeek / OpenAI / Moonshot / SiliconFlow),支持每个 provider 独立币种(¥ / $)与全局 USD→CNY 汇率。
- 用量页:按日 / 按月 / 总量统计输入、输出、缓存读、缓存写 token 与花费;按日视图支持近 7 天 / 近 30 天 / 全部;堆叠柱状图 + 模型构成。
- 会话页:按会话统计 token 用量与花费,支持搜索、排序;加载全部会话并直接滚动查看,不再展开单条详情。
- 面板尺寸:余额 / 用量 / 会话三个页面高度均固定为 500px,内容超出时在面板内滚动。
安装
dsh plugin add ccs-balance
或手动加到 profile 依赖:
{ "dependencies": { "ccs-balance": "^1.0.0" } }
并在 dsh.profile.bundles 里加入 "ccs-balance"。
数据来源
- 余额:cc-switch 数据库中的 provider 配置,通过各中转站 API 查询。
- 用量与花费:cc-switch 的
usage_daily_rollups与proxy_request_logs(中转站实际扣费),缺失时回退按model_pricing估算。 - 会话列表:DSH session store。
使用说明
- 安装并启用插件后,侧边栏底部会出现「CCS 余额」入口。
- 余额页底部有使用说明(点 ⚙ 展开)。
- 花费默认显示为元(¥)。如果你的中转站是真实美元计费,把余额页的 USD→CNY 汇率改成相应值(如 7.2);USD 当元的中转站保持 1。
配置
- 插件设置保存在插件目录
settings.json。 - 每个 provider 的币种(¥/$)在余额页 provider 名旁下拉框设置。
开发
node --check lib/index.js
node --check lib/client.js
python -m py_compile lib/ccs_host_helper.py
License
MIT
FAQ
- 余额显示为 0 或负数?说明该中转站余额查询失败或已透支,检查 provider 配置和 API key。
- 花费显示为 0?可能该会话没有 cc-switch 流水记录,或模型未命中定价表。
- 汇率改了没反应?切到其他标签页会自动重新计算。
Versions
| Latest version | Published | Size |
|---|---|---|
| 1.0.0 | — | — |
| 1.0.1 | — | — |
| 1.0.2 | — | — |
| 1.0.3 | — | — |
Comments
Loading…
Similar plugins
by a981008
CC Switch bridge for DeepSeek Harness: mirrors cc-switch providers and models into DSH, and shows each provider quota or balance.
★ 0
MIT
TypeScript
Sep 18, 2026
dsh plugin --profile web add dsh-switchby Andrew111888
A floating credit/quota widget for the DeepSeek Harness Web: shows DeepSeek / OpenCode Go balances and usage, and tracks DSH session token usage and estimated cost by day, month, and model.
★ 6
↓ 206/wk
BSD-3-Clause
JavaScript
Aug 26, 2026
dsh plugin --profile web add dsh-plugin-balanceby jsoncode
余额与费用查询插件,支持多账号查询,实时token实时统计,中英双语,界面交互直观、开箱即用
★ 0
JavaScript
Sep 11, 2026
dsh plugin --profile web add dsh-get-balanceDeepSeek account balance and model cost tracking with official peak/off-peak pricing, three-tier token billing (cache miss, cache hit, output), per-model and per-session breakdowns, a composer summary
★ 0
dsh plugin --profile web add dsh-balance-and-costPersistent provider-reported token usage totals with per-session, per-model, and daily activity statistics.
★ 0
↓ 279/wk
dsh plugin --profile web add dsh-token-usage-counterPer-model token cost tracking with configurable cache-hit/miss, output and peak-window pricing, a live session cost bar, and unconfigured-model flags.
★ 0
dsh plugin --profile web add dsh-cost-tracker