dsh-minimax-usage
by Floating-Dreaming
Adds a "用量" section to the DSH Settings page that shows your MiniMax Token Plan usage (5h and weekly windows with reset countdowns), per-model breakdown, and video bonus credits; fetches `/v1/token_plan/remains` via a trusted plugin that holds the API key, auto-hides when no key is configured. MIT.
安装
dsh plugin --profile web add github:Floating-Dreaming/dsh-minimax-usage#path:/trusted-pluginGitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试
安装与环境配置指引、插件开发教程见 DSH 中文社区文档 ↗
安装即在你的机器上以你的权限运行第三方代码——它可读写文件、使用凭据、访问网络,DSH 的工具审批不会为插件代码加沙箱。「检测到 manifest」仅代表发现 dsh.bundle / dsh.plugin 清单,不构成兼容性或安全审查;安装前请审阅源码,不熟悉的插件先在不含密钥的环境试用。
README
DSH (DeepSeek Harness) trusted plugin that exposes the user's MiniMax Token Plan usage data via the
minimaxUsageservice.
What it does
Runs in the DSH main Node process and provides:
ctx.minimaxUsage.getUsage({ force?: boolean }) // Promise<{ ok, models, ... }>
ctx.minimaxUsage.hasApiKey() // boolean
Backed by https://www.minimaxi.com/v1/token_plan/remains. Features:
- 60s in-memory cache + 10s rate limit
- 2-attempt retry on transient errors (timeout / 5xx / 429)
- API key resolved from
MINIMAX_API_KEYenv var or~/.dsh/.credentials.yaml - Normalized response shape with plan-level
remainingPercent*fields
Installation
This is a DSH trusted plugin, not a regular npm dependency. DSH loads it via
pnpm workspace + cordis composition patch. See the parent repo
dsh-minimax-usage for the
install.ps1 / install.sh scripts that wire it into DSH.
If you want to publish to your own npm registry:
# from this directory
npm login
npm publish --access public
Then in the DSH profile's package.json:
{
"dependencies": {
"@floatingdeaming/minimax-usage": "^1.0.0"
}
}
…and run pnpm install in the profile root.
API key
Set MINIMAX_API_KEY to a Token Plan / Subscription key (not the metered-billing
key). Sources checked in order:
process.env.MINIMAX_API_KEY~/.dsh/.credentials.yaml—MINIMAX_API_KEY: '<value>'
Changes take effect after restarting DSH.
Response shape
{
ok: true,
statusCode: 0,
summary: '查询成功',
models: [
{
modelName: 'general',
total5h: 0,
remaining5h: 0,
used5h: 0,
usedPercent5h: 17,
remainingPercent5h: 83, // ← from current_interval_remaining_percent
status5h: 1,
windowStart: '2026-08-15T12:00:00.000Z',
windowEnd: '2026-08-15T16:00:00.000Z',
resetIn5hMs: 9758306,
resetIn5hLabel: '2:42:39',
// same shape for totalWeek/remainingWeek/usedWeek/usedPercentWeek/remainingPercentWeek
},
// ...
],
fetchedAt: '2026-08-15T13:17:21.569Z',
cached: false
}
On error:
{
ok: false,
statusCode: 1004, // or 401, 503, null
summary: '请检查 MINIMAX_API_KEY(需要 MiniMax Token Plan/Subscription Key,不是按量计费 API Key)',
models: [],
errorCode: 'auth_error', // missing_key | auth_error | rate_limited | http_error | network_error | timeout | api_error
fetchedAt: '2026-08-15T13:17:21.569Z'
}
Why a trusted plugin?
DSH sandboxes dynamic plugin code — they cannot make network calls or read env vars
directly. To bridge to MiniMax's API we need a plugin that runs in the DSH main
process, which DSH calls "trusted". The dynamic client-side plugin (cordis_define
cordis_runin a session) callsctx.minimaxUsage.getUsage()via Host RPC.
License
MIT
原始 README: https://github.com/Floating-Dreaming/dsh-minimax-usage/blob/main/trusted-plugin/README.md ↗
同类插件
查看全部 →
dsh-usage-plugin
DeepSeek Harness 用量与消耗插件(dsh-usage)—— 每次调用的 token 用量/缓存命中统计、峰谷计费、余额查询、CSV/JSON/PNG 导出,可经桌面端一键安装或命令行 dsh plugin add 安装。

dsh-whale-report
🐋 鲸鱼记事本 — 你的 Agent 年度报告:从会话事件日志生成日报/周报/月报/年报,任意区间、只读不改写

dsh-balance-meter
输入框 dock 显示 DeepSeek 账户余额与会话花费,自动拉取官方定价,支持高峰/低谷计价。

dsh-usage-stats
DeepSeek Harness 使用统计插件|Token 总量与构成、7/30 天趋势、年度活跃热力图、模型占比、工作区/任务筛选、CSV/JSON 导出

dsh-balance
DeepSeek 余额实时显示插件: 在 dsh Web UI 输入框 下方、命中率/输入输出 token 统计条所在的同一行 , 实时显示:

dsh-balance-monitor
DeepSeek 账户余额、剩余比例条与今日花费,显示在 dsh 侧边栏底部 · DeepSeek balance, remaining-ratio bar and today's spend in the dsh si