Agent skill

PiDeck Usage Probe Helper

by ayuayue in ayuayue/PiDeck

Helps show a model provider's usage, balance or quota in PiDeck: checks built-in support, points to the dialog templates, or writes a custom probe entry.

MITAuto-check passedAI & LLM Engineering

SKILL.md written in Chinese; this summary is our English description.

Install PiDeck Usage Probe Helper

skills CLI
$ npx skills add ayuayue/PiDeck --skill usage-probe -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ayuayue/PiDeck usage-probe --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ayuayue/PiDeck.git skills-src && mkdir -p .claude/skills && cp -r skills-src/resources/skills/usage-probe .claude/skills/usage-probe && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
usage-probe
GitHub stars
1k
Token cost
~1.4k tokens
SKILL.md length
300 words
Files
1
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

Helps show a model provider's usage, balance or quota in PiDeck: checks built-in support, points to the dialog templates, or writes a custom probe entry.

  • Works in 3 steps: 内置模板(零配置):命中内置候选的供应商开箱即用,弹窗里已识别、无需配置。 → 声明式模板(弹窗内可选):不在内置列表时,弹窗提供四个模板—— → 旧版探针数组(AI 兜底):上面都覆盖不了的接口(如自建网关的自定义余额端点),
  • Showing balance or quota for a model provider in PiDeck
  • SKILL.md covers 这是什么, 你(AI)的工作流程, 配置文件结构 and 完整示例, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

PiDeck shows provider usage or balance at the bottom of each provider card, and this skill helps when a provider is missing from that display. First the agent checks whether the provider is already built in, by reading its base URL from the models.json config and comparing it with the built-in list. That list covers DeepSeek, OpenRouter, Moonshot, Kimi For Coding, Zhipu GLM Coding Plan, OpenCode Go, Codex and ChatGPT, xAI Grok, and gateways implementing the OpenAI-style usage endpoint. If it matches, no configuration is needed.

If the provider is not built in, the agent guides you to the usage dialog on the provider card and one of four templates: generic, New API, Cookie, or Volcengine Ark AK/SK. The Ark template needs an access key pair from the Volcengine console rather than the inference API key.

When none of the templates fit, the agent writes an entry in the probes array of ~/.pi/agent/usage-probes.json after finding the provider's balance endpoint, possibly from a browser network capture with keys removed. Probes must not contain API keys because the app adds the bearer header itself, and the dialog-managed providers map is left alone. Changes apply immediately, and you confirm by opening the provider card.

When your agent uses it

  • Showing balance or quota for a model provider in PiDeck
  • Finding out whether a provider's usage display is already built in
  • Writing a custom probe for a gateway with its own balance endpoint

Example prompts

  • “Make my DeepSeek provider show its remaining balance in PiDeck.”
  • “My New API relay needs a usage display; which template should I use?”
  • “Write a usage probe for my self-hosted gateway's balance endpoint.”

Requirements

  • The PiDeck desktop app with its usage query dialog
  • Provider entries in ~/.pi/agent/models.json

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. 内置模板(零配置):命中内置候选的供应商开箱即用,弹窗里已识别、无需配置。
  2. 声明式模板(弹窗内可选):不在内置列表时,弹窗提供四个模板——
  3. 旧版探针数组(AI 兜底):上面都覆盖不了的接口(如自建网关的自定义余额端点),

What it can do on your machine

Read from SKILL.md and the folder at commit e220aea. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are jsonc and json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

PiDeck Usage Probe Helper loads about 1.4k tokens when it runs. Until then it costs about 47 tokens; SKILL.md has 300 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~47
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ayuayue/PiDeck at commit e220aea, republished under its MIT licence (© ayuayue). 300 words, ~1,366 tokens.

Download SKILL.mdSave it as .claude/skills/usage-probe/SKILL.md (or your agent's skills folder).
name
usage-probe
description
为 PiDeck 的「用量查询」功能排查/扩展供应商支持。当用户想显示某个供应商的用量、余额或额度点数时,先判断是否已内置支持(内置无需配置);不在内置时引导用户使用「用量查询」弹窗里的通用 / New API / Cookie / 火山方舟 AK-SK 模板;四种模板都覆盖不了的接口,帮用户写出 usage-probes.json 的旧版探针数组。

用量查询辅助(usage-probe)

这是什么

供应商的用量/余额显示在「设置 → 配置管理 → 模型/认证」的 供应商卡片底部 (学 cc-switch:所有卡片同一位置、右对齐:相对时间 + 彩色数值 + 刷新按钮)。 支持分三层:

  1. 内置模板(零配置):命中内置候选的供应商开箱即用,弹窗里已识别、无需配置。 当前内置:
    • 官方余额:DeepSeek(/user/balance)、OpenRouter(/api/v1/key per-key 额度)、 Moonshot 官方余额(/users/me/balance);
    • 套餐额度:Kimi For Coding(/usages,含 Boost 点数)、智谱 GLM Coding Plan (5h 滚动窗 / 周窗 / MCP 月度窗)、OpenCode Go(/usage 三档百分比);
    • 官方订阅(登录态 OAuth,凭据来自 auth.json):Codex/ChatGPT(/wham/usage)、 xAI Grok(billing 预检链);
    • 通用 OpenAI 兼容网关兜底:实现了官方 /v1/usage({ balance, unit })的中转站自动显示余额。
  2. 声明式模板(弹窗内可选):不在内置列表时,弹窗提供四个模板——
    • 通用模板:请求 /usage(OpenAI 兼容),API Key / 请求地址可覆盖(留空用供应商的);
    • New API:New API / OneAPI 中转站,填 访问令牌 + 用户 ID(积分自动换算);
    • Cookie:自研网关的网页后台接口(需要登录态 Cookie,不能用 API Key);
    • 火山方舟 AK/SK:方舟(ark)的 Agent Plan / Coding Plan 额度,填控制台生成的 Access Key ID + Secret Access Key,Region 自动从推理 base_url 推断;同一个账号 只订阅哪一种套餐都能识别(两个 Action 依次探测,未订阅的那个返回全 0 自动跳过)。
  3. 旧版探针数组(AI 兜底):上面都覆盖不了的接口(如自建网关的自定义余额端点), 由 AI 写 ~/.pi/agent/usage-probes.json 的 probes 数组(见下文),运行时按 baseUrl 关键字匹配合入探测。

配置文件位置(和 models.json 同一个目录):

~/.pi/agent/usage-probes.json

改完立刻生效(无需重启)。顶层 providers 映射由弹窗维护,AI 不要手改; probes 数组才是开放给 AI 写的部分。

改完立刻生效(无需重启),下次打开供应商卡片就能读到新配置。

你(AI)的工作流程

当用户说「帮我让 XX 供应商显示用量」时,按下面顺序做:

  1. 先判断是否已内置:读 ~/.pi/agent/models.json 找到该 provider 的 baseUrl, 对照上面的内置清单。命中就直接告诉用户「已内置,无需配置,卡片底部会自动显示」, 不需要写任何文件。apiKey 的位置不用读出来,也不要把 key 贴到任何地方。
  2. 没内置 → 引导弹窗模板:让用户在供应商卡片点「用量查询」打开弹窗:
    • OpenAI 兼容站点(有 /usage 端点)→ 选「通用模板」,必要时填请求地址(留空用供应商的);
    • New API / OneAPI 中转站 → 选「New API」,填访问令牌和用户 ID;
    • 火山方舟(ark,含 Coding Plan / Agent Plan)→ 选「火山方舟 AK/SK」,让用户到火山引擎 控制台「访问控制 → 密钥管理」创建 AK/SK 填进去(不是方舟的推理 API Key:那个是 Bearer 鉴权,控制面 OpenAPI 只认 AK/SK 签名);
    • 两个模板都覆盖不了 → 继续第 3 步。
  3. 写旧版 probes 数组:确认该供应商的「余额 / usage / balance / credits」接口 (拿不到文档时让用户 F12 抓包,把 URL 路径和返回 JSON 发给你;记得提醒用户 抹掉 key/token),确定「剩余额度」字段后按下面结构生成 probes 数组。
  4. 验证:让用户打开供应商卡片看底部用量行。不显示就继续对齐字段路径。

重要安全边界:probes 数组里不要写 apiKey。鉴权统一走 Authorization: Bearer <key>, 主进程自动从 auth.json/models.json 取 key;只有个别接口用非标准鉴权头时才用 "headers": { "X-API-Key": "{{apiKey}}" } 占位。 例外:火山方舟模板的 AK/SK 由弹窗写进顶层 providers 映射(不走 probes 数组), 只用于本地派生请求签名,不进日志与遥测。

配置文件结构

顶层 providers 映射由弹窗维护(开关/模板/超时/间隔),AI 不要手改。 下面这个 probes 数组是开放给 AI 写的兜底部分,每条是一个供应商。字段含义:

jsonc
{
  "probes": [
    {
      // (可选)只是给自己看的名字,不影响功能
      "name": "我的中转站",

      // 匹配条件:你的供应商 baseUrl 里包含的任意关键字(小写匹配)
      "match": {
        "baseUrlContains": ["api.myprovider.com"]
      },

      // 发什么请求
      "request": {
        "path": "/user/balance",   // 相对 baseUrl 的路径,必须以 / 开头
        "method": "GET",            // 可选,GET 或 POST,缺省 GET
        // "body": { ... },         // 可选,POST 时的请求体
        // "headers": { "X-API-Key": "{{apiKey}}" }  // 可选,非标准鉴权头
      },

      // 怎么从响应里取数(三种形态选一种)
      "parse": {
        "kind": "balance",
        "valuePath": "balance_infos[0].total_balance",   // 剩余额度的字段路径
        "currencyPath": "balance_infos[0].currency"      // 可选,币种
      }
    }
  ]
}
三种 parse 形态

1. balance(剩余额度,一个数字 + 可选币种)

jsonc
"parse": {
  "kind": "balance",
  "valuePath": "data.available_balance",
  "currencyPath": "data.currency"
}

2. credits(额度点数,总额 / 已用 / 剩余,至少给一个)

jsonc
"parse": {
  "kind": "credits",
  "totalPath": "data.total_credits",     // 可选
  "usedPath": "data.total_usage",        // 可选
  "remainingPath": "data.remaining"      // 可选;不给时会用 total-used 自动算
}

3. periods(三档百分比:滚动 / 周 / 月)

jsonc
"parse": { "kind": "periods" }

periods 形态不需要写字段路径:解析器会自动找响应里的 usage.rolling / usage.weekly / usage.monthly,每档取 percent / resetsAt / status。 只要你的供应商接口返回类似 { "usage": { "weekly": { "percent": 68 } } } 的结构, 直接用 periods 即可,不用写路径。

字段路径怎么写

用「点号 + 方括号」从响应根一层层往下指:

  • data.balance → { "data": { "balance": 110 } } 里的 110
  • balance_infos[0].total_balance → 数组第一项的 total_balance
  • data.credits.total → 嵌套对象

数字可以是 number,也可以是能转成数字的字符串(很多网关余额字段是 "110.00" 这种字符串)。

完整示例

示例一:某 OpenAI 兼容网关返回 { data: { balance: 12.5, currency: "USD" } }
json
{
  "probes": [
    {
      "name": "我的网关",
      "match": { "baseUrlContains": ["gateway.example.com"] },
      "request": { "path": "/v1/balance" },
      "parse": {
        "kind": "balance",
        "valuePath": "data.balance",
        "currencyPath": "data.currency"
      }
    }
  ]
}
示例二:OpenRouter(额度点数)
json
{
  "probes": [
    {
      "name": "OpenRouter",
      "match": { "baseUrlContains": ["openrouter.ai"] },
      "request": { "path": "/credits" },
      "parse": {
        "kind": "credits",
        "remainingPath": "data.total_credits",
        "usedPath": "data.total_usage"
      }
    }
  ]
}

提示:不同网关字段名可能不同,以上示例里的字段名请以官方文档或实际抓包为准。

排查清单

  • 供应商卡片底部用量行完全没显示:先看弹窗是否命中「已内置」;未命中就看模板选对没有;
  • 显示「用量暂时不可用」:接口字段路径没对上,把脱敏后的响应 JSON 发给 AI 帮你对齐;
  • 显示「用量查询未开启」:弹窗里的启用开关没开(或之前显式关闭过),打开即可;
  • 显示「当前 provider 暂不支持用量查询」:说明没有匹配到任何探针。检查 match.baseUrlContains 里的关键字,是不是和 models.json 里那个 provider 的 baseUrl 完全不一致(注意大小写、是否带 /v1)。
  • 配置写错了 JSON:主进程会忽略整条非法探针并在日志里提示,不会影响内置探针。
  • 余额显示成「0」:可能字段取错了位置,或接口返回的字段本身是「已用」而不是「剩余」。

© ayuayue, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in resources/skills/usage-probe of ayuayue/PiDeck.

Open the folder on GitHubat commit e220aea

Compare with similar skills

PiDeck Usage Probe Helper next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

PiDeck Usage Probe Helper compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
PiDeck Usage Probe Helper this skillayuayue/PiDeck1k—~1.4kAutomated safety check: PassMIT
Keirouter Chatmydisha/keirouter147—~859Automated safety check: PassMIT
OpenCode Agent Provider for NanoClawnanocoai/nanoclaw31k—~5kAutomated safety check: NotesMIT
AI Chatmajiayu000/claude-skill-registry6661 repos~1.3kAutomated safety check: PassApache-2.0
LLM Modelsmajiayu000/claude-skill-registry6661 repos~992Automated safety check: PassMIT
Reasoning Serialization Teststailcallhq/forgecode7.6k—~1kAutomated safety check: PassApache-2.0

Similar skills

  • Keirouter Chat

    mydisha/keirouter

    Chat / code generation via KeiRouter using OpenAI /v1/chat/completions or Anthropic /v1/messages format with streaming + auto-fallback combos.

    147 GitHub stars~859 tokensUpdated 26 days ago
    AI & LLM EngineeringAuto-check passed
  • Installs OpenCode as an optional NanoClaw agent runtime, reaching OpenRouter, OpenAI, Google, DeepSeek and others through OpenCode's own configuration.

    31k GitHub stars~5k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check: notes
  • AI Chat

    majiayu000/claude-skill-registry

    Access 50+ LLM models through a unified OpenAI-compatible API via AceDataCloud.

    666 GitHub starsUsed in 1 repo~1.3k tokens
    AI & LLM EngineeringAuto-check passed
  • LLM Models

    majiayu000/claude-skill-registry

    Access Claude, Gemini, Kimi, GLM and 100+ LLMs via inference.sh CLI using OpenRouter.

    666 GitHub starsUsed in 1 repo~992 tokens
    AI & LLM EngineeringAuto-check passed
  • Reasoning Serialization Tests

    tailcallhq/forgecode

    Checks that ReasoningConfig fields are serialized into the right provider-specific JSON for OpenRouter, Anthropic, GitHub Copilot and Codex requests.

    7.6k GitHub stars~1k tokensUpdated today
    Testing & QAAuto-check passed
  • Using Ccproxy API

    starbaser/ccproxy

    Guides users through ccproxy as an OpenAI-compatible and Anthropic-compatible LLM API server with SDK integration, OAuth authentication, sentinel key substitution, model routing, and troubleshooting.

    348 GitHub stars~4k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed

More from ayuayue/PiDeck

  • Calls an OpenAI-compatible image generation API using PiDeck's separate image-provider config, then saves the result as a local file.

    1k GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Diagnoses problems in the PiDeck desktop app from a redacted environment report, matching health checks to known failure patterns with fix steps.

    1k GitHub stars~566 tokensUpdated today
    Auto-check passed

Questions about PiDeck Usage Probe Helper

What does PiDeck Usage Probe Helper do?

Helps show a model provider's usage, balance or quota in PiDeck: checks built-in support, points to the dialog templates, or writes a custom probe entry. PiDeck shows provider usage or balance at the bottom of each provider card, and this skill helps when a provider is missing from that display.json config and comparing it with the built-in list.

When should I use PiDeck Usage Probe Helper?

PiDeck Usage Probe Helper fits situations like: showing balance or quota for a model provider in PiDeck; finding out whether a provider's usage display is already built in; writing a custom probe for a gateway with its own balance endpoint.

How do I install PiDeck Usage Probe Helper in Claude Code?

Run `npx skills add ayuayue/PiDeck --skill usage-probe -a claude-code`. Or copy the skill folder (resources/skills/usage-probe in ayuayue/PiDeck) into .claude/skills/usage-probe in your project. Claude Code loads it when a task matches its description.

How do I install PiDeck Usage Probe Helper in Codex?

Run `npx skills add ayuayue/PiDeck --skill usage-probe -a codex`. Or copy the skill folder (resources/skills/usage-probe in ayuayue/PiDeck) into .agents/skills/usage-probe in your project. Codex loads it when a task matches its description.

Can I use PiDeck Usage Probe Helper in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ayuayue/PiDeck --skill usage-probe -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/usage-probe, .gemini/skills/usage-probe, .github/skills/usage-probe and .opencode/skills/usage-probe in your project.

What does PiDeck Usage Probe Helper need to run?

SKILL.md names no scripts, command-line tools or credentials: PiDeck Usage Probe Helper is instructions for the agent only. Our summary lists: The PiDeck desktop app with its usage query dialog; Provider entries in ~/.pi/agent/models.json.

Does PiDeck Usage Probe Helper access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is PiDeck Usage Probe Helper safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does PiDeck Usage Probe Helper use?

PiDeck Usage Probe Helper is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does PiDeck Usage Probe Helper use?

About 1.4k tokens (SKILL.md is roughly 5.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to PiDeck Usage Probe Helper?

Skills that share tags, products or a category with PiDeck Usage Probe Helper: Keirouter Chat (mydisha/keirouter, 147 stars), OpenCode Agent Provider for NanoClaw (nanocoai/nanoclaw, 31k stars), AI Chat (majiayu000/claude-skill-registry, 666 stars) and LLM Models (majiayu000/claude-skill-registry, 666 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains PiDeck Usage Probe Helper?

ayuayue (a GitHub user) maintains it in ayuayue/PiDeck, which has 1,025 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 7, 2026.

Source: ayuayue/PiDeck on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.