dshiq04/dsh-deepseek-balance ↗★ 0
dsh-deepseek-balance
DeepSeek API balance widget for the dsh web UI: total balance with currency shown above Settings, hover details (currency / total / granted / topped-up), developer-configurable color, and a manual refresh button with transition animations. 适合想查看余额明细的用户,需配置 API 密钥并重启。
Other repositories with this package name
Install
This plugin has no verified bundle, or compatibility checks failed. Read the repository notes first. Read the full README ↗
README
Read the full README ↗快速使用 Quick start
- 安装插件到 web profile(见下方「Installation」)并重启
dsh web。 - 打开 Settings → 余额 (Balance),填入你的 DeepSeek API Key(或在环境变量
DEEPSEEK_API_KEY/ Models 页面里配置,见「API key resolution」)。 - 点 检查余额 (Check balance) —— 显示
Connection OK:即成功。 - 侧边栏底部(设置按钮上方)随即出现余额小部件:悬停查看货币 / 总余额 / 赠金 / 充值详情,点刷新按钮手动刷新,也可在设置页开启自动刷新间隔与主题色。
Configuration
All settings live under the dsh-deepseek-balance: section in $DSH_HOME/settings.yaml, or in the Settings → 余额 (Balance) page:
| Field | Default | Meaning |
|---|---|---|
apiKey | (empty) | Your DeepSeek API key (write-only; never read back to the browser). |
apiKeyEnv | DEEPSEEK_API_KEY | Environment variable / credential reference holding the key. |
baseURL | https://api.deepseek.com | API endpoint; GET /user/balance is used. |
color | #4d6bfe | Balance text / popover accent color. |
refreshIntervalMs | 0 | Auto-refresh interval in ms (0 = manual refresh only). |
限制:远程浏览器无法使用
- 余额 API 路由做了 loopback 防护(见
lib/index.js):拒绝非127.0.0.1/localhost/[::1]的Host头与跨域Origin。 - 因此从另一台设备的浏览器访问同一 web UI 时,余额请求会返回 403,小部件只显示「请求被拒绝」。
- 设置页同样仅本机浏览器可写(远程浏览器会提示「远程浏览器无法持久化设置」)。