dsh-plugin-usage-budget: Convert token costs based on peak and off-peak pricing and stay within budget
DSH Usage Cost and Budget Plugin converts token usage into RMB amounts based on configurable peak-valley pricing, and provides session cost readings, per-turn prices, account balance, and daily/weekly/monthly budget alerts. On the Host side, it registers two session projections: `usageCost` and `usageBudget`. Usage events are priced based on the time period determined by their own settlement moments, with amounts written to `$DSH_HOME/usage-budget/ledger.json` and accumulated across all sessions. The interface utilizes the `conversation.composer.dock` slot and the `conversation.chat.turnTail` extension point, without modifying the official DOM. Default pricing overrides `deepseek-flash` and `deepseek-v4-pro` based on the DeepSeek official pricing page, with discount periods uniformly at 50% off. It supports installation from the plugin management page or manual bundling. Budget numbers are written to the usage budget in `cordis.patch.yml` or settings. MIT licensed; it tracks only settled usage, and the budget only alerts without intercepting sending.
Read More