Weekly API cost report — reads token usage CSV, computes dollar costs per skill and model, reports trends
Today is ${today}. Generate a cost report from Aeon's token usage data.
Use these rates to calculate costs. First check aeon.yml for the gateway.provider value.
| Model | Input | Output | Cache Read | Cache Write |
|---|---|---|---|---|
| claude-opus-4-7 | $15.00 | $75.00 | $1.50 | $3.75 |
| claude-sonnet-4-6 | $3.00 | $15.00 | $0.30 | $3.75 |
| claude-haiku-4-5-20251001 | $0.80 | $4.00 | $0.08 | $3.75 |
| Model | Input | Output |
|---|
| claude-opus-4-7 | $5.00 | $25.00 |
| claude-sonnet-4-6 | $3.00 | $15.00 |
| claude-haiku-4-5-20251001 | $0.80 | $4.00 |
| gemini-3-pro | $1.25 | $10.00 |
| gemini-3-flash | $0.15 | $0.60 |
| gpt-5.2 | $2.50 | $10.00 |
| kimi-k2.5 | $1.00 | $4.00 |
| qwen3-coder | $0.50 | $2.00 |
Note: Bankr does not break out cache read/write pricing separately. Treat cache columns as zero cost for Bankr rows.
For any model not in these tables, default to Opus pricing (conservative estimate).
Determine the report window.
${var} is set to a number (e.g. "30"), use that many days.CUTOFF_DATE = today minus N days.Read token usage data.
memory/token-usage.csvdate,skill,model,input_tokens,output_tokens,cache_read,cache_creationdate >= CUTOFF_DATE.Compute costs for each row.
For each row, look up the model's rates and calculate:
input_cost = input_tokens / 1,000,000 × rate_input
output_cost = output_tokens / 1,000,000 × rate_output
cache_read_cost = cache_read / 1,000,000 × rate_cache_read
cache_write_cost = cache_creation / 1,000,000 × rate_cache_write
row_cost = input_cost + output_cost + cache_read_cost + cache_write_cost
Aggregate into report sections.
a. Total cost for the window. b. Per-skill cost table — sum cost per skill, sort descending, show top 10:
Write the full report to articles/cost-report-${today}.md:
# Aeon Cost Report — ${today}
*Period: last N days*
## Summary
- **Total API cost:** $X.XX
- **Total tokens:** X,XXX,XXX (input: X | output: X | cache_read: X | cache_write: X)
- **Skill runs tracked:** N
- **Week-over-week:** ↑/↓ X% vs prior week (omit if <14 days of data)
## Cost by Skill (Top 10)
| Skill | Runs | Tokens | Cost | Avg/Run |
|-------|------|--------|------|---------|
| ... | ... | ... | $... | $... |
## Cost by Model
| Model | Runs | Tokens | Cost |
|-------|------|--------|------|
| ... | ... | ... | $... |
## Efficiency
| Skill | Cost / 1K Output Tokens |
|-------|------------------------|
| ... | $... |
*Generated by Aeon cost-report skill*
Send notification via ./notify:
*Cost Report — ${today} (last N days)*
Total: $X.XX across N skill runs
Top 3 by cost:
1. skill-a — $X.XX (N runs, avg $X.XX/run)
2. skill-b — $X.XX
3. skill-c — $X.XX
By model:
- Opus: $X.XX | Sonnet: $X.XX | Haiku: $X.XX
Trend: ↑/↓ X% vs prior week [omit if no prior week data]
Full report: articles/cost-report-${today}.md
Log to memory/logs/${today}.md:
## Cost Report
- Period: last N days
- Total cost: $X.XX
- Runs tracked: N
- Most expensive skill: skill-name ($X.XX)
- Cheapest skill: skill-name ($X.XX)
- Week-over-week: +/-X%
- Article: articles/cost-report-${today}.md
- Notification sent via ./notify