653★by vincentqiu
openclaw-cost-tracker – OpenClaw Skill
openclaw-cost-tracker is an OpenClaw Skills integration for ai ml workflows. 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.
Skill Snapshot
| 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. OpenClaw Skills integration. |
| owner | vincentqiu |
| repository | vincentqiu/cost-report |
| language | Markdown |
| license | MIT |
| topics | |
| security | L1 |
| install | openclaw add @vincentqiu/cost-report |
| last updated | Feb 7, 2026 |
Maintainer

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):
- Uses jq to parse JSON data, locating the
message.usage.cost.totalfield - Calculates totals grouped by date and model
- 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 jqorapt install jq) - Access to OpenClaw log files
OpenClaw Cost Tracker
Accurately track OpenClaw usage costs with detailed reports by date and model.
Features
- ✅ Precisely parse API call costs from OpenClaw session logs
- ✅ Group costs by model type
- ✅ Support daily, weekly, and monthly reports
- ✅ Display cost changes (increase/decrease percentage)
- ✅ Compatible with macOS and Linux
- ✅ Beautiful Discord output format
- ✅ Can be set up as automated cron tasks
Installation
-
Make sure you have the required dependencies:
# macOS brew install jq # Ubuntu/Debian apt install jq bc -
Set script execution permissions:
chmod +x scripts/cost_report.sh
Usage
# Today's cost report
npm start
# Or run the script directly
./scripts/cost_report.sh --today
# Yesterday's cost report
./scripts/cost_report.sh --yesterday
# Weekly cost report
./scripts/cost_report.sh --week
# Date range report
./scripts/cost_report.sh --from 2026-01-01 --to 2026-01-31
# Generate Discord format report
./scripts/cost_report.sh --today --format discord
# Generate JSON format report
./scripts/cost_report.sh --today --format json
Automated Reports (Cron)
See the config/cron-examples.json file to learn how to set up automated report tasks. Use OpenClaw's cron functionality to easily set up daily/weekly cost reports.
Calculation Method
This tool extracts accurate API call cost data directly from OpenClaw session log files, ensuring precise and reliable report results:
- Scan all session JSONL files for records on the target date
- Use jq to parse the
message.usage.cost.totalfield in each record - Group by model and calculate totals
- Avoid data duplication or loss issues caused by session compaction
Notes
- Ensure you have read permissions for the OpenClaw sessions directory
- Processing large session files may take longer
- If costs are 0, it may be because the API provider did not provide cost data
Technical Details
- Uses jq to parse JSON data
- Compatible with macOS and Linux date handling
- Supports cost calculations grouped by model
- Chinese-style color indicators for changes (🔴up / 🟢down)
Permissions & Security
Security level L1: Low-risk skills with minimal permissions. Review inputs and outputs before running in production.
Requirements
- jq: JSON parsing tool (`brew install jq` or `apt install jq`) - Access to OpenClaw log files
FAQ
How do I install openclaw-cost-tracker?
Run openclaw add @vincentqiu/cost-report in your terminal. This installs openclaw-cost-tracker into your OpenClaw Skills catalog.
Does this skill run locally or in the cloud?
OpenClaw Skills execute locally by default. Review the SKILL.md and permissions before running any skill.
Where can I verify the source code?
The source repository is available at https://github.com/openclaw/skills/tree/main/skills/vincentqiu/cost-report. Review commits and README documentation before installing.
