DeepSeek Harness plugin

dsh-billing-nianpangzhi233

DSH Web GUI 实时计费监控插件:实时统计本机模型调用用量与费用,按供应商/模型单价计费(DeepSeek v4 峰谷价),余额锚定、官方单价同步、低余额告警、账本 JSON 持久化。侧边栏余额 pill + 概览面板 + 设置页「计费」分段 + Agent 工具 billing_balance。热插拔:放入 profile node_modules 并在 dsh.profile.bund

Jump to install

Source facts

Repository
nianpangzhi233/dsh-billing
Latest update
Aug 15, 2026
Category
Workflow & Automation
GitHub stars
3
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/nianpangzhi233/dsh-billing
Plugin: dsh-billing-nianpangzhi233
Author: nianpangzhi233

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer4 files
README.en.mdSource · read only
README language

dsh-billing — Realtime billing monitor for the DSH web GUI

A billing monitoring plugin for DeepSeek Harness (DSH) web GUI: tracks local model-call usage and cost in real time, prices by provider/model (DeepSeek v4 peak/off-peak), and supports balance anchoring, official price sync and JSON ledger persistence. Built entirely on the official interfaces and the client slots system — no DSH source changes.

Features

FeatureDescription
Realtime balanceBalance pill at the sidebar footer, refreshes every 2 seconds; status dot (healthy / low / exhausted, blinks on alert)
Overview panelClick the pill to expand it inside the sidebar: spent / calls / input / output tokens plus recent ledger rows (peak/off-peak tags); auto-collapses when the sidebar collapses; in the collapsed rail the pill becomes a dot that expands the sidebar on click
Provider pricingMatching order: provider+model → same model under any provider → provider default → global default. DeepSeek v4 models use peak/off-peak pricing from 08-17 (peak = Beijing 9–12, 14–18; off-peak at half price); cache-hit input is billed at the low rate
Official balance syncFill in a DeepSeek API key and pull the official balance in one click via GET /user/balance (total / granted / topped-up) with automatic anchoring; manual paste anchoring also supported
Official syncOne-click fetch of DeepSeek official model prices (built-in base prices + persisted overrides merged)
Settings pageDSH Settings → "计费" (billing) section: balance, low-balance threshold, default prices, per-provider price table, data management
Agent toolbilling_balance: query balance, cost, token usage and per-model breakdown
PersistenceLedger JSON atomically written in the workspace; auto-restored after DSH restart (balance, prices, ledger)

Screenshots

![Sidebar balance pill and overview panel](docs/screenshots/demo-1.png)

![Billing monitor UI](docs/screenshots/demo-2.png)

Installation

The package ships pre-built plain JS (lib/) with no build step, so a git install works as-is (no prepare script, no build authorization needed):

# from this repository
dsh plugin --profile web add github:nianpangzhi233/dsh-billing

# or from a local checkout / tarball
dsh plugin --profile web add ./dsh-billing
dsh plugin --profile web add ./dsh-billing-0.1.0.tgz

Restart dsh web afterwards: the balance pill appears at the sidebar footer (above the Settings button), the "计费" section appears in DSH Settings, and the agent gains the billing_balance tool.

Configuration

DSH Settings → "计费" section (or the expanded sidebar pill panel):

  • Balance: DeepSeek API key (sk-…) for one-click official balance sync

(total / granted / topped-up; the endpoint is rate-limited to ~1 req/min), manual paste anchoring, initial balance, low-balance alert threshold (default ¥20)

  • Pricing: default price for unknown providers (¥ / 1M tokens) plus a

per-provider/model price table (add/remove rows); "sync official prices" fetches the DeepSeek price list in one click

  • Data: ledger path and save time, save config, reset usage (double-click

to confirm)

Data

  • Ledger file: .dsh-billing-ledger.json (workspace directory preferred,

spRoot fallback), v2 shape: config (initial balance / threshold / API key / nested price table) / usage (token split counters) / ledger (per-call rows with peak/off-peak rate) / startedAt

  • Price matching: provider+model → same model under any provider → provider

default → global default

  • Peak pricing: peak = Beijing 9–12, 14–18; otherwise off-peak (half price);

applies to deepseek v4 models from 08-17

Notes

  • Only this machine's DSH model calls are metered; the official balance

includes other channels, so re-sync it periodically.

  • The API key is stored in plain text in the local ledger file (same trust

model as ~/.dsh/dsh-ssh.json, file mode 0600); sync requests go only to api.deepseek.com and only balance fields are kept.

  • Token usage is counted split: cache-miss input (inputTokens), cache-hit

input (cacheReadTokens), output (outputTokens).

  • Billing is an estimate; rates follow the official DeepSeek price list.

"Sync official prices" requires a usable platform web provider.

  • Routes /api/dsh-billing/* are loopback-only (same-origin checked).

License

[MIT](LICENSE)