yyb16yyb-hub/dsh-deepseek-usage

Plugin插件 Native原生 ⭐ 2 MIT Usage & Cost用量与计费

DeepSeek Harness 的实时 DeepSeek API 使用情况:余额、Token 统计、预估费用——Web UI 停靠栏 + 设置面板 + 模型工具。

Project Overview项目介绍

This is a native DeepSeek Harness plugin built exclusively for tracking DeepSeek API usage and costs. It pulls real-time balance data from DeepSeek’s official API, supports aggregating balances across multiple API keys, tracks token usage across different time windows, and calculates estimated costs based on peak and off-peak pricing for DeepSeek models. It can be installed directly via the DSH CLI with the command dsh plugin --profile web add github:yyb16yyb-hub/dsh-deepseek-usage. After installation, you will need to restart dsh web for the plugin to load correctly, as the client module table is only scanned at boot time.

Once loaded, the plugin adds a live stats dock under the conversation composer that updates automatically to show current balance and usage. Users can also navigate to the dedicated “DeepSeek usage” settings panel from the sidebar to view more detailed data, including daily usage heatmaps, 30-day usage bars, per-session usage breakdowns, and configurable pricing tables. You can also export all historical usage data as a CSV file for offline analysis if needed. The plugin also lets the DSH agent query balance and usage on demand via the deepseek_usage model tool. It is ideal for any DSH user that uses the DeepSeek API, especially those who want to keep close track of their API spending.

The plugin is released under the permissive MIT open source license. When installing for the first time from GitHub, users will need to add a build authorization entry to their pnpm-workspace.yaml file, because pnpm 10 and newer block build scripts for git-hosted dependencies by default. The plugin only tracks usage for DeepSeek API, and does not support other API providers. API keys never leave the host server and are never sent to the browser frontend, improving security for your credentials. Daily usage data is persisted to a local JSON file for long-term tracking and trend analysis across application restarts, and the UI adapts to both dark and light themes.

这是一款专为 DeepSeek Harness 开发的原生插件,核心功能是实时展示 DeepSeek API 的使用情况与费用消耗。它支持轮询 DeepSeek 官方接口获取账户余额、支持多 API 密钥的余额聚合、实时统计各类 Token 使用量,还可按模型的峰值/非峰值定价估算成本,同时提供了 Web UI 停靠栏和专用设置面板,可通过 DSH CLI 命令直接安装。

安装完成后重启 DSH Web 即可启用,用户可在对话编辑栏下方看到实时的余额和使用统计,也可进入侧边栏的设置面板查看详细的历史使用热力图、30天使用柱状图、按会话的使用统计,还支持导出 CSV 格式的历史数据。它适合所有使用 DeepSeek API 的 DSH 用户,尤其适合需要控制 API 成本、关注用量变化的开发者和普通用户。

该插件采用 MIT 许可证开源,首次通过 GitHub 安装时,需要在配置文件中添加构建授权才能完成安装,因为 pnpm 10 及以上版本默认禁止运行 Git 依赖的构建脚本。它仅支持追踪 DeepSeek API 的使用,不支持其他服务商,API 密钥始终保存在服务端,不会发送到前端浏览器,每日使用情况会持久化存储在本地文件中。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:yyb16yyb-hub/dsh-deepseek-usage

把 yyb16yyb-hub/dsh-deepseek-usage 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-deepseek-usage

English | 中文

A DeepSeek Harness plugin that shows real-time DeepSeek API usage.

  • 💰 Account balance — polls the DeepSeek /user/balance endpoint (default every 30s): total / granted / topped-up balance and availability, with multi-key aggregation (apiKeys)
  • 📊 Usage stats — real-time request counts and tokens (input / output / cache-read / cache-write / reasoning) via the llm/stream waterfall, in three windows: total / today / last-60s, with the cache-hit rate
  • 💾 Persistent history — daily usage survives restarts (~/.dsh/deepseek-usage/usage.json), powering the trend charts and CSV exports
  • 💸 Estimated cost — per-model pricing (built-in deepseek-chat / deepseek-reasoner table, overridable via config), computed per window, with peak/off-peak pricing (offPeakHours / offPeakDiscount)
  • 🖥️ Web UI dock — a live stats line under the composer (conversation.composer.dock), auto-refresh + manual refresh
  • ⚠️ Low-balance alerts — dock turns amber below the threshold (default 20) and red below threshold/5, with one browser notification per threshold crossing; optionally block LLM requests while below the threshold (blockOnLowBalance)
  • 📋 Settings usage panel — settings.section seat: balance card + per-key accounts, three-window usage, in-panel config editor (writes back through the host), history heatmap & 30-day bars, per-model pricing table, per-session usage table, and CSV exports
  • 🛠️ Model tool — deepseek_usage, so the agent can query balance and usage on demand
  • ✅ Tests & CI — vitest unit tests and a GitHub Actions pipeline (typecheck + test + build)

Install

From GitHub (recommended)

dsh plugin --profile web add github:yyb16yyb-hub/dsh-deepseek-usage

⚠️ First install requires build authorization: pnpm ≥ 10 refuses to run prepare scripts of git-hosted dependencies (the plugin builds lib/ from source at install time). The first add fails with a hint — copy the exact package key pnpm prints into that profile's pnpm-workspace.yaml, then re-run:

allowBuilds:
  dsh-deepseek-usage: true

Pin a commit for reproducible installs: dsh plugin --profile web add github:yyb16yyb-hub/dsh-deepseek-usage#<sha>.

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-pi-tui 下一个 Next dsh-git-memory →