When developing or using agents in DeepSeek Harness (DSH), monitoring API consumption is key to controlling costs. Existing tools often lack fine-grained session-level or turn-level billing views. This plugin provides that data directly in the Web interface, without the need to switch to external dashboards.
Plugin Positioning¶
This is a native-like billing plugin maintained by rayadesune. It integrates real-time DeepSeek account balance with estimated session, turn, and daily spending data into the DSH interface, addressing developers’ inability to intuitively understand costs within the conversation context.
Core Features¶
This plugin provides billing information across multiple interface locations in DSH:
- Session Header Badge
- Displays the account balance.
- Displays today’s total spending across sessions.
- Below the Composer
- Displays the billing cost for the current session.
- Message Action Row
- Displays the static cost amount at the end of a completed turn.
- Details Panel
- Displays today’s token counts and cache hit rate.
- Displays today’s session spending rankings.
- Displays billing bucket details for uncached input, cache reads, and output.
Installation and Configuration¶
Installing this plugin requires the following environment dependencies:
Node.js ^22.19 || >=24
pnpm@11.7.0
The license is MIT.
Usage Instructions¶
- View Balance and Total Spend: Enter any session. The session header displays the account balance and today’s total spend. Balance data is directly sourced from the
GET /user/balanceendpoint. - View Current Session Spend: Below the Composer input box, you can see the billing cost for the current session.
- View Turn Spend: After completing a conversation, the message action row displays the static cost amount for that turn.
- View Detailed Statistics: Open the session details panel to view today’s token statistics, cache hit rate, spend rankings, and detailed input/cache/output billing buckets.
- Manual Refresh: If you need the latest balance data, you can manually refresh the page.
Notes¶
- Data Nature: The balance is real account data, but session, turn, and daily spending are estimates based on official peak/off-peak rates, not billing commitments.
- Empty States and Errors: When no usage has been recorded, it displays “no usage recorded”; when the API key has no balance or an error occurs, it displays “Balance unavailable”.
- Environment Dependencies: This plugin depends on specific versions of Node.js and pnpm. Please ensure environment compatibility before installing.