← 返回 Skills 市场
xiaoyaner0201

Google AI Usage Monitor

作者 xiaoyaner0201 · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
1462
总下载
1
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install google-ai-usage-monitor
功能描述
Monitor Google AI Studio (Gemini API) usage, rate limits, and quota consumption with automated alerts.
使用说明 (SKILL.md)

Google AI Usage Monitor Skill

Monitor Google AI Studio usage to prevent quota exhaustion and optimize API consumption.

Supported Metrics

Metric Description Alert Threshold
RPM Requests Per Minute (peak) > 80% of limit
TPM Tokens Per Minute (peak) > 80% of limit
RPD Requests Per Day > 80% of limit

Rate Limits by Tier

Tier Typical Limits
Free 2 RPM, 32K TPM, 50 RPD
Pay-as-you-go 10-15 RPM, 100K+ TPM, 500+ RPD
Paid Tier 1 20 RPM, 100K TPM, 250 RPD (varies by model)

Note: Actual limits vary by model and can be viewed at the usage dashboard.

Usage Dashboard

URL

https://aistudio.google.com/usage?project={PROJECT_ID}&timeRange=last-28-days&tab=rate-limit

Key Elements to Extract

  • Project name: Which GCP project
  • Tier: Free / Pay-as-you-go / Paid tier X
  • Models table: Each row contains model name, category, RPM, TPM, RPD
  • Time range: Default 28 days

Browser Automation

Open Usage Page

// Using OpenClaw browser tool
browser action=open targetUrl="https://aistudio.google.com/usage?project=YOUR_PROJECT_ID&timeRange=last-28-days&tab=rate-limit" profile=openclaw

Wait for Data Load

The page loads data asynchronously. Wait for:

  1. Project dropdown shows project name (not "Loading...")
  2. Rate limits table has data rows

Parse Table Data

Look for table rows with pattern:

Model Name | Category | X / Y | X / Y | X / Y | View in charts

Where X / Y represents used / limit.

Report Format

Discord Message Template

## 📊 Google AI Studio 用量报告

**项目**: {project_name}
**付费等级**: {tier}
**统计周期**: 过去 28 天

---

### {Model Name}
| 指标 | 用量 | 限额 | 使用率 |
|------|------|------|--------|
| RPM | {rpm_used} | {rpm_limit} | {rpm_pct}% |
| TPM | {tpm_used} | {tpm_limit} | {tpm_pct}% |
| RPD | {rpd_used} | {rpd_limit} | {rpd_pct}% |

---

{status_emoji} **状态**: {status_text}

*检查时间: {timestamp}*

Status Levels

Usage % Status Emoji Action
\x3C 50% 正常 Continue normally
50-80% 需关注 ⚠️ Monitor more frequently
> 80% 风险预警 🚨 Alert user, consider rate limiting

Alert Rules

When to Alert User

  1. Any metric > 80%: Immediate alert with @mention
  2. Any metric > 50%: Include warning note in report
  3. API errors (429): Track rate limit hits

Alert Message Template

🚨 **Google AI 配额预警**

\x3C@USER_ID> 以下指标接近限额:

- **{model}** {metric}: {used}/{limit} ({pct}%)

建议:
- 减少 API 调用频率
- 考虑升级付费等级
- 检查是否有异常调用

Cron Job Setup

Daily Check (Recommended)

{
  "name": "Google AI 用量检查",
  "schedule": {
    "kind": "cron",
    "expr": "0 20 * * *",
    "tz": "Asia/Shanghai"
  },
  "sessionTarget": "isolated",
  "payload": {
    "kind": "agentTurn",
    "message": "检查 Google AI Studio 用量并发送报告到指定 Discord 频道"
  },
  "delivery": {
    "mode": "announce",
    "channel": "discord",
    "to": "CHANNEL_ID"
  }
}

Integration with OpenClaw

Configuration

Add to TOOLS.md:

## Google AI Studio

- **Project ID**: gen-lang-client-XXXXXXXXXX
- **Dashboard**: https://aistudio.google.com/usage
- **Discord Channel**: #google-ai (CHANNEL_ID)
- **Check Schedule**: Daily 20:00

Heartbeat Integration

Add to HEARTBEAT.md:

## Google AI Monitoring
- Check usage if last check > 24 hours
- Alert if any metric > 80%

Troubleshooting

Page Not Loading

  1. Check if logged into correct Google account
  2. Verify project ID is correct
  3. Wait longer for async data load (5-10 seconds)

Data Shows "Loading..."

The project dropdown may take time to populate. Retry snapshot after a few seconds.

Metrics Not Updating

Google notes: "Usage data may take up to 15 minutes to update."

References

安全使用建议
Before installing or enabling this skill, ask the author how authentication is performed and avoid giving it access to your primary Google session. Prefer a least-privilege approach: use an explicit service account or monitoring API (not dashboard scraping) with only read/monitoring permissions, and provide a scoped Discord webhook or bot token dedicated to alerts. Do not rely on a shared browser profile (profile=openclaw) unless you understand exactly which account/session it will use; that profile could expose unrelated Google data. If you must use this skill, run it in an isolated agent/session, insist the skill declare required env vars (Google credentials or service account, DISCORD_WEBHOOK_URL or bot token), and review any actual code (if provided) to confirm it only reads the intended dashboard endpoints and only posts to the specified channel. If the source/author is unknown or you cannot supply scoped credentials, treat this skill as risky and avoid installing it.
功能分析
Type: OpenClaw Skill Name: google-ai-usage-monitor Version: 1.0.0 The skill bundle is classified as benign. The `SKILL.md` file outlines a clear purpose: monitoring Google AI Studio usage by automating browser interaction with the official Google AI Studio dashboard. All instructions, including browser automation (`browser action=open`), data extraction, report formatting, and cron job scheduling, are directly aligned with this stated purpose. There is no evidence of prompt injection attempting to subvert the agent's behavior, no instructions for unauthorized data exfiltration beyond reporting usage metrics to a specified Discord channel, and no malicious execution patterns like downloading and running arbitrary remote payloads or creating persistence mechanisms outside of the skill's intended scheduling.
能力评估
Purpose & Capability
The skill claims to monitor Google AI Studio usage via browser automation and send alerts to Discord — that purpose is plausible. However, the skill requests no credentials or webhooks yet instructs accessing a protected Google usage dashboard and posting to a Discord channel. Legitimate implementations would normally require explicit authentication details (OAuth/service account, API credentials, or a Discord webhook/token). The omission is inconsistent with the described capability.
Instruction Scope
SKILL.md directs the agent to open the Google AI Studio usage page using a named browser profile (profile=openclaw) and parse live dashboard data. That implies the agent will access the user's authenticated Google session and potentially any data available in that session. The instructions do not limit access to only usage metrics and do not describe how to obtain consent or restrict scope. They also assume the ability to post to Discord without specifying how authentication is performed.
Install Mechanism
This is an instruction-only skill with no install steps and no code files, so there is no download/execute footprint to review. That lowers supply-chain risk, but runtime actions (browser automation, posting to external channels) remain significant.
Credentials
No required environment variables or primary credential are declared, yet the workflow clearly needs authenticated access to a Google account/project and a way to send Discord messages (webhook or bot token). The absence of declared credentials is disproportionate and unclear — it suggests the skill expects to reuse existing browser sessions or platform-level secrets without explicitly stating or limiting them.
Persistence & Privilege
always:false and standard autonomous invocation are fine. The SKILL.md includes a cron job example and delivery instructions for posting to Discord, which implies autonomous periodic checks. Autonomous invocation combined with implicit use of an agent browser profile increases the blast radius if credentials/sessions are broad, so you should be cautious even though no 'always:true' or installer-level persistence is requested.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install google-ai-usage-monitor
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /google-ai-usage-monitor 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Monitor Google AI Studio usage, rate limits, and quota consumption with automated alerts
元数据
Slug google-ai-usage-monitor
版本 1.0.0
许可证
累计安装 2
当前安装数 1
历史版本数 1
常见问题

Google AI Usage Monitor 是什么?

Monitor Google AI Studio (Gemini API) usage, rate limits, and quota consumption with automated alerts. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1462 次。

如何安装 Google AI Usage Monitor?

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

Google AI Usage Monitor 是免费的吗?

是的,Google AI Usage Monitor 完全免费(开源免费),可自由下载、安装和使用。

Google AI Usage Monitor 支持哪些平台?

Google AI Usage Monitor 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Google AI Usage Monitor?

由 xiaoyaner0201(@xiaoyaner0201)开发并维护,当前版本 v1.0.0。

💬 留言讨论