hj01857655/dsh-cost-track

dsh-cost-track records and prices every model call your agent makes - prompt and completion tokens plus model id - into an append-only .cost/ledger.jsonl, supports monthly budgets that can warn or block calls, time-range and per-session queries, and a Settings panel with spend, per-model breakdown and a budget bar.

dsh-cost-track tracks token spend and enforces budgets for every model call a dsh agent makes. Each call's prompt tokens, completion tokens and model id are priced and appended to an append-only .cost/ledger.jsonl, with time-range queries (today, this week, this month or an arbitrary date range) and a per-session breakdown showing which conversation burned the most tokens. A Cost page inside Settings shows today's and this month's spend with a progress bar against the budget, a per-model token and cost breakdown, recent sessions ranked by cost and the budget status (OK / warning / exceeded) with an enforcement toggle. A CLI works without dsh for a spend summary, setting a monthly budget with enforcement, or recording a usage line manually.

Usage & Billing ★ 0
View on GitHub ↗

Install

dsh plugin --profile web add dsh-cost-track

Copied verbatim from the README's Install block; the README also documents dsh plugin --profile web add github:hj01857655/dsh-cost-track from source.

Compatibility

Data lives in an append-only .cost/ledger.jsonl, and a built-in price table covers DeepSeek's models (deepseek-chat prompt $0.14 / completion $0.28 per million tokens; deepseek-reasoner $0.55 / $2.19) with per-model overrides readable from .cost/pricing.json. Budget enforcement is opt-in: a monthly limit warns by default, and with enforce: true subsequent model calls are blocked once cumulative spend crosses the threshold. The panel is served from GET /api/cost-track.panel and rebuilt from the ledger on every request, so it always reflects what is on disk; a headless host has no web connection and simply skips the route.

Details

Alternatives

940842546/dsh-usage-billing · AlfredChaos/dsh-usage-panel · dingyi222666/dsh-wakatime

More plugins in Usage & Billing

Browse more in Usage & Billing

Guides for Usage & Billing plugins