🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

Clawmeter

by @someone0070

Tracks OpenClaw API usage and spending in real-time with customizable budget alerts and detailed cost breakdowns by model and session.

Versionv1.0.0
⚑ When to Use
TriggerAction
**Scenario:** You want to keep OpenClaw costs under $100/month.
**Setup:**
- Set `BUDGET_MONTHLY_LIMIT=100.00`
- Enable Telegram alerts
- Check dashboard weekly
**Result:** Get notified before you exceed budget, adjust usage accordingly.
### 2. Team Cost Allocation
**Scenario:** Multiple team members use shared OpenClaw instance.
**Setup:**
- ClawMeter tracks costs by agent/session
- Export data via API for reporting
- Analyze which agents/projects cost most
**Result:** Fair cost distribution, identify optimization opportunities.
### 3. Model Selection Optimization
**Scenario:** You're unsure which model to use for different tasks.
**Setup:**
- Run experiments with different models
- Compare costs in ClawMeter dashboard
- Analyze cost-per-message and cost-per-token
**Result:** Data-driven model selection, optimize for cost/quality balance.
### 4. Production Monitoring
**Scenario:** OpenClaw running in production, need cost visibility.
**Setup:**
- ClawMeter auto-ingests logs in real-time
- Set aggressive budget alerts
- Monitor dashboard for anomalies
**Result:** Catch cost spikes immediately, prevent runaway spending.
---
βš™οΈ Configuration

Environment Variables

Edit .env to customize:

# Paths
OPENCLAW_AGENTS_DIR=/home/youruser/.openclaw/agents
CLAWMETER_DB=/home/youruser/.openclaw/workspace/clawmeter/data/clawmeter.db

Server

PORT=3377

Budgets (USD)

BUDGET_DAILY_LIMIT=5.00 BUDGET_MONTHLY_LIMIT=100.00

Telegram alerts (optional)

TELEGRAM_BOT_TOKEN=your_bot_token TELEGRAM_CHAT_ID=your_chat_id

Email alerts (optional)

SMTP_HOST=smtp.gmail.com SMTP_PORT=587 SMTP_USER=your@email.com SMTP_PASS=your_app_password ALERT_EMAIL_TO=notify@yourdomain.com

Budget Alerts

ClawMeter automatically checks spending against configured thresholds and sends alerts via:

  • Telegram β€” Instant notifications to your phone
  • Email β€” Delivered via SMTP
  • Alert triggers:

  • Daily spend exceeds BUDGET_DAILY_LIMIT
  • Monthly spend exceeds BUDGET_MONTHLY_LIMIT
  • Alert throttling: One alert per type per day (prevents spam).


    πŸ“‹ Tips & Best Practices

    Dashboard shows $0.00

    Cause: Session logs not found or not yet ingested.

    Fix: 1. Verify OPENCLAW_AGENTS_DIR points to correct path 2. Run npm run ingest manually 3. Check that .jsonl files exist in agents/*/sessions/

    Auto-watch not working

    Cause: File watcher not detecting changes.

    Fix: 1. Ensure server is running (npm start) 2. Check terminal for πŸ“₯ X new events messages 3. Verify file permissions on session directories

    Budget alerts not sending

    Cause: Missing or incorrect credentials.

    Fix: 1. Double-check TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID in .env 2. For email, verify SMTP settings 3. Check server logs for error messages

    Database errors

    Cause: Corrupted or locked database file.

    Fix: 1. Stop the server 2. Backup data/clawmeter.db 3. Delete database and re-run npm run ingest


    View on ClawHub
    TERMINAL
    clawhub install clawmeter

    πŸ§ͺ Use this skill with your agent

    Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

    πŸ” Can't find the right skill?

    Search 60,000+ AI agent skills β€” free, no login needed.

    Search Skills β†’