New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

dsh-api-balance

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dsh-api-balance

DeepSeek Harness web widget: API balance badge with today/month token usage, cache-hit donut chart and cost estimate. Hosts GET /api-balance and injects a bottom-right badge into the dsh web UI.

latest
npmnpm
Version
1.2.1
Version published
Weekly downloads
120
1.69%
Maintainers
1
Weekly downloads
 
Created
Source

dsh-api-balance

DeepSeek Harness 网页界面右下角的 API 余额角标:余额 + 当日/当月 token 用量与花费 + 缓存命中环形图。

功能

  • 总余额 / 赠送 / 充值(DeepSeek 官方 /user/balance 接口)
  • 当日 / 当月 token 用量与估算花费(单价可改)
  • 缓存命中环形图:命中率 + 命中/未命中量(命中绿、未命中琥珀)
  • API Key 不出服务器:走 dsh 凭据服务,浏览器只拿结果
  • 5 分钟自动刷新,点击立即刷新;统计持久化,重启不丢

安装

dsh plugin --profile web add dsh-api-balance
# 重启 dsh web 后 Ctrl+F5 强刷页面

要求:dsh >= 0.1.0-rc.3(node >= 22);DEEPSEEK_API_KEY 可被 dsh 凭据服务解析。

卸载

dsh plugin --profile web remove dsh-api-balance

配置(计费口径)

价格内置 DeepSeek 官方 deepseek-v4-flash 定价(USD/百万 tokens),并按 2026-08-16 16:00 UTC 起的分时计价自动切换(peak: 01-04/06-10 UTC):

时段缓存命中未命中输入输出
2026-08-16 前(V4-Flash-0731)$0.0028$0.14$0.28
之后 off-peak$0.007$0.22$0.66
之后 peak$0.014$0.44$1.32

花费 = token 量 × 单价(USD→CNY 按 FX=7.2 换算,可改),每次查询动态计算——调价后历史数据自动用新价重算。

工作原理

host 半端注册 GET /api-balance(余额+统计)、监听 session/event 提取 usage(含缓存命中)、 tapIndex 注入角标脚本到首页 HTML。纯 host 插件 + 注入式前端,不依赖 client-plugin 打包链。

License

MIT

Keywords

dsh

FAQs

Package last updated on 13 Aug 2026

Related posts