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.
Install
dsh plugin --profile web add dsh-cost-trackCopied 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
- Repo: hj01857655/dsh-cost-track
- Category: Usage & Billing
- Stars: 0
- Version: GitHub repo hj01857655/dsh-cost-track (0*, MIT); npm package dsh-cost-track at 0.5.1 (registry check 2026-10-15; the registry repository field resolves back to this repo). English README with zh/en dictionaries in the client.
Alternatives
940842546/dsh-usage-billing · AlfredChaos/dsh-usage-panel · dingyi222666/dsh-wakatime