SamuFlore/query-balance

DSH plugin for query API balance by asking question.

项目介绍Project Overview

DSH 查询余额工具:注册 query_api_balance 工具,调用 GET /user/balance 获取 DeepSeek API 账户余额。安装后启动 dsh web,向 agent 说"查询余额"即可使用。通过 dsh 凭据服务读取 DEEPSEEK_API_KEY,按进程环境变量、凭据存储、~/.dsh/.env、项目 .env 的顺序解析,返回 is_available、balance_infos 等原始 JSON。注意:需有效 API Key,否则无法查询。

A DSH plugin that registers the query_api_balance tool to call GET /user/balance and retrieve DeepSeek API account balance. Install via dsh plugin --profile web add, then start dsh web and ask the agent to check the balance. The tool reads DEEPSEEK_API_KEY through dsh credentials, checking process env, credential store, ~/.dsh/.env, and project .env in order, returning raw JSON with is_available and balance_infos. Note: a valid API key is required, otherwise queries will fail.

或使用命令行安装(适合开发者)Or use CLI install (for developers)

命令行安装CLI Install

dsh plugin --profile web add @samuflore/dsh-query-balance@latest

SamuFlore/query-balance 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

@samuflore/dsh-query-balance

DSH 查询 API 余额工具:注册 query_api_balance 工具,通过 GET /user/balance 查询 DeepSeek API 账户余额。

安装

dsh plugin --profile web add @samuflore/dsh-query-balance@latest

然后启动:

dsh web

使用

直接对 agent 说:

查询余额

前置条件

工具通过 dsh 的 credentials 服务读取 DEEPSEEK_API_KEY(解析顺序:进程环境变量 → 凭据存储 → ~/.dsh/.env → 项目 .env)。使用前请配置自己的 API Key:

export DEEPSEEK_API_KEY=sk-...

一般来说,在能够正常使用 DSH 的情况下,这一项已经正常配置了。

返回值

返回 /user/balance 接口原始 JSON(is_availablebalance_infos)。

API 参考

https://api-docs.deepseek.com/api/get-user-balance/

上一个 Prev dsh-exa-mcp 下一个 Next apaper-plugin