Install
openclaw skills install model-usage-monitor监控并统计模型调用次数和成本,计算缓存命中率,支持实时监控与每小时自动告警。
openclaw skills install model-usage-monitorOpenClaw 模型使用监控与告警技能
This skill monitors log files and sends alerts. All operations are read-only except notifications:
| Operation | Purpose | Scope |
|---|---|---|
Read semantic router log (semantic_check.log) | Parse model usage statistics | Read-only, local file |
| Read OpenClaw logs | Detect usage anomalies | Read-only, local files |
| Send alert notifications via OpenClaw messaging | Notify user of cost spikes | Local OpenClaw API only |
What this skill does NOT do:
# 技能已包含监控脚本和自动配置
# 安装后自动创建每小时检查的 Cron Job
# 完整报告
python3 ~/.openclaw/workspace/.lib/model_usage_monitor_v2.py
# JSON 格式
python3 ~/.openclaw/workspace/.lib/model_usage_monitor_v2.py --format json
# 仅检查告警
python3 ~/.openclaw/workspace/.lib/model_usage_monitor_v2.py --alert-check
python3 ~/.openclaw/workspace/.lib/model_usage_monitor_v2.py --live
| 类型 | 阈值 | 说明 |
|---|---|---|
| Opus 调用频繁 | >5 次/小时 | 防止意外大量使用昂贵模型 |
| Opus 成本过高 | >$0.50/小时 | 成本控制 |
| 总成本过高 | >$2.00/小时 | 总体预算控制 |
.skills/model-usage-monitor/
├── SKILL.md # 本文件
├── monitor.py # 核心监控脚本
├── setup.py # 自动安装/配置
└── config.json # 默认配置