YZz-S/dsh-token-cost-meter

Real-time session token usage and estimated cost in the composer stats row, with pricing fetched from DeepSeek official pricing page.

Shows the current session's cumulative token consumption and estimated cost in CNY in real time in the stats line below the DSH input box, with prices fetched dynamically from the official DeepSeek pricing page every 6 hours (including peak/off-peak tables that auto-switch by Beijing time). Breakdown on hover: pricing model, input (cache-miss/cache-hit buckets), output, pricing mode, price source and fetch time. Falls back to a built-in price snapshot (prefixing with ≈) if the official page fetch fails; three-level model detection fallback (request provenance → requestConfig → Host agents.options.model); zero data egress — the only outbound request is the public pricing page.

Usage & Billing ★ 3 updated 2026-08-15
View on GitHub ↗

Install

dsh plugin --profile web add github:YZz-S/dsh-token-cost-meter

dsh plugin --profile web add github:YZz-S/dsh-token-cost-meter (repo declares dsh.bundle + dsh.client; no standalone npm package — npm 404 verified 2026-08-30), then restart DSH. A dynamic cordis_define form (host.js/client.js) is also kept for temporary runs — pick either one.

Compatibility

DSH web profile; reads the session projection tokenUsage (provider-reported cumulative usage — same source as DSH's built-in stats line); prices fetched from the official DeepSeek pricing page; MIT.

Details

Recent updates

Real-time session token + CNY cost stats line; official dynamic pricing with peak/off-peak switching; graceful degradation; three-level model detection; zero data egress.

FAQ

Where does usage come from?
The session projection's provider-reported tokenUsage — the same source as DSH's built-in stats line: cache-miss input, cache-hit input and output.
How fresh are the prices?
The host fetches and parses the official DeepSeek pricing page every 6 hours, including peak/off-peak tables that auto-switch by Beijing time.
Does it upload anything?
No — the only outbound request is the official public pricing page; usage is displayed locally and never uploaded or persisted.

Alternatives

YZz-S/dsh-billing-balance · Sttrevens/dsh-cost-meter · Ychris12138/dsh-usage-stats

More plugins in Usage & Billing

Browse more in Usage & Billing

Guides for Usage & Billing plugins