ben7am1n/dsh-deepseek-usage1

dsh-deepseek-usage

DeepSeek Harness 的 DeepSeek 使用量监控器:提供账户余额查询和实时 Token 使用量汇总,作为模型可调用的工具。

AI 分析

核心用途是监控 DeepSeek 官方 API 的余额和 Token 消耗。适合需要控制 API 预算、防止超支的用户。必要条件:需配置有效的 DEEPSEEK_API_KEY。

套件
dsh-deepseek-usage
版本
0.1.1
授權
MIT
最近更新
2026年8月13日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:ben7am1n/dsh-deepseek-usage

dsh-deepseek-usage

DeepSeek usage monitor for DeepSeek Harness: account balance query and live token usage summary as model-callable tools.

Install

dsh plugin --profile  add dsh-deepseek-usage

Requires a DeepSeek API key available as DEEPSEEK_API_KEY (env or credential).

Tools

deepseek_balance

Queries GET https://api.deepseek.com/user/balance and returns availability and per-currency balances (total / granted / topped-up). When lowBalanceThreshold is configured, appends a warning when the primary currency balance drops below it.

usage_summary

Aggregates per-session token usage from the harness token meter across live sessions, sorted by total tokens descending. Use it to estimate context usage and spot runaway sessions.

Configuration

FieldDefaultMeaning
apiKeyEnvDEEPSEEK_API_KEYEnv var or credential reference for the API key
baseURLhttps://api.deepseek.comDeepSeek API base URL
lowBalanceThresholdOptional low-balance warning threshold

### `usage_summary`
Aggregates per-session token usage from the harness token meter across live sessions, sorted by total tokens descending. Use it to estimate context usage and spot runaway sessions.

## Configuration

| Field | Default | Meaning |
|---|---|---|
| `apiKeyEnv` | `DEEPSEEK_API_KEY` | Env var or credential reference for the API key |
| `baseURL` | `https://api.deepseek.com` | DeepSeek API base URL |
| `lowBalanceThreshold` | — | Optional low-balance warning threshold |

```yaml