OpenRouter Usage Analyzer
Analyzes OpenRouter API usage exports to provide cost and token insights.
When to Use
- User attaches a CSV file from OpenRouter dashboard
- User asks to analyze token usage or costs
- User mentions OpenRouter usage data
- User wants hourly/daily cost breakdowns
How to Use
When triggered by CSV attachment or usage analysis request:
- Save the attached CSV to a temp location if needed
- Run the analyzer script:
python3 scripts/analyze.py <csv_path> --model --provider - Present the results in a clean, formatted way highlighting:
- Total spend and cost per request
- Peak usage hours
- Model breakdown (Kimi, Mimo, etc.)
- Provider costs (Moonshot, Chutes, Novita, etc.)
- Cost efficiency metrics
Output Format
Present results in sections:
- 💰 Cost Efficiency (total spend, per-request cost, avg latency)
- 📊 Hourly Breakdown (cost per hour, requests, tokens)
- 📅 Daily Summary (if multi-day)
- 🤖 Model Breakdown (which models cost what)
- 🏢 Provider Breakdown (which providers used)
Script Usage
# Basic analysis
python3 scripts/analyze.py <csv_file>
# With all breakdowns
python3 scripts/analyze.py <csv_file> --model --provider
# Export to CSV
python3 scripts/analyze.py <csv_file> --export output.csv
The script has no dependencies - uses only Python standard library.
微信扫一扫