多平台AI用量统一监控中心
简介
OpenClaw生态的多平台AI用量监控中枢,实时聚合Claude、ChatGPT、Gemini、Manus额度数据,助开发者精准控费避限。
原始描述
Know exactly where your AI tokens go. Multi-provider tracking, budget alerts, and a REST API—all in one dashboard.
通过你的 Agent 添加
安装目录:token-panel-ultimate/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
Token Panel ULTIMATE 是一款多平台 AI 用量追踪工具,通过 Python 脚本定期拉取四大服务商(Claude Max、ChatGPT/OpenAI、Gemini、Manus)的实时配额数据,并以 JSON 格式持久化至本地,供浏览器小部件可视化展示或 Agent 读取决策。
Claude Max:解析官方凭证文件获取 OAuth Token,调用 api.anthropic.com/api/oauth/usage 获取 5 小时滚动窗口与 7 天窗口的使用率及重置时间,支持 Sonnet/Opus 模型配额细分。
ChatGPT/OpenAI:通过最小化 API 探针调用(chat.completions)提取响应头中的 RPM/TPM 速率限制,同时监控 Plus 订阅的模型级配额(GPT-4o 150/3hr、o3 100/week 等)。
Gemini:支持多模型并行查询(gemini-3-pro/2.5-pro/2.5-flash 等),自动识别 RPD/RPM/TPM 三大维度的瓶颈指标,内置降级策略推荐(无限 RPD 模型作为安全网)。
Manus:监控三层配额结构——月度 4000 积分、日刷 300 积分(01:00 重置)、永久 Addon 积分,支持任务级明细统计。
所有脚本均可通过 crontab 配置自动更新(5-15 分钟间隔),并配套 Tampermonkey 用户脚本在 OpenClaw Webchat 中实时渲染用量面板。
显著优点
- 零依赖轻量化:纯 Python 标准库实现(urllib/json/os/pathlib),无第三方包引入,供应链攻击面趋近于零
- 凭证安全:API 密钥仅从环境变量或
~/.openclaw/.env 读取,Claude Token 从官方凭证文件提取,无硬编码风险
- 多维度监控:覆盖订阅配额、速率限制、滚动窗口、积分余额四类资源模型,满足从个人用户到企业级 Agent 的预算管控需求
- Agent 原生集成:SOUL.md 规范支持预算感知行为(>50% 正常、30-50% 精简、<10% 最小化),提供 Python 代码示例供 Agent 实时读取
- 浏览器增强:Tampermonkey 小部件实现可视化仪表盘,无需离开聊天界面即可掌握全局用量
潜在缺点与局限性
- 外部依赖重:需同时维护 4 组 API 密钥及凭证,任一服务商的认证失效或 API 变更将导致对应模块失效
- 路径硬编码:浏览器小部件中
/home/globalcaos/.openclaw/workspace/memory/ 为硬编码路径,非标准安装用户需手动修改
- 无历史趋势:仅提供当前时刻的快照数据,缺乏时间序列存储与可视化分析能力
- 速率限制自身:高频自动更新(如 5 分钟间隔)可能对部分服务商的 API 产生额外负载,存在被限流风险
- 许可证缺失:项目未声明开源许可证,商用场景存在法律不确定性
适合人群
- 多平台 AI 重度用户:同时使用 Claude Max、ChatGPT Plus、Gemini、Manus 且需统一管理预算
- OpenClaw/Moltbot 生态用户:已部署 OpenClaw 网关并希望扩展 Agent 资源感知能力
- 自动化运维团队:需通过 crontab 实现无人值守的用量监控与告警
- 预算敏感型企业:要求 Agent 根据实时配额自动调整行为策略
常规风险
风险类别
说明
缓解措施
API 密钥泄露
环境变量或文件权限配置不当
遵循最小权限原则,定期轮换密钥
第三方服务变更
官方 API 端点或响应格式变更导致脚本失效
关注服务商变更公告,及时更新脚本版本
高频调用限流
自动更新间隔过短触发服务商限流
合理设置 crontab 间隔(建议 10-15 分钟)
本地数据篡改
JSON 文件被意外修改导致错误决策
考虑添加 JSON Schema 校验
隐私披露不足
用户未充分知情数据发送至 4 家外部服务商
建议在部署前向终端用户明确披露
~/.openclaw/.env 读取,Claude Token 从官方凭证文件提取,无硬编码风险- 外部依赖重:需同时维护 4 组 API 密钥及凭证,任一服务商的认证失效或 API 变更将导致对应模块失效
- 路径硬编码:浏览器小部件中
/home/globalcaos/.openclaw/workspace/memory/为硬编码路径,非标准安装用户需手动修改 - 无历史趋势:仅提供当前时刻的快照数据,缺乏时间序列存储与可视化分析能力
- 速率限制自身:高频自动更新(如 5 分钟间隔)可能对部分服务商的 API 产生额外负载,存在被限流风险
- 许可证缺失:项目未声明开源许可证,商用场景存在法律不确定性
适合人群
- 多平台 AI 重度用户:同时使用 Claude Max、ChatGPT Plus、Gemini、Manus 且需统一管理预算
- OpenClaw/Moltbot 生态用户:已部署 OpenClaw 网关并希望扩展 Agent 资源感知能力
- 自动化运维团队:需通过 crontab 实现无人值守的用量监控与告警
- 预算敏感型企业:要求 Agent 根据实时配额自动调整行为策略
常规风险
风险类别
说明
缓解措施
API 密钥泄露
环境变量或文件权限配置不当
遵循最小权限原则,定期轮换密钥
第三方服务变更
官方 API 端点或响应格式变更导致脚本失效
关注服务商变更公告,及时更新脚本版本
高频调用限流
自动更新间隔过短触发服务商限流
合理设置 crontab 间隔(建议 10-15 分钟)
本地数据篡改
JSON 文件被意外修改导致错误决策
考虑添加 JSON Schema 校验
隐私披露不足
用户未充分知情数据发送至 4 家外部服务商
建议在部署前向终端用户明确披露
| 风险类别 | 说明 | 缓解措施 |
|---|---|---|
| API 密钥泄露 | 环境变量或文件权限配置不当 | 遵循最小权限原则,定期轮换密钥 |
| 第三方服务变更 | 官方 API 端点或响应格式变更导致脚本失效 | 关注服务商变更公告,及时更新脚本版本 |
| 高频调用限流 | 自动更新间隔过短触发服务商限流 | 合理设置 crontab 间隔(建议 10-15 分钟) |
| 本地数据篡改 | JSON 文件被意外修改导致错误决策 | 考虑添加 JSON Schema 校验 |
| 隐私披露不足 | 用户未充分知情数据发送至 4 家外部服务商 | 建议在部署前向终端用户明确披露 |
技能正文
name: token-panel-ultimate
version: 1.0.8
description: Track AI usage across Claude Max, ChatGPT, Gemini & Manus — one OpenClaw dashboard for all providers. Rate limits, rolling windows, credit balances.
homepage: https://github.com/globalcaos/clawdbot-moltbot-openclaw
metadata:
openclaw:
emoji: "🎛️"
requires:
bins: ["python3"]
Token Panel ULTIMATE
🎛️ Know your limits. Stay within them. Maximize your capacity.
🎛️ Know your limits. Stay within them. Maximize your capacity.
Real-time usage tracking for Claude Max, Gemini, and Manus — all in one place.
Features
Provider
What It Tracks
Claude Max
5-hour window, 7-day window, reset times
ChatGPT / OpenAI
Per-model API rate limits (requests + tokens), Plus subscription caps
Gemini
RPD/RPM/TPM per model, bottleneck detection
Manus
Daily refresh, monthly credits, addon balance
| Provider | What It Tracks |
|---|---|
| Claude Max | 5-hour window, 7-day window, reset times |
| ChatGPT / OpenAI | Per-model API rate limits (requests + tokens), Plus subscription caps |
| Gemini | RPD/RPM/TPM per model, bottleneck detection |
| Manus | Daily refresh, monthly credits, addon balance |
Plus a webchat widget that shows it all at a glance.
Claude Max Usage
Track your Claude Max subscription usage in real-time.
What It Shows
- 5-hour window: Rolling usage percentage and reset time
- 7-day window: Weekly usage percentage and reset time
- Model-specific limits: Sonnet and Opus allocations
Usage
# Pretty print current usage
python3 {baseDir}/scripts/claude-usage-fetch.py
# Update JSON file for the widget
python3 {baseDir}/scripts/claude-usage-fetch.py --update
# Raw JSON output
python3 {baseDir}/scripts/claude-usage-fetch.py --json
Requirements
- Claude Code CLI installed and authenticated (
claude /login)
Auto-Update (Optional)
# Add to crontab for automatic updates every 5 minutes
*/5 * * * * python3 {baseDir}/scripts/claude-usage-fetch.py --update
Gemini Multi-Model Tracking
# Pretty print current usage
python3 {baseDir}/scripts/claude-usage-fetch.py
# Update JSON file for the widget
python3 {baseDir}/scripts/claude-usage-fetch.py --update
# Raw JSON output
python3 {baseDir}/scripts/claude-usage-fetch.py --json
Requirements
- Claude Code CLI installed and authenticated (
claude /login)
Auto-Update (Optional)
# Add to crontab for automatic updates every 5 minutes
*/5 * * * * python3 {baseDir}/scripts/claude-usage-fetch.py --update
Gemini Multi-Model Tracking
claude /login)# Add to crontab for automatic updates every 5 minutes
*/5 * * * * python3 {baseDir}/scripts/claude-usage-fetch.py --update
Gemini Multi-Model Tracking
Track the bottleneck metric (highest % among RPD, RPM, TPM) for each model.
Model Limits (Tier 1)
Model
RPM
TPM
RPD
gemini-3-pro
25
1M
250
gemini-2.5-pro
25
1M
250
gemini-2.5-flash
2000
4M
∞
gemini-3-flash
1000
1M
10K
gemini-2.0-flash
2000
4M
∞
Fallback Strategy
gemini-3-pro → gemini-2.5-pro → gemini-2.5-flash(∞) → gemini-3-flash → gemini-2.0-flash(∞)
| Model | RPM | TPM | RPD |
|---|---|---|---|
| gemini-3-pro | 25 | 1M | 250 |
| gemini-2.5-pro | 25 | 1M | 250 |
| gemini-2.5-flash | 2000 | 4M | ∞ |
| gemini-3-flash | 1000 | 1M | 10K |
| gemini-2.0-flash | 2000 | 4M | ∞ |
gemini-3-pro → gemini-2.5-pro → gemini-2.5-flash(∞) → gemini-3-flash → gemini-2.0-flash(∞)
Most capable first, unlimited RPD models as safety nets.
Reset time: Midnight Pacific (RPD resets daily)
JSON Format
Store in memory/gemini-usage.json:
{
"models": {
"gemini-3-pro": {
"limits": { "rpm": 25, "tpm": 1000000, "rpd": 250 },
"usage": { "rpm": 17, "tpm": 1380000, "rpd": 251 },
"status": "exceeded"
}
}
}
Manus Credit Monitoring
Credit Structure
- Monthly: 4,000 credits (resets on renewal)
- Daily refresh: 300 credits (resets 01:00)
- Addon: Purchased credits (never expire)
Usage
# Pretty print current usage
python3 {baseDir}/scripts/manus-usage-fetch.py
# Update JSON file for the widget
python3 {baseDir}/scripts/manus-usage-fetch.py --update
# Raw JSON output
python3 {baseDir}/scripts/manus-usage-fetch.py --json
Requirements
MANUS_API_KEY environment variable set
Auto-Update (Optional)
# Add to crontab for automatic updates every 15 minutes
*/15 * * * * MANUS_API_KEY=your-key python3 {baseDir}/scripts/manus-usage-fetch.py --update
JSON Format
# Pretty print current usage
python3 {baseDir}/scripts/manus-usage-fetch.py
# Update JSON file for the widget
python3 {baseDir}/scripts/manus-usage-fetch.py --update
# Raw JSON output
python3 {baseDir}/scripts/manus-usage-fetch.py --json
MANUS_API_KEYenvironment variable set
Auto-Update (Optional)
# Add to crontab for automatic updates every 15 minutes
*/15 * * * * MANUS_API_KEY=your-key python3 {baseDir}/scripts/manus-usage-fetch.py --update
JSON Format
# Add to crontab for automatic updates every 15 minutes
*/15 * * * * MANUS_API_KEY=your-key python3 {baseDir}/scripts/manus-usage-fetch.py --update
Store in memory/manus-usage.json (auto-generated by fetch script):
{
"credits": {
"total_all_time": 8407,
"breakdown": {
"monthly": { "used": 480, "limit": 4000, "remaining": 3520 },
"addon": 7296
},
"daily_refresh": { "used": 0, "remaining": 300, "limit": 300, "reset_time": "01:00 local" }
},
"today": { "tasks": 0, "credits_used": 0, "breakdown": [] }
}
ChatGPT / OpenAI Usage
Track API rate limits per model and ChatGPT Plus subscription caps.
What It Shows
- API rate limits: Requests/min, tokens/min per model (from response headers)
- Plus caps: GPT-4o (150/3hr), o3 (100/week), o4-mini (300/day), etc.
- Models probed: gpt-4o, gpt-4o-mini, gpt-4, gpt-3.5-turbo, o3-mini
Usage
# Pretty print current usage
python3 {baseDir}/scripts/chatgpt-usage-fetch.py
# Update JSON file for the widget
python3 {baseDir}/scripts/chatgpt-usage-fetch.py --update
# Raw JSON output
python3 {baseDir}/scripts/chatgpt-usage-fetch.py --json
Requirements
OPENAI_API_KEY environment variable set
- Key needs chat completion permissions (rate limit headers are extracted from minimal probe calls)
- For billing/cost data: key needs
api.usage.read scope (admin key)
Auto-Update (Optional)
# Add to crontab for automatic updates every 10 minutes
*/10 * * * * OPENAI_API_KEY=your-key python3 {baseDir}/scripts/chatgpt-usage-fetch.py --update
Budget-Aware Behavior
# Pretty print current usage
python3 {baseDir}/scripts/chatgpt-usage-fetch.py
# Update JSON file for the widget
python3 {baseDir}/scripts/chatgpt-usage-fetch.py --update
# Raw JSON output
python3 {baseDir}/scripts/chatgpt-usage-fetch.py --json
Requirements
OPENAI_API_KEY environment variable set
- Key needs chat completion permissions (rate limit headers are extracted from minimal probe calls)
- For billing/cost data: key needs
api.usage.read scope (admin key)
Auto-Update (Optional)
# Add to crontab for automatic updates every 10 minutes
*/10 * * * * OPENAI_API_KEY=your-key python3 {baseDir}/scripts/chatgpt-usage-fetch.py --update
Budget-Aware Behavior
OPENAI_API_KEY environment variable setapi.usage.read scope (admin key)# Add to crontab for automatic updates every 10 minutes
*/10 * * * * OPENAI_API_KEY=your-key python3 {baseDir}/scripts/chatgpt-usage-fetch.py --update
Budget-Aware Behavior
Add to your SOUL.md:
## Resource Awareness
**Behavior by budget level:**
| Budget | Behavior |
|--------|----------|
| 🟢 >50% | Normal operations |
| 🟡 30-50% | Be concise |
| 🟠 10-30% | Defer non-essential tasks |
| 🔴 <10% | Minimal responses only |
Agent Self-Check
import json
from pathlib import Path
def get_claude_usage():
path = Path.home() / ".openclaw/workspace/memory/claude-usage.json"
if path.exists():
data = json.loads(path.read_text())
return data.get("limits", {}).get("five_hour", {}).get("utilization", 0)
return 0
Webchat Widget
import json
from pathlib import Path
def get_claude_usage():
path = Path.home() / ".openclaw/workspace/memory/claude-usage.json"
if path.exists():
data = json.loads(path.read_text())
return data.get("limits", {}).get("five_hour", {}).get("utilization", 0)
return 0
A Tampermonkey userscript that displays real-time usage in OpenClaw webchat.
Installation
1. Install Tampermonkey
| Browser | Link |
|---|---|
| Chrome | Chrome Web Store |
| Firefox | Firefox Add-ons |
| Edge | Edge Add-ons |
| Safari | Mac App Store |
2. Create New Script
- Click Tampermonkey icon → "Create a new script..."
- Delete all default content
- Copy entire contents of
{baseDir}/scripts/budget-panel-widget.user.js
- Paste into Tampermonkey
- Ctrl+S to save
3. Refresh Webchat
{baseDir}/scripts/budget-panel-widget.user.jsGo to http://localhost:18789 and refresh. Panel appears bottom-left.
Troubleshooting
- Panel not appearing? Check Tampermonkey is enabled
- Shows 0%? Run
claude-usage-fetch.py --update first
- MIME error? Full restart:
openclaw gateway stop && openclaw gateway start
Files
token-panel-ultimate/
├── SKILL.md
├── package.json
└── scripts/
├── claude-usage-fetch.py # Claude Max usage fetcher
├── manus-usage-fetch.py # Manus credit usage fetcher
└── budget-panel-widget.user.js # Webchat widget
Gateway Plugin
claude-usage-fetch.py --update firstopenclaw gateway stop && openclaw gateway starttoken-panel-ultimate/
├── SKILL.md
├── package.json
└── scripts/
├── claude-usage-fetch.py # Claude Max usage fetcher
├── manus-usage-fetch.py # Manus credit usage fetcher
└── budget-panel-widget.user.js # Webchat widget
Gateway Plugin
For full integration, the budget-panel gateway plugin is available in our OpenClaw fork:
Repository: github.com/globalcaos/clawdbot-moltbot-openclaw
The plugin provides:
budget.usagegateway method for real-time data- Automatic JSON file reading
- Multi-provider aggregation
Install the plugin at extensions/budget-panel/ in your OpenClaw installation.
Related Skills
- shell-security-ultimate - Command security enforcement
- agent-memory-ultimate - Memory system with usage logs
Credits
Created by Oscar Serra with the help of Claude (Anthropic).
Built during a late-night hacking session, February 2026.
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。