DeepSHPlugins
dsh-api-balance 项目预览
GITHUB / COMMUNITY PROJECT

dsh-api-balance

安全与运维JavaScriptMIT

DeepSeek Harness 悬浮 API 余额徽章:实时显示 DeepSeek / Moonshot / OpenAI / 自定义接口余额;可拖动缩放、亚克力质感、文字颜色随下方内容明暗自适应。

1 StarsGPIOX 更新时间 2026-08-17
访问 GitHub 仓库
dsh-api-balance 项目预览

项目介绍

中文

DeepSeek Harness 悬浮 API 余额徽章:实时显示 DeepSeek / Moonshot / OpenAI / 自定义接口余额;可拖动缩放、亚克力质感、文字颜色随下方内容明暗自适应。

English

Floating API-balance badge for DeepSeek Harness: live balance for DeepSeek, Moonshot, OpenAI and custom endpoints; draggable, resizable, frosted-glass look, with text color adapting to the content beneath.

项目信息与收录信号

快照 2026-09-11
作者 / 组织
GPIOX
仓库
GPIOX/dsh-api-balance
GitHub Stars
1
Forks
1
开发语言
JavaScript
许可证
MIT
最近推送
2026-08-17
Manifest
数据中检测到声明

公开仓库不自动等于可商用;许可证与当前兼容性以原项目文档为准。Manifest 和数据评分不构成安装安全认证。

数据评分

59/ 100
维护活跃
83
文档与实用信息
100
生态关注度
24
安装便捷信号
55
项目声明信号
100

README 含完整安装与使用说明;关注度尚低(1)。

评分来自已有数据快照的五维模型,仅作浏览参考,不是实际使用评测或安全检测结论。

安装与使用

所有项目资料与许可均以对应 GitHub 仓库为准。

dsh plugin --profile web add github:GPIOX/dsh-api-balance

复制命令不会自动执行。请先阅读仓库文档,确认环境要求与许可证。

项目截图

仓库 README

GitHub 原文

已保存的仓库文档快照;文档抓取时间未记录,可能与上方目录介绍处于不同版本。安装前请核对当前仓库说明。

DSH API Balance · Floating API Balance Badge

A floating badge for the DeepSeek Harness (DSH) Web GUI. Shows your LLM API account balance, drags anywhere, resizes, and switches text color to match whatever sits beneath it.

License: MIT Platform

中文文档

Screenshots

Badge over light content, text switches to dark

Badge over dark content, text switches to light

Frosted-glass acrylic texture

The screenshots show the badge itself only. No real UI or conversation content.

Features

  • Floats in a frame-wide overlay above every column. Click-through, so it never blocks the app underneath.
  • One badge per configured provider. Drag each one anywhere and resize it from 70% to 250% with its bottom-right handle.
  • Frosted-glass look: translucent neutral tint, backdrop blur, a thin border. Reads fine on light and dark skins.
  • Text color follows the brightness of the content beneath each badge, light text over dark areas and dark text over light ones. Sampled every 1.5 seconds.
  • Balance providers (DeepSeek, Moonshot, OpenAI, custom endpoint) show the currency balance. OpenCode Go shows its subscription quota in three windows: rolling 5h, weekly, and monthly, each with used and remaining percentages and a reset countdown.
  • Click a badge to refresh all of them. Data refreshes itself every minute by default, configurable down to 30 seconds.
  • API keys stay in the Harness credential store (~/.dsh/.credentials.yaml) and never reach the browser.
  • The settings page manages the provider list (enable/disable, order), per-provider keys, balance and quota details, badge visibility, and position reset.

Installation

One command installs the plugin into your DSH web profile and registers it automatically (dsh plugin reconciles dsh.profile.bundles for you). The tarball form is plain HTTPS. You don't need a GitHub account, an SSH key, or git:

dsh plugin --profile web add https://github.com/GPIOX/dsh-api-balance/archive/refs/heads/main.tar.gz
Alternative git-based form (resolves through your local git configuration): dsh plugin --profile web add github:GPIOX/dsh-api-balance.

Then restart DSH (stop the dsh process and run it again, e.g. dsh web), refresh the page, and open Settings › API Balance to save your key. The badge shows up right away.

Uninstall / rollback:

dsh plugin --profile web remove dsh-api-balance-badge
The in-app Market (Settings › Plugins/Market) can install it too once it is listed in the awesome-dsh-plugin registry. For local development: dsh plugin --profile web add link:/path/to/dsh-api-balance-badge.

Zero-install quick start (dynamic plugin)

If you would rather not touch your profile, paste the plugin into any DSH Web GUI session as a dynamic plugin. No build step and no restart:

  1. Call the cordis_define tool (kind: "new", any 3-6 letter prefix) and paste

plugins/api-balance/host.js / plugins/api-balance/client.js as code.host / code.client

  1. Activate the returned Package with cordis_run and click Approve on the run card
  2. Open Settings › API Balance, pick a provider, paste your key, and save. The badge shows your balance immediately
Dynamic plugins live in the process, not on disk. After a DSH restart, define and activate it again (both source files are in this repo).

Supported providers

ProviderBalance endpointAuthNotes
DeepSeekGET https://api.deepseek.com/user/balanceAPI Key (sk-...)total / granted / topped-up (CNY)
Moonshot (Kimi)GET https://api.moonshot.cn/v1/users/me/balanceAPI Key (sk-...)available / voucher / cash (CNY)
OpenAIGET https://api.openai.com/dashboard/billing/credit_grantsBrowser session token (sess-...)OpenAI offers no API-key balance endpoint; session tokens expire
OpenCode GoGET https://opencode.ai/zen/go/v1/usageAPI key (usually OPENCODE_GO_API_KEY, written by the DSH Models page)subscription quota: rolling 5h / weekly / monthly, each with used and remaining percentage plus reset time
Customany GET endpoint (Bearer auth)your ownJSON field paths like data.available_balance or balance_infos[0].total_balance, such as relay stations

Security

  • The browser only sees whether a key is configured. The plaintext key is never sent back to the page.
  • Keys are stored by the Harness credential service (~/.dsh/.credentials.yaml), the same place DSH keeps its other secrets.
  • Requests use native fetch (packaged install) or curl with the key via environment variable (dynamic plugin). Either way the key never lands in process listings or the browser.

Repository layout

.
├── assets/                  # README screenshots (badge renders, no real UI content)
├── lib/index.js             # Host half: /dsh-api-balance-badge/* HTTP routes + credential handling
├── client/client.js         # Client half: floating badge + settings page (factory bundle)
├── cordis.patch.yml         # Bundle patch inserting this plugin into a profile
├── package.json             # DSH plugin package manifest (dsh.bundle / dsh.client)
├── plugins/api-balance/     # Same halves as dynamic-plugin sources (zero-install path)
│   ├── host.js
│   ├── client.js
│   └── README.md
├── LICENSE                  # MIT
├── README.md                # this file (English)
└── README.zh-CN.md          # 中文文档

License

MIT © 2026 GPIOX

使用前核对

安装步骤、兼容版本与授权范围以原项目当前文档为准。Stars 和评分是快照中的导航信号。

安装与排错 · 项目问题反馈

同类项目