Skip to content
Back to skills

Cost Report

ASecurity

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.

  • 14 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 7, 2026
ai-agentsbashapi

Works with

  • api

Security analysis

A100/100

Pro scans all 8 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add modbender/skill-library-mcp --skill cost-report --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cost Report?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cost Report
[![Security: A β€” Skills Directory](https://www.skillsdirectory.com/api/skills/modbender-cost-report/badge)](https://www.skillsdirectory.com/skills/modbender-cost-report)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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

```bash
# 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

Files in this skill

  • README.md2.2 KB
  • SKILL.md2.2 KB
  • cli.js1.5 KB
  • config/cron-examples.json1.4 KB
  • package.json751 B
  • references/JSONL_FORMAT.md2.6 KB
  • scripts/cost_report.sh15.3 KB
  • scripts/report_discord.sh867 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…