Preface¶
When writing conversations in DSH Web, the interface’s built-in stats pill displays the duration and token count, but it doesn’t tell you how much money remains in your account or how much the current round of conversation has cost. Checking the balance in “Settings → Account” or on the platform page interrupts the current workflow. If you want to continuously see the balance and the quota changes for the “current session” next to the input area, while also being aware of whether it is a peak or off-peak pricing period, the community plugin dsh-quota-pill is a client-side solution designed specifically for this pain point.
What is this¶
dsh-quota-pill (directory name jiangluoyiyi/dsh-quota-pill) is published by maintainer jiangluoyiyi and categorized as a Client-side plugin. Its description is: Display DeepSeek account balance and session-based usage statistics in the composer dock.
It is a local bundle: once installed into the current profile, it applies to all conversations. It only runs on the client side; it does not register a Host service, does not distribute tools, and does not enter the model context. The pill attaches to conversation.composer.dock with an independent id quota (order: 10), positioned after the built-in DSH stats pill.
Pill and Expanded Card¶
A persistent row appears below the Composer, side-by-side with the built-in stats pill, for example:
Off-peak Balance ¥8.75 │ Cost ¥0.42
- Peak / Off-peak:
Peakindicates peak hours (double price, warning color);Off-peakindicates idle hours (half price, muted gray). - The two values use tabular numbers (
tabular-nums) to prevent jitter when the number of digits changes. - When the cost has not yet been settled, it displays
Cost —, keeping the pill width stable; the version number does not occupy space in the pill but is shown only in the expanded card.
Clicking the pill expands the details, including the balance breakdown, current session cost, current time period, and the three unit prices (rule explanations are kept in the README to save card space). The layout features right-aligned values, unit prices with two decimal places, and units labeled in small gray text as “CNY / Million tokens”.
Core Features¶
| Display Item | Meaning | Data Source |
|---|---|---|
| Balance | Total available balance (Top-up Wallet + Granted Quota, summed by currency) | Host ctx.remote.account.getBalance() |
| Cost | The difference between the baseline balance recorded when entering the session and the current balance | Local calculation |
| Peak / Off-peak | Current peak or idle status | Determined locally by Beijing time |
| Top-up Wallet / Granted Quota | Breakdown items, retaining platform currency (¥ / $) |
Same as getBalance |
| Period & Unit Price | Current period, remaining countdown, cached input / uncached input / output unit prices | Built-in PRICE_TABLE |
| Version Number | The bundle version loaded by the current page | Build constant, located in the card action row |
The balance data is from the same source as “Settings → Account”, hitting GET https://platform.deepseek.com/api/v0/users/get_user_summary underneath. Authentication is handled by the Host and does not enter the browser.
Peak/Off-peak Rules (Aligned with Official Models & Pricing): Beijing time Monday to Friday 9:00–12:00 and 14:00–18:00 are peak hours; all other times (including weekends) are off-peak. Off-peak prices are half of peak prices. The price table in the card covers both deepseek-flash and deepseek-v4-pro unit prices. The plugin states honestly: Listed prices are not actual charges; it defaults to deepseek-flash pricing and can be overridden via globalThis.__DSH_QUOTA_PILL_MODEL__ = 'deepseek-v4-pro'; statutory holidays are not excluded from peak determination; price changes require syncing the table in client.js and validation by the verification script.
For scenarios like not logged in, read failure, or zero balance, there are readable states for each; it does not disguise failures as a zero balance.
Refresh and Status¶
| Scenario | Behavior |
|---|---|
| Initial Mount | Read immediately |
| Idle | Every 45s |
| Session Running | Every 20s |
| End of Turn | Re-read 4s later |
| Read Failure | Backoff: 20s → 60s → 120s |
| Expand Card | Additional getState() self-check |
There is only one read loop per page; switching sessions does not restart it. When a call fails, the last successful reading is retained and marked as stale.
Installation and Activation¶
Local development directory (repo linked into profile):
plugin_manager { action: "install_bundle", target: "<absolute path to this directory>" }
Install from GitHub:
plugin_manager { action: "install_bundle", target: "https://github.com/jiangluoyiyi/dsh-quota-pill" }
You must hard refresh the page (Ctrl+Shift+R or menu reload) after installation to see the pill. Subsequent code changes are pushed to opened pages via host bundle polling (default roughly 500ms comparing mtime/ctime/size). To verify if the latest code is loaded: open the card and check the gray text vX.Y.Z at the bottom (current package version is 0.1.9); the pill itself does not show the version number.
Typical Usage and Optional Configuration¶
- Execute
install_bundleas described above and refresh the page. After logging into a DeepSeek account (not just an API key), you will see the pill below the composer. - If the default model is
deepseek-v4-pro, set it before loading the bundle:
globalThis.__DSH_QUOTA_PILL_MODEL__ = 'deepseek-v4-pro';
The card does not display the model name, but the unit prices will change accordingly.
Local offline verification (does not replace actual browser testing):
node verify/verify-quota-pill.mjs
Use Cases and Notes¶
Who it is for: Developers who run long sessions in DSH Web and want to see the account balance, approximate current session cost, and whether it is currently peak pricing at a glance.
Permissions & Security: The plugin runs with the current DSH process permissions. Before installing, you should read the source code and license of the GitHub Repository and judge whether to trust the maintainer jiangluoyiyi. The community directory SkillHub Plugin Page is an independent ecosystem site and has no official affiliation with DeepSeek / High-Flyer.
Known Limitations (Key points from README):
- “Current Session” is a local measurement: the platform does not provide session-level billing; costs from other windows, devices, or API usage will also count towards the difference.
- The baseline resets after refreshing the page; when multiple sessions are running simultaneously, the difference cannot be attributed to a single session.
- When using only an API key without an account login,
getBalanceisnull, and “Account not logged in” is displayed.
Notes for development integration: The input for getBalance must be a strict AccountClientMetadata (version, locale, timezoneOffsetSeconds); the Remote returns a { ok, value } envelope, and the business data is inside value. Do not read the top-level status directly.
Conclusion¶
dsh-quota-pill consolidates account balance, session-level cost estimation, and peak/off-peak pricing hints into a single pill in the composer dock, reducing the frequency of switching pages to check accounts. For installation commands, price tables, and contract details, please refer to the repository README.