DeepSeek Harness Plugin Hub

Publish and manage complete Harness Profiles. Discover Plugins for your next setup.

Explore

PluginsPresetsDocsNews

Community

Publish a pluginContactReport an issue

Resources

Plugin Hub on GitHubDeepSeek HarnessSystem statusPrivacy notice
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

Independent and unofficial. Not affiliated with, authorized by, or endorsed by DeepSeek.

Cost Meter — DSH Plugin for DeepSeek Harness
DeepSeek Harness Plugin Hub
ProfilesPluginsCategoriesNewsDocsSign inManage Profiles
ProfilesPluginsCategoriesNewsDocsSign in
← Plugins

@gamegeek-saikel/dsh-cost-meter

Cost Meter

Cost tracking plugin for the DeepSeek Harness Web GUI — snapshot-anchored per-turn pricing, account balance, and live cost estimates.

The plugin will be installed here. Keep web if you are unsure.

npx -y @deepseek-ai/dsh plugin --profile web add @gamegeek-saikel/dsh-cost-meter@0.3.1
READMECompatibilityVersions

Compatibility and provenance

Cost Meter is published as @gamegeek-saikel/dsh-cost-meter and currently resolves to version 0.3.1. The Hub verifies its manifest and preserves the exact installation source for reproducible installs.

DSH compatibility
*
Runtime surfaces
web
Release source
npm
Registry updated
9/20/2026

Versions

0.3.1stable
9/16/2026
0.3.0stable
9/16/2026
0.2.1stable
8/23/2026
Show 7 more versionsCollapse versions
0.3.0-alpha.2prerelease
9/10/2026
0.3.0-alpha.1prerelease
9/9/2026
0.2.0stable
8/21/2026
0.1.3stable
8/17/2026
0.1.2stable
8/17/2026
0.1.1stable
8/16/2026
0.1.0stable
8/16/2026

Related plugins

Loading related plugins…

Latest
0.3.1
DSH
*
HMR
Process restart
Tree shaking
Safe tree shaking not declared
Unpacked size
829.2 kB
Files
83
Surface
web
License
MIT
Source
npm
GitHub
★ 3
Weekly downloads
427
Security scan
✓ v0.3.1 scan passed
Last push
9/16/2026
View source ↗Project homepage ↗
README badge

Click the badge to copy Markdown for your README.

Do you maintain this Plugin?Claim benefit · Priority security scan

Verify the GitHub repository declared in package.json to manage this listing. After you claim it, Hub will prioritize a security scan of the current version and publish the result when it passes.

Claim this Plugin →
Report an issue

Related plugins

More verified plugins in models-usage.

Usage@linxin666/dsh-usageUsage statistics plugin for the dsh web GUI: per-provider balance and coding-plan quota detection plus a live token usage ledger, with a dedicated pet bubble for the current providerWhale Widgetdsh-whale-widgetDeepSeek balance whale widget in the bottom-right corner of the DSH Web interface: balance/today’s usage/peak-off-peak pricing, customizable bubble click sequence (text/balance/today/peak-off-peak/image/random phrases and parallel weighted selection), per-line styles and fonts, floating quick editinUsage Stats@ychris12138/dsh-usage-statsToken usage heatmap, provider balances, and subscription quotas for the dsh web GUICodex Connectdsh-codex-connectChatGPT OAuth and Codex models for DeepSeek Harness.

README

DSH Cost Meter

English  ·  简体中文

DSH Cost Meter is a DeepSeek conversation cost-tracking plugin for the DeepSeek Harness (DSH) Web GUI — price-snapshot-anchored per-turn cost (peak/off-peak aware), account balance, a cost view tab, per-message cost chips, and a header pill with live streaming estimates. Every step's cost, price band, and snapshot version are computed once from the pricebook snapshot effective at the usage event's own time and then never recomputed — a later price change never rewrites an already-written conversation row.

  • Host half (src/): DeepSeek GET /user/balance query, the persisted snapshot-anchored pricebook, the sessionCost projection plus the pricebook-free sessionCostIndex message index, subagent cost aggregation, and the trust-fenced /cost-meter route.
  • Client half (src/client/): composer-dock readout, Cost tab, per-reply chip, header pill, and the plugin configuration card — in Simplified Chinese and English.

Installation

The plugin is published on npm as @gamegeek-saikel/dsh-cost-meter and ships as an official DSH plugin bundle (both halves — host and browser — are mounted by a single cordis.patch.yml row).

Install it into a web profile with the official DSH CLI (via npx — no global installation needed):

npx @deepseek-ai/dsh plugin --profile web add @gamegeek-saikel/dsh-cost-meter

Then start the harness:

npx @deepseek-ai/dsh web

If you have the DSH CLI installed globally, you can also use dsh instead of npx @deepseek-ai/dsh. To install into another profile, replace web with your profile name. The plugin declares and is verified against DSH ^0.1.5-alpha.1. The host half requires Node ^22.19.0 || >=24.0.0 and pnpm 11.7.0 for development.

Overview

Chat costs in DeepSeek pricing change over time (list prices, USD→CNY exchange, the 2026-08-17 peak/off-peak rollout, and the 2026-09-10 model rename to deepseek-flash with its V4.1-Flash price cut), and a conversation spans many turns with cache-hit, cache-miss, cache-write, and output token buckets. Naively recomputing costs at current prices makes history drift every time the price table changes.

Cost Meter solves this with an append-only pricebook: every price/fx/band-table change starts a new immutable PricebookSnapshot (monotonic version, effectiveAt), and each usage event anchors to the snapshot effective at its own time. The result is an immutable per-step cost ledger that only grows — it never mutates. Live streaming estimates are explicitly labeled 估算/estimate because they use current prices; they are replaced by the exact anchored value once the step settles.

Key Properties

PropertyValue
Cost anchoringAppend-only pricebook snapshots; step cost computed once at the event's own time
Price sourcesManual override > official pricing page > built-in fallback > OpenRouter (fallback only, USD→CNY) > none
Official pageParses the current 2026-09-10 combined zh/en tables (the deepseek-flash / deepseek-v4-pro columns with OFF-PEAK/PEAK cells per bucket row, and the English UTC schedule) as well as the earlier combined and legacy split tables; the retired deepseek-v4-flash and deepseek-v4-flash-vision-exp ids have no column of their own and bill at the Flash price, exactly as the page states. The built-in list still anchors single when the page no longer carries a pre-rollout table
Peak pricing2026-08-17 00:00 Beijing rollout; peak windows apply Monday–Friday only (the zh and en pages may state different timezones; fallback 09:00–12:00 / 14:00–18:00 Beijing), so Saturdays, Sundays, and all other hours are off-peak at half price
Cost formulaUncached input + cache reads (hit rate) + cache writes (billed at uncached input rate) + output, per 1M tokens, CNY
Account balanceOfficial GET /user/balance, cached 60 s, single in-flight request, trust-fenced route
Subagent supportEnumerates the conversation's durable subagent tree through subagents.listDescendants (nested delegations, settled children, and cold subagent sessions included, with no depth cap); a ledger is read from the resident session's projection when available and otherwise cold-restored from the child's stored log (sessionQuery.readSession + sessionProjections.restore), so historical subagent spend is also counted after a host restart; falls back to a BFS over the live agent tree when neither service is mounted
Conversation totalMain session + every descendant subagent (any depth); subagent totals still render while the main session's own ledger is not materialized
UI surfacesComposer dock · Cost tab · per-reply chip · header pill (live estimate) · settings card
LocaleSimplified Chinese (source) + English
ComplexityFully synchronous fold; O(1) price lookups via in-memory mirror

Usage

Once installed, the plugin contributes five browser surfaces (all text shown in Simplified Chinese by default):

SurfaceSlotDescription
Composer dock readoutconversation.composer.dockAnchored session spend + account balance, refreshed every minute; hover for the category breakdown and snapshot info
Cost view tabconversation.viewWhole-conversation totals (main + every subagent nesting level), category totals, the per-subagent list with its depth, and the per-reply anchored ledger
Per-reply cost chipconversation.chat.assistant-actionsThe anchored cost of one finalized reply as the row's own stat capsule — the same trigger + anchored dialog the shipped 用量 and 用时 capsules use (28px pill, hover fill, aria-expanded dialog above the trigger). It closes the row's stat run: after 用量 and 用时, before the timestamp, spaced by the row's own gap, and coloured by the band that priced it (green off-peak, red peak). The dialog lists the three billed categories, the band with its multiplier, the model, and the snapshot version; the slot hands over the message id, which the sessionCostIndex projection resolves to ledger coordinates (dash — when unpriced)
Header pillconversation.session.header.utilitiesAnchored total, or a live ≈ ¥x.xx (estimate) while streaming; click for the detail panel
Plugin cardsettings.plugin.itemPer-model overrides, OpenRouter aliases, cache-read discount, FX mode, toggles, and manual refresh

The /cost-meter host route serves the balance snapshot, the pricebook view, and the subagent totals over GET, and applies manual refresh over POST ({"action":"refresh"}). Like the /api fence, the route only answers requests whose Host header names a loopback address or a declared trusted host — the DNS-rebinding-safe check.

Pricebook & Snapshot Anchoring

The pricebook (src/pricebook.ts) is the durable price source, persisted on the pricebook storage-domain global slot:

  • Priority chain — per canonical model key (provider/model, bare model, or the flash/pro pricing key for DeepSeek-family models): manual override > official page > built-in fallback > OpenRouter (fallback only, USD→CNY, cache reads at the configured discount) > none.
  • Snapshot selection — snapshotForTime picks the newest snapshot with effectiveAt <= event time (pre-install sessions anchor to the first snapshot once).
  • Peak/off-peak — before the 2026-08-17 rollout all steps price at the single list price; after it, the band is chosen by the EVENT's own time against the schedule of the pricebook's own page (the zh and en pages each parse their own peak windows — the redesigned English page states UTC — falling back to Beijing 09:00–12:00 / 14:00–18:00, everything else off-peak). The official pages restrict peak windows to Monday–Friday, so Saturdays and Sundays are off-peak all day in the schedule's own timezone. When the combined page has no legacy single-price column, single keeps anchoring to the built-in historical list; a page that still carries a separate legacy table wins. Each step's band is anchored once at fold time, so the per-reply cards and chips always show the band that round was billed at — never the band of the moment you are looking.
  • Immutable ledger — the sessionCost projection (src/session-cost-projection.ts) folds request/header (model) and usage-carrying events into per-step rows; a second usage sample for the same (turn, step) replaces the first (same-step finalization, not a re-price), with O(1) incremental totals. The companion sessionCostIndex projection (src/session-cost-index.ts) maps each finalized assistant-message id to its ledger coordinates; it reads no pricebook and computes no cost, so folding it can never re-price a session.

Project Structure

src/
  index.ts                      # Host entry: apply() wiring, balance, route, trust fence
  types.ts                      # Wire/public vocabulary + projection-map merge
  pricing.ts                    # Official pricing-page parser, peak pricing, Beijing bands
  pricebook.ts                  # Append-only snapshots, priority chain, storage domain
  session-cost-projection.ts    # sessionCost projection (immutable per-step ledger)
  session-cost-index.ts         # sessionCostIndex: message id → ledger coordinates
  subagent-cost.ts              # Subagent cost aggregation (durable tree + live-registry fallback)
  invariant.ts                  # Route-disposer symmetry invariant companion
  client/                       # Browser half: 5 slot components + math/format/locales
shared/
  tsdown.client.ts              # Shared tsdown preset (CSS Modules, module table, purity gate)
  web-platform.ts               # Browser platform module list
tests/                          # Hermetic vitest suites (network stubbed)
cordis.patch.yml                # Web-profile plugin row (mounts both halves)

Development

pnpm install
pnpm typecheck   # tsc -b (src only)
pnpm test        # vitest run (hermetic, network stubbed)
pnpm build       # tsc -b && tsdown (lib/ + lib/client.js)

The test suites are fully offline: pricing-page HTML, OpenRouter models, and the FX endpoint are all stubbed. Tests cover the trust fence, balance parsing, the pricebook priority chain and snapshot selection, the immutable ledger fold (including same-step replacement and peak/off-peak band selection at the event time), the subagent aggregation (nested and cold children, listing-failure fallback, and a multi-level chain over a real SessionStore plus projection registry), and the client surfaces (jsdom).

Documentation

  • src/pricing.ts, src/pricebook.ts, src/session-cost-projection.ts, src/session-cost-index.ts — detailed module docs on parsing, anchoring, and the ledger contract
  • README.zh-CN.md — 简体中文版本

License

This repository (source, tests, README, and the DSH plugin bundle shape) is licensed under the MIT License — see LICENSE.

Copyright (c) 2026 Saikel-Orado-Liu aka GameGeek-Saikel