← 返回列表
D

dsh-plugin-api-quota

v0.1.0 · 3 天前发布

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.

dshdsh-plugindeepseek-harnesspluginweb-uiapi-quotabalance

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) |

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

    快速开始

    DSH 插件安装进 profile(dsh web

    版本兼容矩阵

    DSH 版本状态说明
    dsh@0.1.0-rc.6 ✅ 兼容 cordis patch ✅
    dsh@0.1.0 ✅ 兼容 标准 patch ✅
    dsh@0.2.0 ⚠️ 待验证 待实测(API 可能在变)
    dsh@0.3.0+ ❓ 未知 尚未发布

    💡 兼容矩阵每周末自动跑实测,欢迎 PR 修正

    元数据

    License
    MIT
    npm
    dsh-plugin-api-quota
    Repo
    Engines
    {}
    Weekly DL
    0
    Monthly DL
    0
    dsh.bundle
    {"bundle":{"patch":"./cordis.patch.yml"},"client":{"platform":"web","inject":["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-ui-slots","@deepseek-ai/dsh-client-ui-primitives"]}}