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

Api Cost Tracker

by @charlie-morrison

Track, analyze, and optimize AI API costs across OpenAI, Anthropic, OpenRouter, Google, and other LLM providers. Parses billing data, usage logs, or API resp...

πŸ’‘ Examples

# Analyze OpenRouter usage (from activity page export)
python3 scripts/api_cost_tracker.py openrouter --file activity.json

Analyze OpenAI usage (from billing export)

python3 scripts/api_cost_tracker.py openai --file usage.json

Analyze from environment (auto-detect provider from API keys)

python3 scripts/api_cost_tracker.py auto --days 30

Cost breakdown by model

python3 scripts/api_cost_tracker.py openrouter --file activity.json --by model

Cost breakdown by day with trend analysis

python3 scripts/api_cost_tracker.py openrouter --file activity.json --by day --trends

Find most expensive requests

python3 scripts/api_cost_tracker.py openrouter --file activity.json --top 20

Compare current vs optimized (model substitution analysis)

python3 scripts/api_cost_tracker.py openrouter --file activity.json --optimize

Set budget alert threshold

python3 scripts/api_cost_tracker.py openrouter --file activity.json --budget 50.00

Output as markdown report

python3 scripts/api_cost_tracker.py openrouter --file activity.json --output markdown

Output as JSON

python3 scripts/api_cost_tracker.py openrouter --file activity.json --output json

View on ClawHub
TERMINAL
clawhub install cm-api-cost-tracker

πŸ§ͺ Use this skill with your agent

Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

πŸ” Can't find the right skill?

Search 60,000+ AI agent skills β€” free, no login needed.

Search Skills β†’