← Back to Skills Marketplace
Cost Tracking for Models
by
vincentqiu
· GitHub ↗
· v1.0.2
5809
Downloads
11
Stars
0
Active Installs
3
Versions
Install in OpenClaw
/install cost-report
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.
Usage Guidance
Review before installing. Use the main cost_report.sh script only with simple trusted flags if you need this functionality, avoid report_discord.sh and --show-errors when session errors may contain private prompts or identifiers, and treat automated Discord delivery as potentially sharing local session-derived data.
Capability Analysis
Type: OpenClaw Skill
Name: cost-report
Version: 1.0.2
The OpenClaw Cost Tracker skill is benign. It is designed to parse local OpenClaw session log files (`~/.openclaw/agents/*/sessions/*.jsonl`) to generate usage cost reports. The `scripts/cost_report.sh` and `scripts/report_discord.sh` scripts use standard utilities like `jq`, `grep`, `date`, and `bc` to process data without making external network calls or attempting to access sensitive system files. The `cli.js` wrapper simply executes the shell script, and the `SKILL.md` and `README.md` files provide clear, non-malicious instructions for the agent, aligning perfectly with the stated purpose of cost tracking.
Capability Assessment
Purpose & Capability
Parsing OpenClaw session logs for cost totals is coherent with the stated purpose and the main log path is disclosed, but report_discord.sh unconditionally includes error reporting and adds Kimi-specific raw errorMessage output that is not clearly described in the user-facing skill instructions.
Instruction Scope
The documented examples focus on cost totals and model breakdowns, while the implementation includes --show-errors behavior and a Discord helper that surfaces diagnostic text from local logs. The CLI also constructs a shell command string from forwarded arguments, creating unintended command-execution risk for crafted arguments.
Install Mechanism
Installation is dependency-light, with jq declared and no package dependencies or postinstall script found. The CLI does run chmod on its bundled shell script at execution time, which is disclosed by code but not prominent in documentation.
Credentials
Reading local OpenClaw session logs is necessary for cost reporting, but broad traversal under ~/.openclaw/agents plus raw error extraction can reveal more sensitive session metadata than cost totals, especially when used with Discord/reporting workflows.
Persistence & Privilege
The artifact includes enabled cron example configuration for scheduled Discord delivery, but it does not appear to self-install persistence, escalate privileges, or create background workers on its own.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install cost-report - After installation, invoke the skill by name or use
/cost-report - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.2
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.
v1.0.1
**Changelog for cost-report v1.0.1**
- Added a README.md with comprehensive usage and integration instructions.
- Introduced scripts/extract-cost.sh to extract and summarize actual API costs from session JSONL files.
- Updated documentation to emphasize tracking real API spending using session logs, not token counts.
- Legacy token-based estimation scripts are now clearly marked as deprecated.
v1.0.0
- Initial release of clawdbot-cost-tracker.
- Tracks AI model usage and estimates API costs for Claude, GPT, and Codex models.
- Provides model-specific pricing and simple cost calculation formula.
- Supports daily usage snapshots and cost calculations.
- Includes scripts for automating usage snapshots and cost reporting.
- Designed for integration with daily reporting workflows and supports region-specific color conventions.
Metadata
Frequently Asked Questions
What is 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. It is an AI Agent Skill for Claude Code / OpenClaw, with 5809 downloads so far.
How do I install Cost Tracking for Models?
Run "/install cost-report" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Cost Tracking for Models free?
Yes, Cost Tracking for Models is completely free (open-source). You can download, install and use it at no cost.
Which platforms does Cost Tracking for Models support?
Cost Tracking for Models is cross-platform and runs anywhere OpenClaw / Claude Code is available (darwin, linux).
Who created Cost Tracking for Models?
It is built and maintained by vincentqiu (@vincentqiu); the current version is v1.0.2.
More Skills