DSH HUB
HomePlugin StorePlugin PacksCommunityRankingsResourcesPublish Guide
Plugin source
Back to catalog

lelens0 /

lelens0/dsh-token-ledger

Topic repository only

DeepSeek Harness plugin: monitor balance & usage across multiple LLM gateways, with balance history sparklines (token ledger)

★ 0 Stars0 Forks0 IssuesN/A Community rating0 Confirmed installs
View on GitHub
READMESource: main@6c3e47fa

dsh-token-ledger

Token 账本 —— 自动读取 DSH 现有供应商(provider)配置,监测多个 LLM 网关的 token 余额与用量,以简洁悬浮面板展示。

特性

  • 零配置读取供应商:直接读取 DSH 设置里的 llm-pi-ai.providers,无需重复填写 baseURL / key。
  • 多网关适配:自动按网关类型探测余额接口:
    • New API / One API(/api/user/self,quota → USD)
    • OpenAI 兼容(/dashboard/billing/subscription)
    • DeepSeek 官方(/user/balance,CNY)
    • 需账号登录的网关(HC / SupXH / Vyce,从 ~/.dsh/token-ledger.json 读取凭据)
  • 网络容错:直连失败的网关(如被墙的 vyceai.com)自动走本地代理(127.0.0.1:7890)CONNECT 隧道重试。
  • 登录缓存:60 秒轮询复用登录 session / token,避免频繁登录触发网关限流(429)。
  • 容错展示:密钥缺失、凭证失效、网络不可达都会以状态点 + 原因清晰呈现,不影响其它供应商。
  • 界面简洁:右下角悬浮球 + 可折叠卡片面板,60 秒自动刷新。

安全:API 密钥与登录凭据仅在 Host(Node)进程内取用,不暴露给浏览器端;代码中不含任何明文密钥。

账号凭据配置(可选)

需账号登录的网关(HC / SupXH / Vyce)需要配置账号密码才能查询余额。 创建 ~/.dsh/token-ledger.json(独立于 settings.yaml,避免 cordis settings 未注册 namespace 的问题):

{
  "hcnsec": { "username": "你的用户名", "password": "你的密码" },
  "vyce":   { "email": "你的邮箱", "password": "你的密码" },
  "supxh":  { "username": "你的用户名", "password": "你的密码" }
}

支持字段:username / email(三选一填写即可)+ password。凭据仅本地读取,不暴露给浏览器端。

支持网关

网关 余额接口 认证方式 单位
HC (api.hcnsec.cn) /api/user/self 账号登录 → session $USD
SupXH (speed.toter.me) /api/auth/login 账号登录 当日额度
Vyce (vyceai.com) /user/login 账号 + CSRF/PoW $USD
DeepSeek 官方 /user/balance API Key ¥CNY
任意 OpenAI 兼容 /dashboard/billing/subscription API Key $USD

安装

# 本地链接(开发)
dsh plugin --profile desktop add link:D:/DSH/plugins/dsh-token-ledger/pkg

# 或从 GitHub
dsh plugin --profile desktop add github:lelens0/dsh-token-ledger

安装后完全退出并重新打开 DSH Desktop 生效。

数据与安全

  • API 密钥仅在 Host(Node 进程)内部通过 credentials.resolve() 取用,用于调用余额接口,不暴露给浏览器端。
  • 余额快照与历史写入 ~/.dsh/.dsh-token-ledger.json。
  • 登录 session 缓存在内存中,重启 DSH 后清除。

License

MIT License - Copyright (c) 2026 lelens0

—/ 5

No ratings yet

Manifest verification required

Commit 6c3e47fae40d

Community comments

No comments yet. Be the first to write one.

DSH HUB

A community index for DSH plugins. Not an official GitHub or DeepSeek AI product.

CommunityResourcesAPIAbout