LeslieWylie/dsh-gateway-billing

Per-conversation LLM billing display for the DSH web composer, for anyone self-hosting a New API / One API-compatible gateway.

dsh-gateway-billing is a per-conversation model billing display skill for DeepSeek Harness. It fetches a New API / One API-format price table from your configured gateway URL (auto-refreshing every 10 minutes), supports both token-based pricing (quota_type=0) and fixed per-call pricing (quota_type=1), walks every model-call node in the current conversation to fold usage (input/output/cache tokens) against the price table, and shows one line just below the DSH Web composer: total cost, the most recent model x calls, and input/output/cache tokens (multi-model conversations expand to per-model rows). It renders an unconfigured pricing URL and a failed fetch as distinct states (the former has no "click to retry"), and a model call with no matching price-table entry is counted and highlighted separately rather than silently treated as $0.

uncategorized ★ 1 updated 2026-08-17
View on GitHub ↗

Install

dsh plugin add dsh-gateway-billing

The recommended route is a manual profile install: clone the repo, add a link: dependency to the profile's package.json, add a gateway-billing entry with your gateway's pricingUrl to the profile's cordis.patch.yml, run pnpm install, then restart dsh. The README also documents the one-line form dsh plugin add dsh-gateway-billing "once published to npm"; the npm name dsh-gateway-billing was NOT found on the registry on 2026-09-30, so use the profile/link install. A config.pricingUrl is required -- without it the composer dock shows "not configured".

Compatibility

DeepSeek Harness Web UI. For anyone self-hosting an LLM gateway that exposes a New API / One API-compatible /pricing endpoint returning {data: [{model_name, quota_type, model_ratio, completion_ratio, model_price}, ...]}. Requires a config.pricingUrl on its own gateway-billing entry in the profile's cordis.patch.yml. Gateway-agnostic: no gateway URL is baked in. Fetch once, read many -- the price table refreshes and caches server-side every 10 minutes and the composer dock reads a snapshot over RPC.

Details

Recent updates

The README documents the required config table (pricingUrl only), the design principles (gateway-agnostic, failure is visible, fetch once/read many), a sanitization notice (generalized from an internal gateway-billing dashboard; the original hardcoded endpoint became a required config.pricingUrl and internal institution names/domains were removed), and points to CHANGELOG.md.

FAQ

How do I install dsh-gateway-billing?
Per the README the recommended route is a profile install: clone the repo, add a link: dependency and a gateway-billing entry with your pricingUrl to the profile's cordis.patch.yml, run pnpm install, then restart dsh. The npm name is not published, so use this form.
What does it need from my gateway?
A New API / One API-compatible /pricing endpoint returning {data: [{model_name, quota_type, model_ratio, completion_ratio, model_price}, ...]}; set that URL as config.pricingUrl. Without it the dock shows "not configured" rather than a misleading cost.
Does it show a cost when a model has no price?
No -- the README states an unpriced model call is counted and highlighted separately and never silently treated as $0, and a failed fetch and a missing config are distinct, visible states.

Alternatives

940842546/dsh-usage-billing · beizi6/dsh-opencodego-usage · bpc-oss/dsh-web-billing

More plugins in uncategorized

Browse more in uncategorized

Guides for uncategorized plugins