DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-billing-mini-tag

R

dsh-billing-mini-tag

Discovered

DeepSeek Harness 计费小 Tag

Machine translated

dsh-billing-mini-tag

license: MIT DSH plugin

English | 中文

Show the current session's spend (¥x.xx) in the composer statistics row, immediately to the right of the cache-hit pill. Amounts are priced from the official DeepSeek token quote.

dsh-billing-mini-tag usage example
the ¥1.47 on the right is this plugin

Install

dsh plugin --profile web add github:Refone/dsh-billing-mini-tag

Restart dsh web and refresh the Web GUI, then send a message. To pin a release instead of tracking main:

dsh plugin --profile web add https://github.com/Refone/dsh-billing-mini-tag/archive/refs/tags/v0.1.0.tar.gz

Update by running the same add command again. Remove with:

dsh plugin --profile web remove dsh-billing-mini-tag

The package ships plain JavaScript with no prepare script, so a GitHub install needs neither a build step nor pnpm's build-script authorization.

Installing from GitHub requires the host to read the repository. If your network cannot reach GitHub, install the npm-style tarball from the releases page once one is published.

What it shows

  • Session spend only. The tag totals the token usage recorded in the current session's durable log. It is not an account balance and not a cross-session total.
  • Live while you work. The browser half polls the host route once a second, so the number moves as steps complete without a page reload.
  • Immediately right of the cache-hit pill. The tag portals itself into the official statistics row instead of adding a second dock line, and it stays last even while the official pills mount and unmount.

How it works

The package ships two halves:

HalfEntryResponsibility
Hostsrc/index.js (. export)Serves GET /plugin-billing-mini-tag/cost?session=<id>, folds the session log per assistant step, and refreshes the official quote.
Browsersrc/client.js (./client export)Registers a dock entry and portals the ¥… tag into [data-composer-stats].

The host half:

  1. Fetches the official Chinese pricing page at startup and again on every message send, caching the last good quote. The request has an 8s timeout and a built-in quote is used until the first successful fetch (and when the page is unreachable).
  2. Folds assistant/attempt / assistant/message usage events per turn:step; a repeated step replaces its predecessor, and an llm/retry-started makes the retried attempt bill as a separate call. This mirrors DSH's own tokenUsage projection.
  3. Remembers which model actually served each step, so a mid-session model switch is priced at the right rate.
  4. Returns a rounded display string (¥0.00) plus raw tokens, per-model breakdown, quote source, and unknown-model names for debugging. Unknown sessions, unloaded logs, and failed quote fetches degrade to zero or the previous quote instead of throwing.

The route is same-origin only: it rejects cross-site callers and accepts header-less probes only from loopback. A companion debug route, GET /plugin-billing-mini-tag/quote, returns the cached quote and current prices. Nothing is sent anywhere except the pricing-page request itself; there is no telemetry.

Pricing

Prices are CNY per 1M tokens from the official page:

BucketHow it is charged
Cache hit (input read from cache)cache-hit price
Cache miss (uncached input)cache-miss price
Cache writecache-miss price
Outputoutput price

Peak windows are evaluated in Beijing time (no DST): Mon–Fri 09:00–12:00 and 14:00–18:00. Chinese public holidays are not modelled, so weekday windows are the best local approximation of the official peak definition. Models the quote cannot classify fall back to the deepseek-flash bucket, and the route's debug payload names them (unknownModels).

Requirements

  • A DSH web profile. The package declares engines.dsh as >=0.1.5-rc.3, the version it is developed and tested against.
  • Node.js 20 or newer.
  • React 18 is provided by the host (declared as a peer dependency); the plugin has no runtime dependencies of its own.
  • Network access to api-docs.deepseek.com for live quotes. Offline installs still work with the embedded quote.

Web profile only. The plugin needs the webServer service provided by the shipped web bundle. Installing it into a custom profile that only has dsh-base leaves the entry waiting for webServer, and DSH refuses to boot. Initialize custom profiles from the web template (dsh --profile <name> --from-default-profile web) or install into --profile web.

Development

There is no build step: both halves are plain ESM/JS, and the browser half is a hand-written module-loader wrapper that needs no bundler. pnpm pack ships src/, cordis.patch.yml, the READMEs, the changelog, the license, and the screenshot.

node scripts/check-release.mjs   # publishing requirements + module smoke test
pnpm pack --dry-run              # inspect the exact tarball contents

scripts/check-release.mjs verifies the four things the DSH ecosystem scans for: the dsh-plugin keyword, a copyable dsh plugin --profile web add … command in the README, an exported apply(ctx) module, and a resolvable dsh.bundle.patch bundle declaration.

.
├── src/index.js          # host half (apply, quote, session fold, HTTP route)
├── src/client.js         # browser half (dock entry + ¥ tag)
├── cordis.patch.yml      # bundle patch: inserts the plugin into a profile
├── scripts/check-release.mjs
├── docs/development-trace.md
└── showcase.png

License

MIT © 2026 Refone

Comments

Loading…

Similar plugins

dsh-plugin-starter

by ookami-change

Minimal installable plugin starter for DeepSeek Harness.

Manifest valid

★ 0

JavaScript

Aug 15, 2026

dsh plugin --profile web add dsh-plugin-starter

by FenZhenHua

DeepSeek Harness plugin: API 余额与本次会话费用(官方计费)

Manifest valid

★ 0

MIT

JavaScript

Oct 9, 2026

dsh plugin --profile web add @fenzhenhua123/dsh-balance-meter

by XGrin

A tiny DeepSeek Harness (DSH) plugin

Manifest valid

★ 3

MIT

JavaScript

Aug 22, 2026

dsh plugin --profile web add dsh-search-router

by jwilson411

A minimal, tested template for DeepSeek Harness plugins.

Development & InfrastructureManifest valid

★ 0

MIT

JavaScript

Sep 1, 2026

dsh plugin --profile web add dsh-plugin-kit

by 2006spy

DSH 实时 token 计费插件:官网人民币价直接计费、高峰/错峰自动切换、价格实时跟随官网、可视化自定义模型价格。Real-time token billing plugin for DeepSeek Harness (dsh web).

Tools & CapabilitiesTerminal & ClientsModels & ProvidersManifest valid

★ 4

MIT

JavaScript

Sep 11, 2026

dsh plugin --profile web add dsh-token-billing

by TheTianzz

DeepSeek Harness plugin: 账户余额 + 会话费用(/balance /cost 命令、deepseek_billing 工具、Web UI 双胶囊),官方价格每 12 小时自动同步

Models & ProvidersManifest valid

★ 6

↓ 78/wk

MIT

JavaScript

Aug 14, 2026

dsh plugin --profile web add dsh-billing