2.5k
GitHub Stars
5
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill openclaw/skills --skill cost-report- _meta.json645 B
- cli.js1.4 KB
- package.json718 B
- README.md2.1 KB
- SKILL.md2.1 KB
Overview
This skill tracks OpenClaw usage costs and produces clear, date- and model-specific reports suitable for Discord and other messaging channels. It parses OpenClaw session logs to extract accurate cost data and offers daily, weekly, and monthly summaries. Reports include totals, model breakdowns, and simple comparisons to prior periods.
How this skill works
The skill reads OpenClaw session JSONL files and uses jq to extract the message.usage.cost.total field for each API call. It aggregates costs by date and model, deduplicates entries so each call is counted once, and formats results into human-friendly summaries for messaging channels. Outputs support today/yesterday, week, month, and custom date ranges.
When to use it
- Monitor daily spending and compare to yesterday.
- Generate weekly summaries for finance or ops reviews.
- Produce monthly reports for budgeting and chargebacks.
- Send cost reports to Discord or team channels automatically.
- Audit model-specific usage and spot cost spikes.
Best practices
- Ensure jq is installed and the script has read access to ~/.openclaw/agents/*/sessions/*.jsonl.
- Run reports from a scheduled job for consistent historical tracking.
- Use custom date ranges to reconcile invoices or unusual billing periods.
- Validate that log rotation or archival policies keep needed session files.
- Compare model-level trends to optimize model selection and limits.
Example use cases
- Daily Discord message showing today's total cost and model breakdown for on-call engineers.
- Weekly cost comparison sent to finance to highlight percentage change vs prior week.
- Monthly export for budget owners that shows month-over-month growth by model.
- Ad-hoc date-range report to investigate a sudden spike in costs from a specific model.
- Archive of historical costs for audit or chargeback purposes.
FAQ
Read access to the OpenClaw session log directory (~/.openclaw/agents/*/sessions/*.jsonl) and ability to run jq.
Can I customize the report format for other messaging channels?
Yes. The script outputs plain text blocks suitable for Discord and can be adapted to other channel formats or JSON webhook payloads.