zer0zio-stack/dsh-opencode-go-quota ↗★ 0
dsh-opencode-go-quota
DeepSeek Harness web plugin: static 余额 badge that fetches the active provider's plan limit or prepaid balance on expand, with token usage and spend estimated from the DeepSeek pricing table.
AI Analysis
核心用途是便捷查看API余额与消费估算。适合使用opencode-go或DeepSeek官方渠道、需要在界面中快速掌握资费消耗情况的用户。
Install
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:zer0zio-stack/dsh-opencode-go-quotaREADME
Read the full README ↗配置
安装时 cordis.patch.yml 插入一行,内置适配器:
| 提供方 | kind | 数据源 | 凭据 |
|---|---|---|---|
opencode-go | plan | https://opencode.ai/zen/go/v1/usage | OPENCODE_GO_API_KEY |
deepseek | tokens | https://api.deepseek.com/user/balance | DEEPSEEK_API_KEY |
deepseek-official | tokens | https://api.deepseek.com/user/balance | DEEPSEEK_API_KEY |
顶层字段:
| 字段 | 默认值 | 说明 |
|---|---|---|
refreshMs | 30000 | 接口返回的建议刷新间隔;前端已不轮询,仅在每次展开时请求一次 |
requestTimeoutMs | 10000 | 单次上游请求超时 |
maxResponseBytes | 65536 | 上游响应体上限 |
DeepSeek V4 定价已按用户提供的
deepseek_markdown_20260815_c4af7f.md 内置在代码中,单位为 元 / 百万 tokens:
deepseek-v4-flash/deepseek-v4-pro;- 2026-08-17 00:00 前按 原定价;
- 之后按 高峰时段(9:00–12:00、14:00–18:00)/ 空闲时段 计价;
- 输入按
cacheReadTokens(缓存命中)与inputTokens(缓存未命中)分别计费,cacheWriteTokens按缓存未命中处理;输出按outputTokens计费。
需要覆盖定价时,可在 profile 的 cordis.patch.yml 按 id: opencode-go-quota
覆盖整行配置并重写 providers..pricing,字段形如:
pricing:
deepseek-v4-pro:
effectiveAt: 2026-08-17T00:00:00
peakHours:
- start: 9
end: 12
- start: 14
end: 18
original:
cacheHit: 0.025
cacheMiss: 3.0
output: 6.0
offPeak:
cacheHit: 0.15
cacheMiss: 4.5
output: 13.5
peak:
cacheHit: 0.30
cacheMiss: 9.0
output: 27.0
kind: plan要求usageUrl返回usage.rolling|weekly|monthly(OpenCode Go 格式)。kind: tokens要求balanceUrl返回{ is_available, balance_infos: [...] }(DeepSeek 官方格式)。currency指定余额/消费币种偏好;省略时选第一行非零余额。