Introduction

When using DeepSeek in DSH, account balance, price tiers, and session expenditure are typically scattered across external pages or logs. With peak/off-peak pricing taking effect, the cost for the same model varies based on Beijing time, requiring developers to determine whether it’s currently peak or off-peak before making calls. Here introduces dsh-balance-tide, which consolidates account balance, peak/off-peak pricing tide indicators, and estimated session expenditure into the DSH Web plugin.

What is This

dsh-balance-tide is a DSH Web plugin maintained by huanyuLv, positioned as: DeepSeek Harness (DSH) Web plugin: account balance + peak/off-peak pricing tide indicator.

It primarily addresses three needs:

  • Viewing current account balance.
  • Determining the current price tier and time until the next peak/off-peak switch.
  • Estimating session expenditure based on the current pricing cycle.

The current version is 0.4.0, licensed under MIT.

Core Features

  • Displays standard / peak / off-peak price tier badges, determined in real-time based on Beijing time.
  • Shows a countdown to the next peak/off-peak switch, refreshing every second.
  • Reads account balance from the official /user/balance endpoint, distinguishing between granted and topped-up.
  • Estimates session expenditure based on the current pricing cycle, reusing sessionProjections; the same turn/step samples are substituted rather than recalculated.
  • On hover, displays the full price table for the current and next cycle, peak/off-peak price differential (peak = off-peak × 2), peak/off-peak time windows, and usage recommendations.
  • Provides a ? icon that opens the official pricing page.
  • In zero-configuration scenarios, reuses the DEEPSEEK_API_KEY from DSH credentials; no keys are stored in the repository.
  • Supports Chinese / English interface languages.

Peak/Off-Peak Pricing Rules

Based on verified information:

  • Peak/off-peak pricing takes effect from 2026-08-17 00:00; prior to this, the current flat rate applies.
  • Beijing time 09:00–12:00 and 14:00–18:00 are designated as peak.
  • All other times are off-peak.
  • off-peak is half the price of peak.

Installation and Enablement

Before installation, a pnpm environment is required. Below are the installation methods via npm, Git URL, and local directory.

npm:

dsh plugin --profile web add dsh-balance-tide

Git URL:

dsh plugin --profile web add https://github.com/huanyuLv/dsh-balance-tide

Local directory:

dsh plugin --profile web add file:/path/to/dsh-balance-tide

After installation, restart dsh web for changes to take effect.

Configuration

Plugin configuration is located in:

$DSH_HOME/profiles/web/cordis.patch.yml

Configurable options include:

refreshIntervalMs
clientPollIntervalMs
currency
allowedHosts

If official pricing or schedules change, you can also override using configuration:

tideCutoff
peakWindows
tidePrices

Security and Limitations

Security aspects:

  • Prioritizes using DEEPSEEK_API_KEY from DSH credentials.
  • The apiKey configuration is only an escape hatch to avoid writing plaintext into configuration.
  • baseUrl must be https; plaintext http will be rejected.
  • /query-tide checks the reader: Host must be localhost, a literal IP, or a domain registered in allowedHosts.
  • Requests with Origin must be same-origin.
  • Rejected reads return 403.
  • The server sends only minimal error codes to the browser; raw exception text goes into logs, and custom baseUrl is not exposed to the frontend.

Limitations:

  • Costs are estimated based on the current pricing cycle; official bills are the authority.
  • For multi-currency accounts, the read display shows only the first currency, with others displayed in the tooltip.
  • deepseek-chat / deepseek-reasoner are not listed on the official pricing page; static prices are only a fallback, not verified quotes.

Use Cases and Notes

Suitable for:

  • Developers using the DSH web profile.
  • Scenarios requiring viewing balance, peak/off-peak pricing, and estimated session expenditure in the web interface.
  • Node.js 20 / 22 / 24 environments.

Compatibility:

  • DeepSeek Harness 0.1.0-rc.6+ (web profile).
  • Pure JavaScript + standard browser CSS, no native modules.

Note: The plugin runs with the permissions of the current dsh process. It is recommended to review the source code and license before installation; this project is licensed under MIT.

Conclusion

dsh-balance-tide provides account balance, peak/off-peak pricing tide indicators, and session expenditure estimation, making it suitable for daily use in DSH Web. Project URL: https://github.com/huanyuLv/dsh-balance-tide