Feedback

clawdbot-cost-tracker

@openclaw Claim

Basic information

Repository
openclaw
Skill
clawdbot-cost-tracker

About clawdbot-cost-tracker

Track Clawdbot AI model usage and estimate costs. Use when reporting daily/weekly costs, analyzing token usage across sessions, or monitoring AI spending. Supports Claude (opus/sonnet), GPT, and Codex models.

clawdbot-cost-tracker is an agent skill listed in the AddMCP.net directory, published by openclaw. Source code is hosted on github.com.

Overview

What is clawdbot-cost-tracker?


name: openclaw-cost-tracker description: Track OpenClaw usage costs and provide detailed reports by date and model. Supports daily, weekly, and monthly report formats for Discord and other messaging channels. metadata: { "openclaw": { "emoji": "💰", "os": ["darwin", "linux"], "requires": { "bins": ["jq"] }, "install": [ { "id": "brew", "kind": "brew", "formula": "jq", "bins": ["jq"], "label": "Install jq (JSON parser)", }, ], }, }


OpenClaw Cost Tracker

Overview

Precisely track OpenClaw usage costs with detailed reports by date and model type. This skill uses the jq tool to directly parse JSON data from OpenClaw session logs, extracting accurate cost information.

Supports multiple report formats:

  • Daily Reports (today/yesterday costs)
  • Weekly Reports (current week total/comparison with previous week)
  • Monthly Reports (current month total/month-over-month growth)

Quick Start

# Today's cost report
bash {baseDir}/scripts/cost_report.sh --today

# Yesterday's cost report
bash {baseDir}/scripts/cost_report.sh --yesterday

# Weekly cost report
bash {baseDir}/scripts/cost_report.sh --week

# Date range report
bash {baseDir}/scripts/cost_report.sh --from 2026-01-01 --to 2026-01-31

Cost Calculation Method

This script directly extracts cost data from OpenClaw session log files (~/.openclaw/agents//sessions/.jsonl):

  1. Uses jq to parse JSON data, locating the message.usage.cost.total field
  2. Calculates totals grouped by date and model
  3. Ensures each API call's cost is counted only once

Discord Output Format

💰 OpenClaw Cost Report (2026-02-04)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Today's Total Cost: $XX.XX (🟢 -XX% vs yesterday)

📊 Model Details:
• claude-opus-4-5: $XX.XX (XX%)
• gpt-4o: $X.XX (X%)
• ...

📈 Weekly Total: $XXX.XX

Installation Requirements

  • jq: JSON parsing tool (brew install jq or apt install jq)
  • Access to OpenClaw log files

Comments

No comments yet

Be the first to share feedback about this listing. Sign in to leave a comment.

Sign In

Feedback 💬