Cost Tracking for Models

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.

vincentqiu

@vincentqiu

What This Skill Does

Parses OpenClaw session logs to extract and report usage costs grouped by date and model. Generates formatted daily, weekly, and monthly cost summaries for Discord or other messaging channels.

Replaces manual log inspection and spreadsheet tracking by automating cost extraction and report generation from OpenClaw session data.

When to Use It

  • Check today's OpenClaw usage cost at a glance
  • Compare this week's spending against the previous week
  • Generate a monthly cost breakdown by model type
  • Share a formatted cost report in a Discord channel
  • Audit cost trends over a custom date range

Install

$ openclaw skills install @vincentqiu/cost-report

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

Top skills in this category

PollyReach

@pollyreach

PollyReach gives every AI agent a phone number and the ability to get things done over the phone โ€” finding contacts, making calls, and completing tasks. Just...

55101k

Task Status

@mightyprime1

Send short status descriptions in chat for long-running tasks. Use when you need to provide periodic updates during multi-step operations, confirm task completion, or notify of failures. Includes automated periodic monitoring that sends updates every 5 seconds, status message templates, and a helper function for consistent status reporting.

1212k

Proactive Tasks

@imrkhn03

Proactive goal and task management system. Use when managing goals, breaking down projects into tasks, tracking progress, or working autonomously on objectives. Enables agents to work proactively during heartbeats, message humans with updates, and make progress without waiting for prompts.

105.2k

AI Proposal Generator

@jeffjhunter

Generate professional HTML proposals from meeting notes. Features 5 proposal styles (Corporate, Entrepreneur, Creative, Consultant, Minimal), 6+ color themes, and a Design Wizard for custom templates. Triggers on "create proposal", "proposal for [client]", "proposal wizard", "proposal from [notes]", "show proposal styles", "finalize proposal". Integrates with ai-meeting-notes for context. Outputs beautiful, responsive HTML ready to send or export as PDF.

95.1k

Daily Report

@visualdeptcreative

Generate daily, weekly, and alert reports tracking leads, outreach, cost, priorities, and issues, saving structured summaries for progress monitoring.

66.3k