eh-tools/dsh-plugin--plugins-ds-balance ↗★ 1

dsh-ds-balance

DeepSeek 余额/调用量状态栏 — 静态双半插件(host HTTP API + client 状态栏行) 适合使用DeepSeek官方API、需要实时监控用量的用户。

Package
dsh-ds-balance
Compatibility
Unverified
Version
0.4.0
License
MIT
Last updated
Oct 11, 2026

Other repositories with this package name

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:eh-tools/dsh-plugin#8e89f6778b521326e6381cda83f6737bd83e1f40&path:plugins/ds-balance

配置

写入 ~/.dsh/.credentials.yaml(或环境变量),插件经 credentials 服务读取, 不进代码明文:

DEEPSEEK_API_KEY: sk-xxxx
DEEPSEEK_USER_TOKEN: 

自测(验证你的 userToken 能否查用量):

UA='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 Chrome/126.0.0.0 Safari/537.36'
TOKEN=''
MONTH=$(date +%-m); YEAR=$(date +%Y)            # Linux: date +%-m 换成 date +%m
curl -fsS -H "User-Agent: $UA" -H 'Origin: https://platform.deepseek.com' \
  -H 'Referer: https://platform.deepseek.com/usage' -H 'x-app-version: 1.0.0' \
  -H "Authorization: Bearer $TOKEN" \
  "https://platform.deepseek.com/api/v0/usage/amount?month=$MONTH&year=$YEAR"

返回 data.biz_data.days[] 即成功;code: 40002/40003 说明 token 已过期。