🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

OEE AI Cost Tracker

by @odinbot33

Tracks AI API usage by logging calls, reporting spending by model and period, and suggesting cheaper models to optimize costs.

Versionv1.0.0
Downloads1,512
TERMINAL
clawhub install oee-ai-cost-tracker

πŸ“– About This Skill

🐾 AI Cost Tracker β€” Know What You Spend

> by Odin's Eye Enterprises β€” Ancient Wisdom. Modern Intelligence.

Track every AI API call, generate spend reports, and get routing suggestions to cut costs.

What It Does

1. Logs every API call with model, tokens, cost to JSONL 2. Reports spending by model, time period, and use case 3. Suggests cheaper model routing based on task complexity

Trigger Phrases

  • "how much have I spent on AI"
  • "AI cost report"
  • "track this API call"
  • "show AI spending"
  • "cost breakdown"
  • Usage

    Logging (in your code)

    from tracker import log_usage
    log_usage(model="claude-3-haiku", input_tokens=500, output_tokens=200, task="humanize")
    

    Reports

    # Full spend report
    python report.py

    Last 7 days

    python report.py --days 7

    By model

    python report.py --by-model

    Files

  • tracker.py β€” logging library, import into your tools
  • report.py β€” CLI dashboard for spend analysis
  • pricing.json β€” model pricing data (update as needed)
  • Requirements

  • Python 3.10+ (stdlib only)
  • No API keys needed (this tracks YOUR usage)
  • For Agents

    To check spending: python report.py To log usage from other tools: from tracker import log_usage

    πŸ’‘ Examples

    Logging (in your code)

    from tracker import log_usage
    log_usage(model="claude-3-haiku", input_tokens=500, output_tokens=200, task="humanize")
    

    Reports

    # Full spend report
    python report.py

    Last 7 days

    python report.py --days 7

    By model

    python report.py --by-model