API Credit Health Bar Lite

👤 franciscobuiltdat 📦 v1.0.2 ⭐ 4.3 ⬇️ 1.4K 下載
📊 資料分析 免費

📖 技能介紹


name: api-credits-lite description: Display API credit balances for 5 core providers (Anthropic, OpenAI, OpenRouter, Mistral, Groq) with video game style health bars. API auto-checks and manual sync. optionalEnv: - OPENAI_API_KEY - OPENROUTER_API_KEY - VERCEL_AI_GATEWAY_KEY permissions: - network: Contact OpenAI, OpenRouter, and Vercel APIs to check balances (optional) - filesystem: Read/write config.json and health bar display


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 <skill-root>/scripts/<script>.py <args>


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% · 🟥 <25%


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 <provider> <balance>
# With max:  python3 scripts/sync_provider.py <provider> <balance> <max_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):

小蔥技能7w4.net有更新,你可以訪問看下。

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 <provider> <amount>
# 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.

🤖 AI 評測

這個 Skill 質量不錯,文件和說明非常詳細,使用者可以輕鬆上手使用。它能同時管理 5 個常用 AI 服務商的餘額,用炫酷的健康條樣式展示,一目瞭然。安全方面考慮周到,區分了無需聯網的安全模式和需要 API 金鑰的自動檢查模式。不過部分功能指令碼可能不完整,個別檔案看起來像是佔位符或還未開發完成,對於需要完整功能的人來說可能會有些失望。總體來說,核心功能紮實,介面友好,但建議等版本更穩定後再使用。

📊 多維度評分

適應性4.4
規範性4.4
有效性4.4
可靠性4.4
可信度4.2

📁 包含檔案 (23 個)

📄 .gitignore 421 B
📄 README.md 2.9 KB
📄 SECURITY.md 4.5 KB
📄 SKILL.md 3.4 KB
📄 _meta.json 135 B
📄 check_all_apis.py 2.7 KB
📄 check_openai.py 3.6 KB
📄 check_openrouter.py 3.9 KB
📄 check_vercel.py 3.9 KB
📄 config.example.json 1 KB
📄 package.json 1.2 KB
📄 render_healthbar.py 2.2 KB
📄 scripts/check_all_apis.py 2.7 KB
📄 scripts/check_openai.py 3.6 KB
📄 scripts/check_openrouter.py 3.9 KB
📄 scripts/check_vercel.py 3.9 KB
📄 scripts/render_healthbar.py 2.2 KB
📄 scripts/show_credits.py 3.3 KB
📄 scripts/sync_provider.py 5.2 KB
📄 scripts/topup.py 2.9 KB
📄 show_credits.py 3.1 KB
📄 sync_provider.py 5.2 KB
📄 topup.py 2.9 KB