npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-plugin-api-quota

v0.1.0

Published

DSH Web UI plugin: check your DeepSeek API key balance/quota (GET /user/balance) from the sidebar, with a GUI panel showing total/granted/topped-up balance.

Downloads

471

Readme

dsh-plugin-api-quota

DSH Web UI 插件 — 在侧边栏查看你的 DeepSeek API key 额度。

English

功能

在 Web 侧边栏底部(设置按钮旁)新增 API 额度 入口,点击弹出面板,通过 DeepSeek 官方余额接口(GET /user/balance)查询当前 API key 的额度:

  • 总额度、赠送额度、充值额度
  • 币种与可用状态
  • 查询时间,支持一键刷新

API key 永远不会进入浏览器:浏览器半只请求同源的 /api-quota/balance 路由(由插件 host 半提供),host 半通过凭据服务(ctx.credentials)解析 key 并在服务端访问 DeepSeek。

工作原理

| 半区 | 职责 | | --- | --- | | Host(src/index.ts) | 在 web server 注册 GET /api-quota/balance;通过 ctx.credentials 解析 DEEPSEEK_API_KEY,调用 https://api.deepseek.com/user/balance | | 浏览器(src/client/) | 注册 sidebar.footer.action 槽位;请求该路由并渲染余额面板(Modal) |

凭据引用与端点均可通过插件配置调整(apiKeyEnv、baseURL、balancePath),默认值为 DEEPSEEK_API_KEY / https://api.deepseek.com / /user/balance。

快速开始

DSH 插件安装进 profile(dsh web → web profile)。安装后重启 dsh web 即可。

# 在插件仓库根目录
npm install && npm run build
# 在 profile 补丁层注册(~/.dsh/profiles/web/cordis.patch.yml):
#   - insert:
#       - id: plugin-api-quota
#         name: dsh-plugin-api-quota
# symlink 进 profile 的 node_modules:
#   ln -s "$PWD" ~/.dsh/profiles/web/node_modules/dsh-plugin-api-quota

配置项

| 字段 | 默认值 | 含义 | | --- | --- | --- | | apiKeyEnv | DEEPSEEK_API_KEY | 持有 API key 的凭据引用(环境变量形状) | | baseURL | https://api.deepseek.com | DeepSeek API 基础地址 | | balancePath | /user/balance | 附加到 baseURL 的余额接口路径 |

License

MIT