dsh-deepseek-usage

by ben7am1n

1 开发与运行时github收录于 08-23

DeepSeek Harness 的 DeepSeek 余额与 token 用量工具

DeepSeek balance and token usage tools for DeepSeek Harness

安装

dsh plugin --profile web add github:ben7am1n/dsh-deepseek-usage

GitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试

安装与环境配置指引、插件开发教程见 DSH 中文社区文档 ↗

安装即在你的机器上以你的权限运行第三方代码——它可读写文件、使用凭据、访问网络,DSH 的工具审批不会为插件代码加沙箱。「检测到 manifest」仅代表发现 dsh.bundle / dsh.plugin 清单,不构成兼容性或安全审查;安装前请审阅源码,不熟悉的插件先在不含密钥的环境试用。

README

目录

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

Install

dsh plugin --profile <name> 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

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
# profile cordis.patch.yml
- id: deepseek-usage
  config:
    apiKeyEnv: DEEPSEEK_API_KEY
    lowBalanceThreshold: 20

License

MIT

原始 README: https://github.com/ben7am1n/dsh-deepseek-usage/blob/main/README.md ↗