name: usage-monitor

description: Track API usage and costs across all OpenClaw agents. Daily reports, spend alerts, budget monitoring.


Usage Monitor

Track token usage and estimated costs across all OpenClaw agents and sessions.

When to Use ✅

When NOT to Use ❌

Quick Commands

Get Current Usage Summary


# All agents, today
./skills/usage-monitor/scripts/usage-report.sh

# Specific timeframe
./skills/usage-monitor/scripts/usage-report.sh --hours 24
./skills/usage-monitor/scripts/usage-report.sh --days 7

# JSON output for processing
./skills/usage-monitor/scripts/usage-report.sh --json

Check All Agent Sessions


# Query each agent's sessions
for agent in main don echo sage morgan scout; do
  echo "=== $agent ==="
  openclaw sessions --json --store ~/.openclaw/agents/$agent/sessions/sessions.json 2>/dev/null | jq '.sessions | length'
done

Pricing Reference (per 1M tokens)

| Model | Alias | Input | Output |

|-------|-------|-------|--------|

| Gemini 2.0 Flash | gemini | $0.10 | $0.40 |

| GPT-4o Mini | gpt4omini | $0.15 | $0.60 |

| Kimi K2.5 | kimi | $0.60 | $2.50 |

| Perplexity Sonar | sonar | $1.00 | $1.00 |

| GPT-4o | gpt4o | $2.50 | $10.00 |

| Claude Sonnet 4 | sonnet | $3.00 | $15.00 |

| Perplexity Sonar Pro | sonar-pro | $3.00 | $15.00 |

| Claude Opus 4.5 | opus | $15.00 | $75.00 |

Daily Report Cron

To enable daily usage reports at 9am:


# Add via cron tool with systemEvent to main session
# Or add to HEARTBEAT.md for manual check

Alert Thresholds (configurable)

Edit `references/thresholds.json`:


{
  "daily_warn": 10.00,
  "daily_critical": 25.00,
  "weekly_warn": 50.00,
  "weekly_critical": 100.00
}

Output Format

Reports include: