dsh-spend-receipt
Run the following command in DeepSeek Harness:
dsh plugin install jwilson411/dsh-spend-receipt
Paste the following prompt into your AI chat to install this plugin:
Run dsh plugin install jwilson411/dsh-spend-receipt in the DeepSeek Harness terminal to install the plugin; source: https://github.com/jwilson411/dsh-spend-receipt.
About this plugin
DeepSeek token invoices usually give you a single final number with no visibility into what happened underneath: how many tokens were served from cache, which calls landed in the peak window, which rate table applied. dsh-spend-receipt writes one append-only JSONL line for every token event a provider actually reports - the input and cache-hit counts, the dated rate table used, the peak or off-peak tier, and whether the timestamp came from the event itself or was recorded at write time. A reader can re-derive every cost independently without trusting any intermediary layer. When a call cannot be priced - unknown model, missing cache split, absent timestamp - the plugin keeps the token counts and sets usd to null rather than padding with zero or guessing a figure.
Pricing is done entirely in integer nano-USD, so a thousand-line receipt sums without floating-point drift. Peak windows are 01:00-04:00 and 06:00-10:00 UTC on weekdays; everything else is off-peak at half rate. Tier detection reads only the UTC instant, immune to whatever local-offset string the log carried. The spend_receipt tool returns the most recent N lines, full and windowed totals, cache-hit rate with its statistical basis, and a count of malformed lines - all from a local file read, no API key required. A standalone CLI exposes the same functions from a shell, so the receipt stays queryable even if the harness itself is down.
Built for teams and individual developers who need per-call cost auditing, cache-hit tracking, or a consistent billing view across CI pipelines and daily development. If you are tired of reverse-engineering invoices to figure out which calls actually cost money, this plugin makes every step reproducible.
Use Cases
- Per-call cost auditing of DeepSeek API usage with cache-hit verification
- Automatically recording and querying token consumption totals in CI pipelines
- Re-deriving the pricing basis for specific calls when investigating billing discrepancies
Best For
- AI application developers needing per-call cost audit trails
- Engineering teams keeping consistent billing data across CI and local development
- Independent developers who want to independently re-derive costs instead of trusting opaque invoices
Related Plugins
Free web search plugin for DeepSeek Harness with web search, X search, and page fetch; no signup or API key required, with automatic multi-engine failover.
AnySearch-powered web and vertical search plugin for DeepSeek Harness, offering real-time search, cleaned URL content, concurrent batch search via native web_search/web_fetch, no API key required.
Pixel-perfect webpage clone tool that uses an agent harness to turn any webpage into a scored, full-page React replica.
A bilingual cost-tracking plugin for DeepSeek Harness with session/daily cost, budget, official & custom provider balance, coding plan quotas, peak/off-peak pricing alerts, and history stats.