Introduction

DeepSeek Harness (DSH) adopts a plugin-based architecture, enabling developers to extend its functionality. To directly view DeepSeek platform balance and usage, or manage OpenCode Go quotas from the DSH settings panel, you usually need to open a browser or write scripts. The dsh-account-usage plugin adds an “Account” page to the DSH settings panel, providing one-stop viewing of DeepSeek platform balance and usage as well as OpenCode Go quotas. This plugin is maintained by Ycet and is released under the MIT license.

Features

  • DeepSeek platform overview: displays top-up balance, bonus balance, cumulative consumption amount, current month consumption amount, and current month Tokens.
  • Daily bar charts: provides dual charts for consumption amount and Token consumption, supports SVG rendering and mouse hover to view daily details.
  • Time dimension switching: supports today, last 7 days, last 30 days, last 90 days, this month, last month, and custom time ranges.
  • Model-level detail table: displays request count, input/cache/output Tokens, and cost for each model in the selected range.
  • OpenCode Go quotas: displays usage percentage, next reset time, and limit reference for the 5-hour rolling, weekly, and monthly windows.
  • Automatic refresh: automatically polls the latest data every 60 seconds while the page is mounted.
  • Bilingual interface: supports full Chinese and English switching.

Installation and Enablement

Before installation, make sure DSH CLI is installed.

  1. Run the following command to install the plugin:
dsh plugin --profile web add github:Ycet/dsh-account-usage
  1. After installation, restart the web application:
dsh web
  1. Open the settings panel and refresh the page to see the new “Account” page.

Configuration Notes

DeepSeek Platform Token

The DeepSeek platform usage API is an undocumented private interface and requires your platform login token:

  1. Log in to https://platform.deepseek.com.
  2. Open browser DevTools → Console and run:
JSON.parse(localStorage.getItem('userToken')).value
  1. Paste and save the token in the token input field on the plugin’s “Account” page. The token is stored only in the local credentials store (the DEEPSEEK_PLATFORM_TOKEN field in ~/.dsh/.credentials.yaml) and is not sent to any external location.

OpenCode Go Key

Usually, manual configuration is not required. The plugin automatically searches in the following order:

  1. DSH credential OPENCODE_GO_API_KEY (usually configured in “Settings → Models”).
  2. OpenCode’s own ~/.local/share/opencode/auth.json (the opencode-go entry, with type api).

Usage Notes

  • Switch to the deepseek or opencode go tab at the top of the “Account” page in the settings panel to view the corresponding data.
  • DeepSeek page: click a time dimension (Today, Last 7 Days, etc.) or select “Custom Range” and then click “Apply”. The bar charts support mouse hover to view daily details; the model detail table displays request count, Tokens, and cost.
  • OpenCode Go page: displays usage progress bars, reset times, and limit references for the three quota windows. The page automatically refreshes every 60 seconds while mounted. Click the “Jump” button to go to opencode.ai, and click the “Refresh” button to manually update data.
  • Click the “Open Config File” button to directly locate the local DSH credentials file.

Important Notes

  • API stability: The DeepSeek platform usage API is a private API, and fields may change with platform upgrades. The plugin parses responses defensively and displays “—” instead of throwing an error when fields are missing.
  • Field estimation: Public documentation does not include “cumulative consumption amount” or “API request count”. The plugin uses naming heuristics to search the summary response for cumulative consumption (displays “—” if not found), and reads count/requests/request_count/req_count/calls fields on model entries to obtain request counts.
  • Limit references: OpenCode Go limits (\(12/\)30/$60) are plan reference values; the endpoint does not return limits. For plan changes, refer to the opencode.ai page.
  • Network access: When the service is bound to 0.0.0.0, this plugin’s route is reachable from the local network (same existing limitation as other local DSH plugins; no such issue with the default 127.0.0.1).
  • Local security: The token is stored only in the local credentials store; the browser and network requests do not carry it to any location other than the upstream endpoint.