OpenCode Go usage panel for DeepSeek Harness: plan quota (rolling 5-hour / weekly / monthly), local token stats, per-model cost, and one-click Go model list refresh. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-go-quota
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:tanson515/dsh-usage
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
OpenCode Go 套餐用量面板,DeepSeek Harness(DSH)插件。在 设置 → 用量 里一次性看到:
- OpenCode Go 官方额度:滚动 5 小时 / 每周 / 每月三个窗口的已用百分比、重置时间、限流状态;
- 本地 token 统计:未命中输入 / 输出 / 缓存读 / 缓存写、缓存命中率、会话数与按日用量;
- 模型用量与费用:按模型聚合的请求数、token 和按官方单价估算的费用;
- 全部模型额度消耗:每个模型的月额度、本周期已用、消耗占比;
- 一键刷新 Go 模型清单:从官方
/inference/go/v1/models拉取最新目录,经 Config Editor 热更新llm-pi-ai的opencode-goprovider,模型增减免手改配置; - 多账号跟随:每轮读取
.credentials.yaml里的OPENCODE_GO_API_KEY,换 key 不用重启。
数据优先走本机会话缓存($DSH_HOME/storages/session_projcache 与会话日志),官方额度接口最多缓存 30 秒;panel 只做只读展示,不上传任何数据。
安装
从插件市场(Discover)安装:
dsh plugin add dsh-go-quota
或在本仓库目录里:
dsh plugin add github:tanson515/dsh-usage
安装后重启/刷新 DSH,在 设置 → 用量 打开面板(不需要重启 Host,热加载生效)。
前提条件
- DSH 运行时
dsh.bundle插件协议(0.2.x 及以上); - 在
$DSH_HOME/.credentials.yaml中配置OPENCODE_GO_API_KEY(OpenCode Go 订阅的 API key)。没有 key 时面板仍会打开,但只显示本地统计,官方额度区块会提示缺少 key。
面板说明
- 官方额度接口:
GET https://opencode.ai/zen/go/v1/usage(Bearer key); - 模型目录:
GET https://opencode.ai/inference/go/v1/models; - 本地统计来源:
$DSH_HOME/storages/session_projcache/sessions/*.json与会话日志(zstd); - 费用按 Go 官方单价估算,不含时段倍率;仅供参考,以官方账单为准。
开发
# 本地 link 安装(在 DSH profile 中)
dsh plugin add link:/path/to/this/repo
结构:
| 文件 | 作用 |
|---|---|
index.js |
Host 半边:提供 /dsh-usage/state、/dsh-usage/refresh-models 两个 HTTP 接口 |
client.js |
Client 半边:注册设置页「用量」section,轮询 host 快照 |
cordis.patch.yml |
bundle manifest:向 loader 插入 dsh-go-quota 行 |
locale/*.json |
中英文文案 |
Host 半边只用 Node 内置模块,无第三方依赖;Client 半边从浏览器模块表取 React,不打包额外依赖。
免责声明
本插件由社区维护,与 OpenCode / Anomaly 官方无关;OpenCode Go 是其订阅服务,费用与额度以官方为准。插件只读取本机 DSH 数据与会话日志,不会上传。
License
MIT © 2026 tanson515
Links
More in this category
bowenliang123/dsh-context★ 5566
DSH context insight panel: Context dashboard + /context command + Context browser — one-stop context lifecycle management with categorized composition, content details, evolution trends, compaction/injection events, and stats.
Han-1413141/dsh-cost-meter★ 765
Per-session and daily API cost, budget with usage %, official balance, history dashboard, and one-click official price sync with peak/off-peak pricing.
wssfk12138/dsh-damage-pulse★ 291
Tracks DeepSeek token usage, per-call and session costs, and account balance with cache-aware charge animations in the DSH Web UI.
zh667/TokenLedger★ 206
Sidebar usage panel that attributes tokens to the relay site that served each request, read from your existing provider config: today/month/all-time totals, per-site and per-model breakdowns, a year activity heatmap, and New API / Sub2API / DeepSeek balances.
Ychris12138/dsh-usage-stats★ 192
Multi-provider usage dashboard with provider/model token breakdowns, calendar drill-downs, account balances, and OpenCode Go / Z.ai subscription quota tracking.
PolinniZhong/dsh-personal-center★ 114
Personal center for DeepSeek Harness: cross-session usage statistics with per-provider and per-model breakdown (auto-discovers configured models), per-model cost estimation, global custom instructions, a data-driven desktop pet with bitmap & vector skins, and a conversation status overview, all local and offline.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.