Token导航 LogoToken导航TokenDH.com
研究检索敏感数据clawhub未标认证来源可访问clear审计提醒

clawmeterclawmeter 搜索

Agent Skill

clawmeter 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

21,936

周安装

914

GitHub Stars

公开资料未说明

下载量

7,312
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:clawmeter(clawmeter 搜索)
来源仓库:https://github.com/someone0070/clawmeter
安装命令:
openclaw skills install clawmeter
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install clawmeter

简介

通过可定制的预算警报以及按模型和会话划分的详细成本细目,实时跟踪 OpenClaw API 使用情况和支出。

SKILL.md

ClawMeter — Cost Tracking Dashboard

Track OpenClaw API usage and spending in real-time with budget alerts.


Overview

ClawMeter is a self-hosted cost tracking dashboard that monitors your OpenClaw session logs, calculates token usage and API costs, and provides real-time analytics with customizable budget alerts.

Perfect for:

  • Users who want visibility into their AI spending
  • Teams managing OpenClaw deployments with budgets
  • Developers optimizing model selection based on cost
  • Anyone who wants to avoid surprise API bills

Installation

Prerequisites

  • OpenClaw installed and running
  • Node.js v18+ (for the dashboard server)
  • Session logs enabled in OpenClaw (default)

Setup

  1. Clone or download ClawMeter:
   cd ~/.openclaw/workspace
   git clone https://github.com/yourusername/clawmeter.git
   cd clawmeter
  1. Install dependencies:
   npm install
  1. Configure (optional):
   cp .env.example .env
   # Edit .env to customize paths, budget limits, or alert settings
  1. Ingest existing logs:
   npm run ingest
  1. Start the dashboard:
   npm start
  1. Open dashboard:

Navigate to http://localhost:3377


Commands

When this skill is installed, your OpenClaw agent can respond to:

Spending Queries

  • "How much have I spent today?"

- Shows today's total spend and budget percentage

  • "What's my monthly spend?"

- Displays current month total and budget status

  • "Show me this week's costs"

- Summarizes last 7 days of spending

Cost Analysis

  • "Which model is most expensive?"

- Breaks down costs by model (Claude, GPT, Gemini, etc.)

  • "Show my most expensive sessions"

- Lists top sessions by total cost

  • "What's my average daily spend?"

- Calculates mean daily cost over the last 30 days

Dashboard & Reports

  • "Open my cost dashboard"

- Provides link to http://localhost:3377

  • "Generate a cost report"

- Exports summary data (today/week/month/all-time)

Data Management

  • "Refresh cost data"

- Triggers manual re-ingest of session logs

  • "Clear old cost data"

- (Optional) Archive or delete data older than X days


API Endpoints

ClawMeter exposes a REST API that agents can query:

Summary Statistics

GET http://localhost:3377/api/summary

Response:

{
  "today": 2.15,
  "week": 8.42,
  "month": 32.76,
  "allTime": 127.89,
  "sessions": 234,
  "messages": 1842,
  "budgetDaily": 5.0,
  "budgetMonthly": 100.0
}

Daily Breakdown

GET http://localhost:3377/api/daily?days=30

Response:

[
  {
    "date": "2026-02-14",
    "cost": 2.15,
    "input_tokens": 45820,
    "output_tokens": 12340,
    "messages": 18
  }
]

Sessions

GET http://localhost:3377/api/sessions?limit=50&offset=0

Response:

[
  {
    "id": "abc123",
    "agent": "main",
    "model": "claude-sonnet-4-5",
    "total_cost": 0.842,
    "message_count": 12
  }
]

Model Breakdown

GET http://localhost:3377/api/models

Response:

[
  {
    "model": "claude-sonnet-4-5",
    "provider": "anthropic",
    "total_cost": 45.62,
    "message_count": 324
  }
]

Top Sessions

GET http://localhost:3377/api/top-sessions?limit=10

Budget Alerts

GET http://localhost:3377/api/alerts

Manual Ingest

POST http://localhost:3377/api/ingest

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).


Agent Integration Examples

Example 1: Daily Spend Check

User: "How much have I spent today?"

Agent Response:

Let me check your spending...

📊 Today's Spend: $2.15
Budget: $5.00 (43% used)

You have $2.85 remaining today.

Implementation:

const res = await fetch('http://localhost:3377/api/summary');
const data = await res.json();
const pct = (data.today / data.budgetDaily * 100).toFixed(0);
return `📊 Today's Spend: $${data.today.toFixed(2)}\
Budget: $${data.budgetDaily.toFixed(2)} (${pct}% used)\
\
You have $${(data.budgetDaily - data.today).toFixed(2)} remaining today.`;

Example 2: Model Comparison

User: "Which model should I use to save money?"

Agent Response:

Based on your usage history:

💰 Cost per 1K messages:
• Claude Haiku 3-5: $0.12
• GPT-4o-mini: $0.18
• Claude Sonnet 4-5: $0.45
• Claude Opus 4: $1.23

Recommendation: Use Haiku for simple tasks, Sonnet for complex work.

Example 3: Budget Warning

Agent (proactive):

⚠️ Budget Alert

You've spent $5.52 today, exceeding your $5.00 daily limit.

Top sessions today:
1. Code review task — $2.10
2. Research project — $1.85
3. Email drafting — $0.98

Consider switching to a cheaper model or pausing non-urgent tasks.

Dashboard Features

Overview Screen

  • Today's spend with budget progress bar
  • Weekly and monthly totals
  • All-time spending and message count
  • Budget status (green/yellow/red indicators)

Analytics

  • Daily cost chart (bar chart, 7/14/30/90 day views)
  • Model breakdown (donut chart with percentages)
  • Top sessions by cost
  • Recent activity feed

Alerts History

  • View all triggered budget alerts
  • See when and why alerts fired
  • Track spending patterns over time

Use Cases

1. Personal Budget Management

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.


Troubleshooting

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

Advanced Configuration

Custom Model Pricing

If you use custom models or pricing changes:

  1. Edit src/pricing.mjs
  2. Add entry to MODEL_PRICING object:
   'your-custom-model': {
     input: 2.50,    // per million tokens
     output: 10.00,  // per million tokens
     cacheRead: 0.25,   // optional
     cacheWrite: 3.75   // optional
   }
  1. Restart server

Scheduled Reports

Use cron to schedule daily/weekly reports:

# Daily summary at 9 AM
0 9 * * * curl -s http://localhost:3377/api/summary | mail -s "Daily Cost Report" you@example.com

Data Export

Export raw data for external analysis:

# Export all sessions to CSV
sqlite3 data/clawmeter.db "SELECT * FROM sessions" -csv > sessions.csv

Running as a Service

Create systemd service for persistent operation:

# /etc/systemd/system/clawmeter.service
[Unit]
Description=ClawMeter Cost Tracking Dashboard
After=network.target

[Service]
Type=simple
User=youruser
WorkingDirectory=/home/youruser/.openclaw/workspace/clawmeter
ExecStart=/usr/bin/npm start
Restart=always

[Install]
WantedBy=multi-user.target

Enable and start:

sudo systemctl enable clawmeter
sudo systemctl start clawmeter

Security Considerations

Local Access Only

By default, ClawMeter binds to localhost:3377 and is not exposed to the internet.

To access remotely, use SSH tunneling:

ssh -L 3377:localhost:3377 your-server

Sensitive Data

Session logs may contain conversation data. ClawMeter:

  • Stores only usage metadata (tokens, costs, timestamps)
  • Does not store message content or prompts
  • Database is local SQLite (no cloud sync)

API Authentication

ClawMeter currently has no authentication. For production:

  1. Run behind a reverse proxy (nginx/caddy) with auth
  2. Use firewall rules to restrict access
  3. Deploy on a private network

Performance

Resource Usage

  • CPU: Minimal (event-driven ingestion)
  • RAM: ~50-100 MB
  • Disk: Database grows ~1 KB per message (SQLite is very efficient)
  • Network: None (all local)

Scalability

ClawMeter handles:

  • 100K+ messages easily
  • Years of historical data without performance degradation
  • Multiple agents (separated by directory structure)

For massive deployments (millions of messages), consider:

  • Periodic database archiving
  • PostgreSQL backend (requires code changes)

Roadmap

Planned features:

  • [ ] Multi-user authentication
  • [ ] PostgreSQL support for large deployments
  • [ ] Export to CSV/JSON
  • [ ] Cost forecasting (predict monthly spend)
  • [ ] Slack/Discord webhook support
  • [ ] Token usage heatmaps
  • [ ] Model performance tracking (latency, quality)
  • [ ] Budget recommendations based on usage patterns

Support


License

MIT — Free and open source forever.


Made with ⚡ by the OpenClaw community

_Track your spending. Optimize your costs. Stay in control._

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

75.9%
按下载量换算5,550

安全审计

VirusTotal

可疑

ClawScan

可疑

Static analysis

未展示

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills