Lov Check Balance logo

Lov Check Balance

Organization
lovstudio
lov-check-balance

一条命令查清 Claude、Codex、DeepSeek 等 agent 账号的剩余额度与重置时间,合并官方订阅窗口、API 余额、本地网关消费与消耗速率;用户说“查我的额度”“还有多少用量”“什么时候重置”,或问 how much quota is left 时使用。

Overview

Publisherlovstudio
Repositoryskills
Skill namelov-check-balance
Stars
67
Forks
17
Bundled files
13
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 13 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by lovstudio on GitHub. Read the source before you install it.

Installation

Install the Lov Check Balance AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/lovstudio/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/check-balance .claude/skills/lov-check-balance
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Lov Check Balance in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Lov Check Balance on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Lov Check Balance is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

额度体检 · Check Balance

把散落在不同 agent 里的「还剩多少、什么时候重置」收敛成一张只读体检表:官方 订阅的窗口额度、API 平台的预付余额、本地网关的真实消费,以及按当前强度还能用多久。

Triggers

Activate when

  • 用户说“查一下我的额度”“Claude / Codex 还有多少用量”“什么时候重置”“余额还够用几天”。
  • 用户要在被限流或余额见底前收到提醒,或需要把额度纳入定时巡检。
  • User asks "how much quota do I have left", "when does the Codex limit reset", or "check the API balance".

Do not activate when

  • 用户要管理、轮换或新增 API Key 本身;交给 lov-env-management,本 Skill 只读现有凭据。
  • 用户要设置定时执行与通知渠道;交给 lov-yoda-automation,本 Skill 只提供 --json 输入。
  • 用户要清理磁盘空间或归档文件;交给 lov-clean-mac
  • 用户要充值、购买或升级订阅;本 Skill 只报告现状,不执行任何计费操作。

输出契约

每次运行输出同一份结构,默认渲染为文本表,--json 输出机器可读版本:

  • providers[]:每个账号的 idstatus(ok / expired / unavailable)、计划、 窗口用量与重置时间,或余额与币种。
  • burn_rate:可选。--watch 二次采样后给出每小时消耗与剩余可用天数。
  • alerts[]:已用满的窗口、低于阈值的余额、未设置日/月限额的 provider。

只读不变量:脚本不刷新 token、不写入任何凭据、不打印密钥;缺失的来源只标记 unavailable 并给出补救提示,不影响其它 provider。

User Profile(跨 session)

本 Skill 在 skill.yaml 中声明 user-profile/v1。运行时按「当前请求 → 项目 上下文 → Skill 记录 → 共享 preferences → 共享 user/workspace → 安全默认值」 解析。用户直接说出的长期偏好(例如网关日志路径、余额告警阈值)通过 scripts/profile_store.py record --skill-id lov-check-balance --path records.<字段> --value <值> --confirm 写回,并回报保存路径。凭据本身永远不写入 Profile。

Skill Group Composition

先读 references/skill-composition.md。相邻能力以可选交接为主:上游 lov-env-management 负责凭据生命周期,下游 lov-yoda-automation 负责定时与 通知;本 Skill 不隐藏依赖任何 sibling。

Workflow(MANDATORY)

Step 0: 解析运行上下文

  • 优先使用宿主提供的 SKILL_DIR,否则按当前 Skill 上下文推断安装目录。
  • 确认 scripts/check_balance.pyreferences/providers.md 存在,缺失则报出 期望的相对路径并停止。
  • 解析 Profile:--profile 参数 → LOVSTUDIO_PROFILE → 共享 Profile 默认路径。

Step 1: 执行探测

bash
python3 scripts/check_balance.py \
  --gateway-log "$GATEWAY_LOG" \
  --min-balance-cny "${MIN_BALANCE_CNY:-50}"
  • 只查某一类账号时用 --only codex--only deepseek,可重复。
  • 需要结构化下游消费时加 --json
  • 结果先按 references/providers.md 核对每个 provider 的来源与重置语义。

Step 2: 需要速率时二次采样

bash
python3 scripts/check_balance.py --watch 120 --json
  • 采样窗口建议 ≥120 秒:余额按批次结算,短窗口的隐含汇率不可作为结论。
  • 余额未变化时脚本自动回退到网关计价估算,并标注 estimate_basis

Step 3: 交叉验证与汇报

  • 官方订阅报告「已用百分比 + 重置时间」,预付余额报告「剩余金额 + 消耗速率」。
  • 用网关消费与余额变化互相校验;两者口径冲突时同时列出,不擅自取一个当真值。
  • 汇报最小充分集合:每个账号的剩余、重置时间、数据来源,以及需要用户动作的项。

Dependencies

  • Python 3.8+(仅标准库:urllib / sqlite3 / subprocess / json)。
  • 可选输入:macOS Keychain、~/.codex/auth.json、cc-switch SQLite、LiteLLM 请求日志。
  • 无第三方依赖、无需网络写权限;未配置的来源按不可用处理。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Lov Check Balance AI skill do?

一条命令查清 Claude、Codex、DeepSeek 等 agent 账号的剩余额度与重置时间,合并官方订阅窗口、API 余额、本地网关消费与消耗速率;用户说“查我的额度”“还有多少用量”“什么时候重置”,或问 how much quota is left 时使用。

Why use Lov Check Balance on TypingMind?

Because you install it once and use it with any model. Lov Check Balance is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Lov Check Balance in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/lovstudio/skills/tree/main/skills/check-balance. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Lov Check Balance?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Lov Check Balance?

As many as you like. As long as a model supports skills, you can use Lov Check Balance with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Lov Check Balance AI skill free?

Yes. It is published on GitHub by lovstudio under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇