0xjohmsmith

daily-cost-report

Calculate and report daily OpenClaw API usage costs from session files. Use when asked about daily costs, spending, API usage, token costs, or "how much did we spend" questions. Returns day-by-day cost breakdown for last N days (default 7), including per-agent and per-model breakdown with token counts.

0xjohmsmith 0 Updated 3mo ago

Resources

1
GitHub

Install

npx skillscat add 0xjohmsmith/openclaw/daily-cost-report

Install via the SkillsCat registry.

SKILL.md

Daily Cost Report

Usage

Run the script to get a cost breakdown:

# Last 7 days (default)
python3 skills/daily-cost-report/scripts/daily_cost.py

# Custom number of days
python3 skills/daily-cost-report/scripts/daily_cost.py 14

Output

Per day: total cost, token breakdown (input/output/cache_read/cache_write), cost by agent, cost by model.
Summary: grand total + daily average.

Workflow

  1. Run the script with exec
  2. Parse stdout and present a clean summary to the user
  3. Highlight any expensive days or models worth noting

Notes

  • Scans ~/.openclaw/agents/*/sessions/*.jsonl
  • Reads usage.cost.total from each type=message record
  • Filters by timestamp to the requested day window