Cost Tracker

v1.0.0

AI spending monitor — track costs across OpenRouter models with daily, weekly, and monthly reports. Budget limits with alerts, per-model analysis, savings re...

0· 637·6 current·6 all-time
MIT-0
Download zip
LicenseMIT-0 · Free to use, modify, and redistribute. No attribution required.
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (OpenRouter cost tracking) align with the code and SKILL.md: the script calls OpenRouter endpoints (/api/v1/auth/key and /api/v1/models), stores data in a local SQLite DB, produces reports, and provides savings recommendations. Required env var is the OpenRouter API key, which is appropriate.
Instruction Scope
SKILL.md instructs running the included Python script with subcommands (fetch, report, models, budget, savings, export). The script operates on a local data directory and only queries OpenRouter. It does store raw JSON of the /auth/key response in the DB (expected for tracking usage) but does not reference unrelated system files or other environment variables.
Install Mechanism
No install spec is provided (instruction-only + included script). The only third‑party library used is requests; missing this library causes the script to exit with a clear message asking the user to pip install requests. No arbitrary downloads or extracted archives are present.
Credentials
Only OPENROUTER_API_KEY is required and is used to authenticate to OpenRouter. No additional credentials, secrets, or unrelated env vars are requested. The script stores account/usage JSON locally in data/cost_tracker.db, which is proportional to the stated purpose.
Persistence & Privilege
The skill does not request persistent platform privileges (always:false). It writes only to its own data directory (./data/cost_tracker.db) and creates local SQLite tables; it does not modify other skills or global agent configuration.
Assessment
This skill appears to do what it says: it uses your OPENROUTER_API_KEY to query OpenRouter for usage and models, stores results locally in data/cost_tracker.db, and prints reports. Before installing, confirm you trust the skill source (homepage: agxntsix.ai) and are comfortable giving the skill your OpenRouter API key. Note the DB will contain raw JSON from the /auth/key response (account/usage data) — protect that file. The script requires the Python requests library; consider running it in an isolated virtualenv. If you want extra assurance, inspect the rest of the script (the truncated portion in the provided file appears consistent but you can review the full file) and verify it only contacts openrouter.ai and performs only local DB writes.

Like a lobster shell, security has layers — review code before you run it.

latestvk9732f0fr4ddkak6m5mn1zvc1n81cr29

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

Runtime requirements

💰 Clawdis
EnvOPENROUTER_API_KEY
Primary envOPENROUTER_API_KEY

SKILL.md

💰 Cost Tracker

AI spending monitor for OpenRouter. Track per-model costs, get daily/weekly/monthly reports, set budget alerts, and get savings recommendations.

Usage

# Fetch and store current usage from OpenRouter
python3 {baseDir}/scripts/cost_tracker.py fetch

# Show spending reports
python3 {baseDir}/scripts/cost_tracker.py report --period daily
python3 {baseDir}/scripts/cost_tracker.py report --period weekly
python3 {baseDir}/scripts/cost_tracker.py report --period monthly

# Per-model breakdown
python3 {baseDir}/scripts/cost_tracker.py models

# Set monthly budget + check status
python3 {baseDir}/scripts/cost_tracker.py budget --set 25.00
python3 {baseDir}/scripts/cost_tracker.py budget --check

# Savings recommendations
python3 {baseDir}/scripts/cost_tracker.py savings

# Export data as JSON
python3 {baseDir}/scripts/cost_tracker.py export --format json
python3 {baseDir}/scripts/cost_tracker.py export --format csv

Features

  • Live Usage Fetch — Pulls real spending data from OpenRouter's /api/v1/auth/key endpoint
  • Per-Model Tracking — See which models cost you the most
  • Period Reports — Daily, weekly, monthly summaries with trends
  • Budget Alerts — Set limits and get warned at 80% threshold
  • Savings Tips — Identifies cheaper models that could handle the same workload
  • Historical Data — SQLite storage for long-term trend analysis
  • Export — JSON or CSV export for spreadsheets

Data Storage

All data stored in {baseDir}/data/cost_tracker.db (SQLite).

Credits

Built by M. Abidi | agxntsix.ai YouTube | GitHub Part of the AgxntSix Skill Suite for OpenClaw agents.

📅 Need help setting up OpenClaw for your business? Book a free consultation

Files

2 total
Select a file
Select a file to preview.

Comments

Loading comments…