Stop guessing your AI spend. Track costs per task, model, and project. Know your ROI.
AI costs are invisible until the bill arrives.
| What you see | What you don't see |
|---|---|
| Monthly API bill | Cost per task/project |
| "You used 2M tokens" | Which sessions cost most |
| Rate limit errors | Cost efficiency of each model |
Real costs add up fast:
- Single coding session: $5-50
- Multi-agent system per day: $100s
- Monthly bill surprise: $500+
TRACK → Log every API call (model, tokens, cost, project)
ANALYZE → Weekly review: top costs, model efficiency, trends
OPTIMIZE → Route tasks to cost-efficient models
entries:
- timestamp: 2026-04-27T03:00:00Z
task: "Code review: auth module"
model: claude-3-opus
input_tokens: 8500
output_tokens: 2200
cost_usd: 0.68
project: myapp-backendAfter every API call, log to cost-log.yaml:
timestamp, task, model, input_tokens, output_tokens, cost_usd, project
Ask your agent:
"Analyze cost-log.yaml: top 5 expensive tasks, cost by model, weekly trend"
| Model | Input ($/1M) | Output ($/1M) | Best For |
|---|---|---|---|
| Claude 3 Opus | $15 | $75 | Complex reasoning |
| Claude 3 Sonnet | $3 | $15 | General use |
| GPT-4 Turbo | $10 | $30 | Code, analysis |
| GPT-3.5 Turbo | $0.50 | $1.50 | Simple tasks |
- 📊 Visibility: Know exactly where your money goes
- 🎯 Attribution: Cost per project, not just total
- ⚡ Optimization: Data-driven model selection
- 🔮 Forecasting: Predict monthly spend before surprise
| ❌ Bad | ✅ Good |
|---|---|
| Check bill later | Log every session |
| Expensive model for simple tasks | Route by complexity |
| No project tags | Tag every entry |
Every dollar saved is a dollar for more valuable AI tasks.
# Claude Code
cp SKILL.md .claude/skills/api-cost-tracker/
# OpenClaw
cp SKILL.md ~/.openclaw/workspace/skills/api-cost-tracker/
# Cursor
cp SKILL.md .cursor/rules/api-cost-tracker.mdcMIT — Use freely, attribute if you like.