DeepSeek Harness plugin

dsh-token-price

Live token cost + account balance readouts for the DeepSeek Harness Web UI

Jump to install

Source facts

Repository
spoon-man569/dsh-token-price
Latest update
Aug 16, 2026
Category
UI Enhancements
GitHub stars
2
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/spoon-man569/dsh-token-price
Plugin: dsh-token-price
Author: spoon-man569

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer4 files
README.mdSource · read only
README language

dsh-token-price

<!-- README-I18N:START -->

English | 汉语

<!-- README-I18N:END -->

Accurate token-cost and account-balance readouts for the DeepSeek Harness Web chat UI.

What it shows

  • Per-message cost: the cost for completed request steps in that turn, shown as ¥... after each assistant reply's statistics line on hover.
  • Session total: the sum of every reported request step, including a cancelled request that emitted usage but no final assistant message.
  • Estimated CNY: a market-rate USD/CNY conversion shown as ¥.... USD is not rendered in the UI. This is not an account debit or official per-request CNY charge.
  • Account balance: the official GET /user/balance result. The plugin prefers the returned CNY balance and otherwise preserves the API's returned currency.

USD remains the internal accounting value. An unknown provider/model route is shown as 未定价, never as a zero-cost amount.

Install

One command (requires pnpm):

dsh plugin --profile web add dsh-token-price

The package declares dsh.bundle and dsh.client, so this activates both the host service and browser readouts.

Configuration

- id: token-price
  name: dsh-token-price
  config:
    balanceBaseURL: https://api.deepseek.com
    balanceApiKeyEnv: DEEPSEEK_API_KEY
    balanceRefreshIntervalMs: 60000
    referenceRateRefreshIntervalMs: 3600000
    requestTimeoutMs: 5000

balanceApiKeyEnv names the credential holding the DeepSeek API key used for the balance request. The key remains on the host. A failed refresh keeps the last balance sample.

Pricing and rates

prices.json is the local, versioned source of official USD rates per million tokens. It is an append-only history: each rule has an effectiveFrom timestamp, Beijing peak windows, and explicit prices for each supported route. New official prices must append a rule; past rules must not be changed.

The tokenCost projection snapshots the request route and time at request/header, then calculates each (turn, step) from the matching historical USD rule. Replaying the same session log therefore yields the same USD result. The host never scrapes the official price page at runtime.

USD/CNY is refreshed server-side from public market-rate sources every hour. When that refresh fails, the UI uses the current rule's bundled fallback rate. Both values remain estimates (¥) and never affect USD accounting.

Development

npm install
npm test

npm test builds lib/, emits type declarations, and runs accounting tests. Restart the DSH Web process after rebuilding so it loads the new artifacts.

License

MIT