← 返回 Skills 市场
franciscobuiltdat

API Credit Health Bar Lite

作者 FranciscoBuiltDat · GitHub ↗ · v1.0.2
cross-platform ✓ 安全检测通过
639
总下载
0
收藏
0
当前安装
3
版本数
在 OpenClaw 中安装
/install api-credits-lite
功能描述
Display API credit balances for 5 core providers (Anthropic, OpenAI, OpenRouter, Mistral, Groq) with video game style health bars. API auto-checks and manual...
使用说明 (SKILL.md)

API Credits Lite

Use this skill when the user asks about API credits, balances, spending, or wants to update their credit info for Anthropic, OpenAI, OpenRouter, Mistral, or Groq.

When to Use

USE this skill when the user asks:

  • "How much credit do I have left?" / "What's my balance?"
  • "Show my API credits" / "Check my credits"
  • "Update my [provider] balance to $X"
  • "I topped up [provider] by $X"
  • "Am I running low on [provider]?"

DON'T use when:

  • The user needs 16+ providers, JSONL auto-tracking, cloud SDKs, or heartbeat integration → use api-credits-pro

How to Use

You run the scripts internally — the user never types python3. Respond naturally and present health bar output conversationally.

The skill root is at: ~/.openclaw/workspace/skills/api-credits-lite/ Run scripts with: python3 \x3Cskill-root>/scripts/\x3Cscript>.py \x3Cargs>


Show Credit Balances

Triggers: "show my credits", "how much do I have left", "check my API balance"

python3 scripts/show_credits.py

Displays retro health bars for all configured providers. Colors: 🟩 >75% · 🟨 50–75% · 🟧 25–50% · 🟥 \x3C25%


Manual Balance Sync

Triggers: "set my Anthropic balance to $X", "update my OpenAI credits to $X", "I have $X left on [provider]"

python3 scripts/sync_provider.py \x3Cprovider> \x3Cbalance>
# With max:  python3 scripts/sync_provider.py \x3Cprovider> \x3Cbalance> \x3Cmax_credits>

# Examples:
python3 scripts/sync_provider.py anthropic 22.97
python3 scripts/sync_provider.py openai 95.00 100.00

Supported providers: anthropic, openai, openrouter, mistral, groq

Where to find balances:

  • Anthropic → console.anthropic.com
  • OpenAI → platform.openai.com/usage
  • OpenRouter → openrouter.ai/activity
  • Mistral → console.mistral.ai/billing
  • Groq → console.groq.com/settings/billing

Auto-Check Balance via API

Triggers: "check my OpenAI balance automatically", "pull my OpenRouter credits"

For providers that expose a balance API (requires the relevant API key set as an env var):

python3 scripts/check_openai.py       # uses OPENAI_API_KEY
python3 scripts/check_openrouter.py   # uses OPENROUTER_API_KEY
python3 scripts/check_vercel.py       # uses VERCEL_AI_GATEWAY_KEY

Anthropic, Mistral, and Groq don't have public balance APIs — use manual sync for those.


Record a Top-Up

Triggers: "I added $X to my [provider] account", "I topped up $50 on OpenRouter"

python3 scripts/topup.py \x3Cprovider> \x3Camount>
# Example: python3 scripts/topup.py openrouter 20.00

Troubleshooting

If the display shows no providers, the config may be empty. Tell the user to run the first manual sync for each provider they use, or copy the example config:

cp config.example.json config.json

Upgrading

Need 16+ providers, auto-tracking from session logs, cloud SDKs (AWS/Azure/GCP), or heartbeat integration? Suggest api-credits-pro.

安全使用建议
This skill appears to do exactly what it says: local config-based health bars plus optional API checks for OpenAI, OpenRouter, and Vercel. Before installing or running: 1) Prefer manual-sync mode if you want zero network access (do not set any API env vars). 2) If you enable auto-checks, set only minimal-privilege or billing-scoped API keys where possible — avoid handing highly privileged org-admin keys unless you understand the billing API requirements. 3) Keep config.json permissioned (e.g., chmod 600) and do not store keys in files. 4) Review the check_openai.py note about requiring an org admin key — if you cannot get a minimally privileged key that returns billing info, use manual sync instead. 5) The repository contains duplicated scripts in root and scripts/ — expected for packaging but you can inspect files locally before running. If you need higher assurance, run the scripts in a disposable environment or review/execute them line-by-line to confirm network targets and no surprising behavior.
功能分析
Type: OpenClaw Skill Name: api-credits-lite Version: 1.0.2 The OpenClaw AgentSkills skill bundle 'api-credits-lite' is classified as benign. All code and documentation align with the stated purpose of tracking and displaying API credit balances. API keys are handled securely by being read from environment variables and not stored on disk. Network requests are limited to official API endpoints (OpenAI, OpenRouter, Vercel) for balance checks, as explicitly detailed in `SECURITY.md`. Input sanitization is present for command-line arguments in scripts like `sync_provider.py` and `topup.py`, preventing shell injection. There is no evidence of data exfiltration, persistence mechanisms, obfuscation, or prompt injection attempts in `SKILL.md` or `README.md`.
能力评估
Purpose & Capability
Name/description (API credit health bars) align with contained scripts: reading/writing a local config.json, rendering health bars, manual sync, and optional API auto-checks for OpenAI, OpenRouter, and Vercel. The optional env vars in SKILL.md (OPENAI_API_KEY, OPENROUTER_API_KEY, VERCEL_AI_GATEWAY_KEY) match the providers the code can query.
Instruction Scope
SKILL.md and scripts instruct only local config reads/writes and requests to official provider endpoints. One minor inconsistency: check_openai.py comments say it requires an "organization admin API key", while SECURITY.md recommends using project-level or minimal-privilege keys; this is a documentation/conflict note rather than evidence of exfiltration. Scripts run other local scripts via subprocess (expected for this tool).
Install Mechanism
No install spec: this is instruction/code-only and runs as local Python scripts. No remote downloads or extract steps, and no unusual install actions observed.
Credentials
The only environment access requested is optional API keys for the providers the skill actually queries. Keys are read from environment variables (not stored). The only concern is the check_openai.py docstring suggesting an org-admin key for billing access; that elevates privilege requirements for the OpenAI check and conflicts with the SECURITY.md guidance to prefer minimal-privilege keys.
Persistence & Privilege
Skill is not marked always:true and does not request system-wide persistence. It only writes a local config.json inside the skill directory and does not modify other skills or global settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install api-credits-lite
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /api-credits-lite 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.2
- Updated skill usage instructions to provide clear, conversational guidance for when and how to check, sync, or top up API credits. - Added explicit trigger examples for each feature, including manual and API-based balance updates. - Specified which providers support API auto-check (OpenAI, OpenRouter, Vercel) and which require manual sync. - Included troubleshooting tips for empty configuration and first-time setup. - Clarified upgrade path to api-credits-pro for advanced needs.
v1.0.1
- Initial public release with core scripts for tracking API credit balances. - Added video game style health bars for 5 providers: Anthropic, OpenAI, OpenRouter, Mistral, and Groq. - Supports both manual sync and API-based auto-checks for OpenAI, OpenRouter, and Vercel. - Includes threshold alerts, top-up tracking, and easy command-line commands for balance management. - Added scripts: show_credits.py, check_all_apis.py, check_openai.py, check_openrouter.py, check_vercel.py, sync_provider.py, render_healthbar.py, topup.py.
v1.0.0
Initial release: 5-provider health bar display with API auto-checks (OpenAI, OpenRouter, Vercel) and manual sync. Github: https://github.com/FranciscoBuiltDat/openclaw-api-credits-lite
元数据
Slug api-credits-lite
版本 1.0.2
许可证
累计安装 0
当前安装数 0
历史版本数 3
常见问题

API Credit Health Bar Lite 是什么?

Display API credit balances for 5 core providers (Anthropic, OpenAI, OpenRouter, Mistral, Groq) with video game style health bars. API auto-checks and manual... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 639 次。

如何安装 API Credit Health Bar Lite?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install api-credits-lite」即可一键安装,无需额外配置。

API Credit Health Bar Lite 是免费的吗?

是的,API Credit Health Bar Lite 完全免费(开源免费),可自由下载、安装和使用。

API Credit Health Bar Lite 支持哪些平台?

API Credit Health Bar Lite 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 API Credit Health Bar Lite?

由 FranciscoBuiltDat(@franciscobuiltdat)开发并维护,当前版本 v1.0.2。

💬 留言讨论