cost-tracker

AI spending monitor — track costs across OpenRouter models with daily, weekly, and monthly reports. Budget limits with alerts, per-model analysis, savings recommendations, and historical tracking via SQLite. Use for controlling AI costs and optimizing model selection.

3,891 stars

Best use case

cost-tracker is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

AI spending monitor — track costs across OpenRouter models with daily, weekly, and monthly reports. Budget limits with alerts, per-model analysis, savings recommendations, and historical tracking via SQLite. Use for controlling AI costs and optimizing model selection.

Teams using cost-tracker should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/cost-tracker/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/aiwithabidi/cost-tracker/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/cost-tracker/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How cost-tracker Compares

Feature / Agentcost-trackerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

AI spending monitor — track costs across OpenRouter models with daily, weekly, and monthly reports. Budget limits with alerts, per-model analysis, savings recommendations, and historical tracking via SQLite. Use for controlling AI costs and optimizing model selection.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# 💰 Cost Tracker

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

## Usage

```bash
# 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](https://www.linkedin.com/in/mohammad-ali-abidi) | [agxntsix.ai](https://www.agxntsix.ai)
[YouTube](https://youtube.com/@aiwithabidi) | [GitHub](https://github.com/aiwithabidi)
Part of the **AgxntSix Skill Suite** for OpenClaw agents.

📅 **Need help setting up OpenClaw for your business?** [Book a free consultation](https://cal.com/agxntsix/abidi-openclaw)

Related Skills

KPI Tracker Skill

3891
from openclaw/skills

Track, analyze, and report on Key Performance Indicators for any business.

Workflow & Productivity

Cloud Cost Optimization Audit

3891
from openclaw/skills

Analyze cloud infrastructure spend across AWS, Azure, and GCP. Identify waste, rightsizing opportunities, and reserved instance savings.

Customer Acquisition Cost (CAC) Optimizer

3891
from openclaw/skills

Analyze, benchmark, and reduce your customer acquisition cost across every channel.

Business Analytics & Strategy

Budget & Expense Tracker — AI Agent Financial Command Center

3891
from openclaw/skills

Track every dollar, enforce budgets, spot spending patterns, and build wealth — all through natural conversation with your AI agent.

General Utilities

game-light-tracker

3891
from openclaw/skills

Track live NFL, NBA, NHL, or MLB games and automatically change Hue light colors based on which team is leading. Use when user wants to sync smart lights with live sports scores for visual game tracking. Supports NFL, NBA, NHL, and MLB games with customizable team colors.

General Utilities

ml-experiment-tracker

3891
from openclaw/skills

Plan reproducible ML experiment runs with explicit parameters, metrics, and artifacts. Use before model training to standardize tracking-ready experiment definitions.

Data & Research

element-nft-tracker

3891
from openclaw/skills

Element Market API integration. This skill strictly requires the 'ELEMENT_API_KEY' environment variable to function.

dependency-tracker

3891
from openclaw/skills

每周依赖检查。检查 Node.js、npm 版本和全局包是否有可用更新。触发时机:cron 定时任务或手动调用。

cost-governor

3891
from openclaw/skills

No description provided.

polymarket-tracker

3891
from openclaw/skills

Track top Polymarket markets by trading volume. Shows market name, Yes/No trading volumes, and current odds. Use when user asks about Polymarket trends, hot markets, or wants to find high-volume trading opportunities. Requires payment via skillpay.me (0.001 USDT per call).

india-price-tracker

3891
from openclaw/skills

Track and compare product prices across popular Indian stores (Amazon India, Flipkart, Reliance Digital, Croma, Vijay Sales, Tata CLiQ, and more), compute effective prices after offers/cashback, detect arbitrage opportunities, and monitor price history with alerts.

calorie-tracker

3891
from openclaw/skills

Smart health management solution with food and exercise recognition, nutrition and calorie analysis, secure data storage, and comprehensive data management. Empowers users with accurate food and exercise logging, personalized nutrition assessment, daily intake tracking, and calorie expenditure monitoring to support a healthy lifestyle.