Saikel-Orado-Liu/dsh-cost-meter ↗★ 2

@gamegeek-saikel/dsh-cost-meter

Cost tracking plugin for the DeepSeek Harness Web GUI — snapshot-anchored per-turn pricing, account balance, and live cost estimates. 适合需要精确监控API调用成本、查看单次回复花费的用户。

Package
@gamegeek-saikel/dsh-cost-meter
Compatibility
Unverified
Harness peer range
^0.2.0-rc.2
Cordis peer range
^4.0.4
Version
0.5.0
License
MIT
Last updated
Sep 29, 2026

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Saikel-Orado-Liu/dsh-cost-meter

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 configuration pageplugins.row.configThe cost-meter row's page under 设置 → 插件 (DSH 0.2.0 hosts a plugin's own configuration there, keyed `
#): per-model overrides, OpenRouter aliases, cache-read discount, FX mode, toggles, and manual refresh. The editable fields are the schema's volatile()` ones — the deployment fields (endpoint, credential reference, refresh cadence, trusted hosts, history cap) stay hand-edited in the profile patch, which is exactly the split DSH's configuration projection can write

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.