OpenClaw Skillv1.0.2

Cost Tracking for Models

vincentqiuby vincentqiu
Deploy on EasyClawdfrom $14.9/mo

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.

How to use this skill

OpenClaw skills run inside an OpenClaw container. EasyClawd deploys and manages yours — no server setup needed.

  1. Sign up on EasyClawd (2 minutes)
  2. Connect your Telegram bot
  3. Install Cost Tracking for Models from the skills panel
Get started — from $14.9/mo
12stars
3,915downloads
16installs
0comments
3versions

Latest Changelog

Big change: Cost tracking and reporting system fully refactored for OpenClaw, with easier automation and Discord-ready reporting.

- Renamed skill to openclaw-cost-tracker with new OpenClaw-compatible file paths and model details.
- Replaced old token-based scripts with shell scripts (cost_report.sh, report_discord.sh) using jq for accurate cost parsing.
- Added CLI entry point and configuration/examples for scheduling and formatting reports.
- Removed deprecated/inaccurate scripts for legacy Clawdbot.
- Supports daily, weekly, monthly, and custom date-range cost summaries, including model breakdown.
- Outputs results in formats ready for Discord and other messaging platforms.

Tags

Claude: 1.0.0Codex: 1.0.0Cost: 1.0.0Daily: 1.0.0Gemini: 1.0.0Model: 1.0.0OpenAI: 1.0.0Report: 1.0.0latest: 1.0.2

Skill Documentation

---
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
Security scan, version history, and community comments: view on ClawHub