DeepSeek Peak Whale: Pricing & Billing Library + Sidebar Status Indicator

Preface

On the DeepSeek platform, billing is divided into “peak” and “off-peak” periods. Peak prices are typically higher, while off-peak prices are lower. Without keeping an eye on the time, it’s easy to make API calls during peak hours and end up with higher costs. DeepSeek Harness provides a “whale” icon in the sidebar, but currently it’s just a static marker. When developers need to know the current billing period, time remaining, or account balance in real time, they often have to switch to a browser or external tools to check. That extra step is cumbersome and can cause them to miss the optimal usage window.

justjeet360/deepseek-peak-whale provides a pricing calculation library along with a sidebar plugin for DeepSeek Harness. The plugin associates the whale icon color with the current billing period: blue during off-peak hours, red during peak hours. Additionally, hovering over or focusing on the whale icon displays the current rate, a countdown to the next switch, and the available balance.

What Is This

This is a “DeepSeek peak/off-peak pricing library” paired with a “DeepSeek Harness sidebar-whale plugin.” Maintained by justjeet360, it falls under the “model inference” plugin category. It encapsulates previously scattered pricing rules into a reusable library and provides a visual status indicator within the DSH interface.

Core Features

Library

The library is a lightweight, zero-network-request, DSH-independent computation module. It provides a set of functions for determining whether the current time is in a peak period, getting the next transition time, and formatting countdown and balance displays.

  • isPeak(now?, options?): Determines whether the current time falls within a peak billing period.
  • nextTransition(now?, options?): Returns the time of the next transition and whether it transitions into a peak period.
  • currentRate(now?, options?): Returns a snapshot including peak status, transition time, and remaining milliseconds.
  • formatRemaining(ms): Formats remaining milliseconds into a compact duration string, e.g., 2d 4h or 18m 03s.
  • formatWallet(wallet, locale?): Formats a balance amount into a platform-style currency display, e.g., ¥ or $.
  • beijingParts(now?): Retrieves the day of the week, minutes, and ISO date in Beijing time.
  • DEFAULT_CHINA_HOLIDAYS: Built-in holiday ranges for 2026–2027.
  • PEAK_WINDOWS, RATE_COLORS: Constants defining peak-hour windows and the default color palette, respectively.

You can override the holiday calendar by passing { holidays: [['2027-10-01', '2027-10-07']] }.

Plugin Behavior

Once installed in DeepSeek Harness, the plugin re-colors the whale icon in the sidebar:

  • Off-peak: Blue #4D6BFE
  • Peak: Red #E5484D

The rate status refreshes every 15 seconds. Hovering over or focusing on the whale icon displays:

  • Current rate (peak/off-peak)
  • Countdown to the next transition (updated every second)
  • Available balance

The balance is cached for 60 seconds. The icon remains consistent whether the sidebar is expanded or collapsed to rail mode.

Balance & Privacy

The plugin does not hardcode API keys, account IDs, tokens, personal paths, or telemetry data in the code. When a balance is available, the plugin reads it with the following priority:

  1. If a DeepSeek Platform account is logged in, the balance is read via DSH’s account service.
  2. Otherwise, the Host reads DEEPSEEK_API_KEY from DSH’s credential store and calls DeepSeek’s /user/balance endpoint.
  3. If neither is available, it displays “Credit: unavailable.”

Balance amounts are only transmitted through local authentication routes on the Host side. The API key never reaches the browser. Never write API keys into cordis.yml, committed .env files, or this plugin’s code. .gitignore already excludes environment files.

Installation & Enablement

To install via the DeepSeek Harness interface, follow these steps:

  1. Open DeepSeek Harness and navigate to the Plugins menu.
  2. Select Add plugin.
  3. Choose local directory installation and add the deepseek-peak-whale package directory as a local Bundle.
  4. Once installed, the plugin takes effect immediately without additional configuration.

The plugin can also be published to npm and then installed from the plugin index.

Typical Usage

Library Usage Example

In a Node.js environment or in the browser, you can import the library as follows:

import {
  currentRate,
  formatRemaining,
} from 'deepseek-peak-whale/pricing';

const now = new Date();
const rate = currentRate(now);
console.log(rate.peak ? 'Peak rate' : 'Off-peak rate');
console.log(`Changes in ${formatRemaining(rate.remainingMs)}`);

Plugin Usage Example

After installing the plugin, you’ll see the whale icon in the DSH sidebar. During off-peak hours, the icon is blue; during peak hours, it turns red. Hovering over or focusing on the icon reveals a tooltip showing the rate, countdown, and balance information.

Use Cases & Cautions

This plugin is ideal for agent developers who need real-time awareness of billing periods, want pricing rules encapsulated into a reusable library, and prefer a clear visual indicator of the current status within the DSH interface. The plugin runs with DSH process-level permissions—review the source code and license before installation.

Summary

justjeet360/deepseek-peak-whale encapsulates DeepSeek’s pricing logic into a library and provides a zero-configuration sidebar plugin that helps users quickly determine the current billing period and balance before making calls. For development scenarios requiring fine-grained cost control, this type of plugin can reduce the time overhead of manual lookups.

References

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye