OEE AI Cost Tracker

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

MIT-0 · Free to use, modify, and redistribute. No attribution required.
0 · 485 · 0 current installs · 0 all-time installs
MIT-0
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (track API usage, report spend, suggest cheaper models) match the provided files: tracker.py logs entries to a local JSONL file, report.py reads that file and pricing.json to produce reports and suggestions. No unrelated binaries, env vars, or external services are requested.
Instruction Scope
SKILL.md instructs importing log_usage and running report.py, which is exactly what the code implements. The runtime instructions only read/write local files in the skill directory (pricing.json and usage.jsonl). There are no directives to read other system files, environment variables, or send data to external endpoints.
Install Mechanism
No install spec; this is an instruction-only skill with small Python scripts that rely on the stdlib. No downloads, packages, or extraction steps are present.
Credentials
No environment variables, credentials, or config paths are required. The skill stores logs in a local usage.jsonl file and uses a local pricing.json; both are reasonable and proportionate for the stated purpose.
Persistence & Privilege
always is false and the skill does not request elevated or persistent platform privileges. It only creates/updates a usage.jsonl file alongside the code (normal for a local logger).
Assessment
This skill is coherent and local-only, but review the following before installing: (1) It creates/updates usage.jsonl in the skill directory — ensure that file location is acceptable and not a shared/remote mount. Logged fields include description and taskType you pass; avoid logging full prompts or secrets. (2) pricing.json is static — verify prices are accurate for your providers and update as needed. (3) The cost estimates are local heuristics (not authoritative billing data) and unknown/unsupported model names return a $0 estimate. (4) There are minor robustness issues (e.g., a possible division-by-zero when all recorded costs are zero) — harmless but may raise errors on edge cases. If you accept local logging of usage and the minimal file writes, this skill is reasonable to use. If you need centralized or auditable billing, prefer vendor billing APIs rather than local estimates.

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

Current versionv1.0.0
Download zip
latestvk97783feq28jswfq8rdvrqy8vh814dp0

License

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

SKILL.md

🐾 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

<!-- 🐾 Odin's ravens count every coin -->

Files

4 total
Select a file
Select a file to preview.

Comments

Loading comments…