Gaq152/dsh-credits2

dsh-credits

DeepSeek Harness 额度插件:跟随当前模型切换官方余额 / OpenCode Go 订阅用量、本会话估算、跨会话累计消耗、可视化设置

包名
dsh-credits
版本
0.2.2
许可证
MIT
最近更新
2026年8月18日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Gaq152/dsh-credits

配置

覆盖文件:$DSH_HOME/profiles/web/cordis.patch.yml。也可在设置 → 额度 改完后按卡片点「保存」。

常用展示项:

配置默认说明
quotaModefollowfollow 跟随当前对话模型;custom 固定用下面的 provider
showDocktrue是否显示底部额度读数
dockLayoutownown 独立换行;shared 与底部已有统计共用一行
showCapsuletrue右下角累计消耗胶囊
showPopovertrue悬停底部读数时的双栏详情

OpenCode Go 回退

- id: dsh-credits
  config:
    quotaMode: follow
    showDock: true
    dockLayout: own
    showCapsule: true
    showPopover: true
    provider: opencode-go
    opencodeApiKeyRef: OPENCODE_GO_API_KEY
    opencodeBaseUrl: https://opencode.ai/zen/go/v1/usage
    warningThreshold: 10          # 无法识别模型时的默认回退; 选了 Go 模型会改看剩余额度 %
    dangerThreshold: 5            # 剩余额度 < 5% 红灯
    refreshIntervalMs: 300000
    clientPollIntervalMs: 30000
    timeoutMs: 15000
    currency: USD

这段 provider: opencode-go 只决定「还没选模型 / 识别失败」时先看哪一套。真正切到 Go 模型后才会用三个窗口的用量百分比与重置时间;状态灯按「剩余最少」的窗口判定。套餐没有固定美元上限可展示。

DeepSeek 人民币账户

- id: dsh-credits
  config:
    provider: deepseek
    apiKeyRef: DEEPSEEK_API_KEY
    baseUrl: https://api.deepseek.com
    warningThreshold: 10
    dangerThreshold: 5
    refreshIntervalMs: 300000
    clientPollIntervalMs: 30000
    timeoutMs: 8000
    currency: CNY
    prices:
      deepseek-v4-flash: { cacheHit: 0.02, cacheMiss: 1, output: 2 }
      deepseek-v4-pro: { cacheHit: 0.025, cacheMiss: 3, output: 6 }
      deepseek-chat: { cacheHit: 0.1, cacheMiss: 1, output: 2 }
      deepseek-reasoner: { cacheHit: 1, cacheMiss: 4, output: 16 }

DeepSeek 美元账户

- id: dsh-credits
  config:
    provider: deepseek
    apiKeyRef: DEEPSEEK_API_KEY
    baseUrl: https://api.deepseek.com
    warningThreshold: 2.0
    dangerThreshold: 0.5
    currency: USD
    prices:
      deepseek-v4-flash: { cacheHit: 0.0028, cacheMiss: 0.14, output: 0.28 }
      deepseek-v4-pro: { cacheHit: 0.0035, cacheMiss: 0.42, output: 0.84 }

prices 是「当前 currency 下每 1M token」的刊例单价。DeepSeek 账户的 CNY / USD 是两套独立钱包:底部会列出选定货币,以及其它仍有余额的钱包;悬停卡片列出全部钱包。计价货币只影响本会话/累计估算和状态灯,不会把其它钱包藏掉。切换货币时会套用该币种官方刊例单价,不会做汇率换算。V4 在 2026-08-17 之后按北京时间走峰谷价,人民币和美元同步切换(美元 = 人民币官方价 × 0.14)。