oc-deepseek-pricing
v0.1.2
Published
OpenCode TUI plugin showing DeepSeek peak and off-peak pricing windows
Maintainers
Readme
oc-deepseek-pricing
An OpenCode v2 TUI plugin that displays the current DeepSeek API pricing window in the prompt footer and session sidebar.
The indicator is shown when the selected model ID contains deepseek. DeepSeek off-peak rates are half of peak rates.
Features
- Displays the current pricing window in the prompt footer.
- Displays a compact pricing status in the session sidebar.
- Exposes complete pricing details through
/deepseek-pricing. - Distinguishes peak and off-peak periods with whale emoji indicators.
- Shows the next pricing transition and a countdown.
- Treats weekends as fully off-peak.
- Supports Chinese public-holiday overrides.
- Warns when the holiday calendar does not cover the current Chinese calendar year.
- Uses local computation only; no network request is needed at runtime.
Pricing schedule
Peak windows are evaluated in UTC:
- 01:00-04:00 UTC, Monday through Friday;
- 06:00-10:00 UTC, Monday through Friday.
All other times are off-peak, including:
- 04:00-06:00 UTC on weekdays;
- all hours after 10:00 UTC and before 01:00 UTC;
- Saturdays and Sundays in full;
- Chinese public holidays in full.
The off-peak price multiplier is 0.5.
Installation
Install the published plugin directly with the OpenCode CLI:
opencode plugin add oc-deepseek-pricingTo install this exact release:
opencode plugin add [email protected]OpenCode registers the plugin automatically. No manual change to cli.json, opencode.json, or tui.jsonc is required.
Verify the installation with:
opencode plugin listRequirements
- OpenCode v2 with TUI plugin support;
- a terminal supported by OpenCode.
Development dependencies include:
@opencode/plugin;@opentui/core;@opentui/solid;solid-js;- TypeScript.
Repository structure
oc-deepseek-pricing/
├── CALENDAR_UPDATE.md
├── LICENSE
├── README.md
├── bun.lock
├── package.json
├── src/
│ ├── holidays.ts
│ ├── pricing.test.ts
│ ├── pricing.ts
│ └── tui.tsx
├── tsconfig.json
└── tui.tsDevelopment setup
Install dependencies:
bun installRun all validation checks:
bun run checkRun the test suite:
bun testA successful validation completes without formatting, lint, TypeScript, or test errors.
Restarting OpenCode
After changing the plugin source or configuration, close the OpenCode TUI completely and start it again.
Opening a new conversation is not necessarily sufficient because plugin entrypoints are loaded during TUI startup.
Expected interface
When a DeepSeek model is selected during an off-peak window, the prompt and home footers display:
🐋💤 off-peak · 9h 13m leftDuring a peak window, they display:
🐳 peak · 1h 15m leftThe session sidebar displays only the current status and remaining time:
Status 🐋💤 off-peak
9h 13m leftDuring a peak window, the sidebar displays:
Status 🐳 peak
1h 15m leftRun /deepseek-pricing to display the complete pricing details:
DeepSeek pricing
Status 🐋💤 off-peak
Reason outside peak windows
Next peak in 9h 13m
At 10/28/2026, 2:00:00 AM
China 2026-10-27The Next line intentionally uses the state name without an emoji. If the Chinese public-holiday calendar does not cover the current year, the command also displays a warning.
The exact local transition time depends on the operating-system timezone and daylight-saving rules. Pricing classification is based on UTC, while holiday lookup uses the Asia/Shanghai calendar date.
Chinese public holidays
Holiday data is stored in:
src/holidays.tsOnly officially verified calendar years should be added to COVERED_HOLIDAY_YEARS.
For the complete annual update procedure, source requirements, timezone rules, validation checklist, and required tests, see CALENDAR_UPDATE.md.
If the current Chinese calendar year is not covered, the plugin continues to apply the normal UTC weekday and weekend schedule but displays a coverage warning. Do not suppress the warning by adding a year without adding and reviewing the complete official calendar.
Tests
The test suite covers:
- the first weekday peak window;
- the off-peak gap between the two peak windows;
- the second weekday peak window;
- exact peak-window boundaries;
- weekends;
- ordinary weekday off-peak periods;
- Chinese public-holiday overrides;
- calendar-year coverage;
- next-transition calculation;
- weekend skipping when finding the next peak period;
- duration formatting;
- invalid date handling.
Run:
bun testType checking
Run:
bun run typecheckThe repository uses NodeNext module resolution. Relative TypeScript imports must therefore use the emitted JavaScript extension, for example:
import { getPricingSnapshot } from "./pricing.js"License
This project is licensed under the MIT License. See LICENSE.
