
Sev7een/ds-api-usage
61Last commit Aug 13, 2026
ds-api-usage DSH plugin
After installation, a new "API Usage" page appears in DeepSeek Harness settings. It shows your account balance, estimated spend, token counts, and API request count over the last 24 hours (or 14 days in daily view), rendered as a timeline bar chart. The plugin reuses the existing DEEPSEEK_API_KEY credential, so no extra setup is needed.
How to install the ds-api-usage DSH plugin
dsh plugin --profile web add github:Sev7een/ds-api-usageCopying does not run this command. Review the repository and version before installing the ds-api-usage DSH plugin.
ds-api-usage DSH plugin data source
ds-api-usage DSH plugin snapshot date: Aug 16, 2026
discovered
What the ds-api-usage DSH plugin can do
- Displays a balance card with total balance, granted/top-up split, currency code, and availability badge, fetched from the official DeepSeek API.
- Shows metric cards for 24-hour estimated spend (CNY), input/output token counts, and API request count.
- Provides a timeline bar chart with hourly bars over 24 hours or daily bars over 14 days, togglable between cost, tokens, and requests with hover for exact values.
- Auto-refreshes every 30 seconds (client-side) and has a manual refresh button; balance refreshes every 60 seconds on the host.
- No extra key setup required — it reuses the deployment's existing DEEPSEEK_API_KEY credential through the harness credentials service.
Where the ds-api-usage DSH plugin fits
- Monitor daily API spending to stay within budget.
- Analyze token usage trends over hours or days to optimize model calls.
- Check account balance quickly without leaving the DeepSeek Harness interface.
- Track API request count to detect unusual usage patterns.
- Review historical usage data (up to 14 days) after restarting the web app.
Who the ds-api-usage DSH plugin is for
- DeepSeek Harness users who want to monitor their API usage from within the tool.
- Developers and administrators who need to manage API costs and track token consumption.
ds-api-usage DSH plugin limitations
- Cost is an estimate based on DeepSeek's public pricing table and peak/off-peak hours; actual billing may differ.
- Requires `curl` to be available on the host system for fetching the balance endpoint.
- Data persistence is local to the plugin storage file; deleting the file resets the history.
- Only supports DeepSeek API (not other providers) because it relies on DeepSeek-specific token usage reporting and pricing.
ds-api-usage DSH plugin: from the repository README
Quoted from the Sev7een/ds-api-usage README, the upstream source of the ds-api-usage DSH plugin. Copyright remains with the original authors.
**English** | [简体中文](./README.zh-CN.md) | [Português (Brasil)](./README.pt-BR.md) After installation, open **Settings → API Usage** in [DeepSeek Harness](https://github.com/deepseek-ai/DeepSeek-Harness) to view your DeepSeek API usage. The page shows your account balance, estimated spend, token counts, and API request count over the last 24 hours (14 days in the daily view), rendered as a timeline bar chart similar to the official DeepSeek platform usage page. ## Features - 💰 **Balance card** — total balance with granted / topped-up split, labeled with the API-reported currency code (CNY or USD), plus an availability badge, fetched from the official [`GET /user/balance`](https://api-docs.deepseek.com/api/get-user-balance/) endpoint. - 📊 **Metric cards** — 24h estimated spend (CNY), token counts (input / output split), and API request count. - 📈 **Timeline chart** — hourly bars over the last 24 hours, or daily bars over 14 days, toggled between cost, tokens, and request counts (hover for exact values). - 🔄 **Live refresh** — balance refreshes every 60 s on the host; the page polls every 30 s and has a manual refresh button. - 🔑 **No extra key setup** — reuses the deployment'
Read the full READMERepository license: MIT
ds-api-usage DSH plugin questions
How do I install the DS API Usage plugin?
Run the command `dsh plugin --profile web add github:Sev7een/ds-api-usage` in your DeepSeek Harness environment. This will download and install the plugin from GitHub. If you have a specific profile, replace `web` with your profile name. After installation, restart the harness or reload the settings page to see the new API Usage section.
Where can I find the API Usage page after installation?
Open DeepSeek Harness and go to Settings. You will see a new entry called "API Usage" (or the localized label) in the settings sidebar. Click on it to view your balance, estimated spend, token counts, and request charts. The page is automatically added by the plugin.
Is the cost shown accurate? Will I be billed exactly that amount?
The cost is an estimate based on DeepSeek's public pricing table and includes peak/off-peak hour logic. It uses the token counts reported by the model during streaming to calculate the price. However, actual billing may differ slightly due to rounding or pricing updates. The number is meant for monitoring trends, not as a final invoice.
How do I reset the historical usage data shown in the 14-day view?
Delete the storage file located at `$DSH_HOME/storages/ds-api-usage.json`. The plugin will then start fresh with empty aggregates. Note that deleting this file does not affect the harness's own per-session token projection, which is stored separately. After deletion, restart the harness or reload the settings page to see the reset.
Does this plugin work with other API providers, like OpenAI?
No, this plugin is specifically designed for DeepSeek API. It relies on DeepSeek's token usage format (StreamChunk with TokenUsage) and DeepSeek's pricing table. It also fetches balance from the DeepSeek `/user/balance` endpoint. It will not work with other providers unless you modify the code.