with one click
spend-monitor
// Daily API spend watchdog — checks running weekly cost against a budget cap, alerts when approaching or exceeding it
// Daily API spend watchdog — checks running weekly cost against a budget cap, alerts when approaching or exceeding it
Daily fleet-wide scorecard across this instance and every managed instance in memory/instances.json — runs, tokens (OpenRouter shape), est. cost, skills, and reliability, with day-over-day deltas and alerts
Weekly escalation audit — parses the follow-up / open-loop section of MEMORY.md plus the issue tracker, computes item ages, and alerts on items hitting urgency thresholds so nothing rots unattended
Weekly tracker for the Model Context Protocol (MCP) ecosystem — new server implementations, adoption velocity, npm/GitHub signals, and protocol evolution. Thesis check — is MCP becoming the default tool-call rail for agents?
Daily cross-skill signal detector — finds entities or themes surfaced independently by 3+ different skill categories in the last 48h and surfaces them as high-confidence write opportunities
Audit any contract on Base — verification, proxy/upgradeability, ownership/admin roles, and mint/freeze/pause/drain powers as a live capability matrix. Keyless via Etherscan v2 + Base RPC.
Map every contract deployed by an address on Base, link reused patterns, and surface serial-rug signals. Keyless via Etherscan v2 + Base RPC.
| name | Spend Monitor |
| description | Daily API spend watchdog — checks running weekly cost against a budget cap, alerts when approaching or exceeding it |
| var | |
| tags | ["meta"] |
| schedule | 0 12 * * * |
${var} — Budget cap override in dollars (e.g. "250"). If empty, uses the
WEEKLY_BUDGET_CAPenv var, else defaults to $200.
Today is ${today}. Monitor this instance's running API spend for the current week and alert if costs are spiking. This is the daily complement to cost-report (weekly retrospective): cost-report explains where spend went; spend-monitor catches runaway spend before the week is over.
If soul/SOUL.md and soul/STYLE.md exist and are populated, read them and match the operator's voice in the notification. Otherwise use a clear, direct, neutral tone — terse, no hedging.
| Variable | Required | Description |
|---|---|---|
| WEEKLY_BUDGET_CAP | No | Weekly spend cap in USD (default: 200) |
First read aeon.yml and find the gateway.provider value. Use the matching table. Keep these rates in sync with skills/cost-report — they are the same tables.
| Model | Input | Output | Cache Read | Cache Write |
|---|---|---|---|---|
| claude-opus-4-7 | $15.00 | $75.00 | $1.50 | $18.75 |
| claude-sonnet-4-6 | $3.00 | $15.00 | $0.30 | $3.75 |
| claude-haiku-4-5-20251001 | $0.80 | $4.00 | $0.08 | $1.00 |
| 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 |
For Bankr, treat cache read/write as zero cost. For any unlisted model, default to Opus pricing (conservative estimate).
Determine the budget cap.
${var} is a number, use it as the cap.WEEKLY_BUDGET_CAP env var is set, use that.Determine the current week window.
WEEK_START = most recent Monday on or before today.WEEK_END = today (inclusive).Read token usage data.
memory/token-usage.csvdate,skill,model,input_tokens,output_tokens,cache_read,cache_creationSPEND_MONITOR_SKIP: no token-usage.csv and stop — do NOT send any notification.date >= WEEK_START and date <= WEEK_END.SPEND_MONITOR_SKIP: no runs this week yet and stop.Compute costs for each row.
aeon.yml for gateway.provider (direct or bankr).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 (0 if bankr)
cache_write_cost = cache_creation/ 1,000,000 × rate_cache_write (0 if bankr)
row_cost = input_cost + output_cost + cache_read_cost + cache_write_cost
Aggregate.
Classify status.
Decide whether to notify.
./notify.Format notification (for WATCH / WARN / ALERT):
Write the message to a temp file .pending-notify-temp/spend-monitor-${today}.md (create the dir if needed) then send with ./notify -f.
*Spend Monitor — ${today}*
Week: $X.XX / $CAP.XX cap (X% used, Xd elapsed)
Projected: $X.XX by Sunday (X%)
Status: WATCH / WARN / ALERT
Top drivers:
1. skill-a — $X.XX
2. skill-b — $X.XX
3. skill-c — $X.XX
[If ALERT]: Pause candidates: <the top 2-3 cost-driver skills this week, by name>
log: memory/logs/${today}.md
The "Pause candidates" line is derived, not hardcoded — name the heaviest cost-driver skills from the per-skill totals in step 5. Keep it tight, no corporate fluff.
Log to memory/logs/${today}.md:
## Spend Monitor
- Week: $X.XX / $Y cap (X%) — STATUS
- Projected: $X.XX by Sunday
- Days elapsed: N
- Top driver: skill-name ($X.XX)
- Notification: sent / skipped (OK)
- SPEND_MONITOR_OK
This skill only reads local files (memory/token-usage.csv, aeon.yml) — no external network calls needed. No prefetch/postprocess wrapper required. The only outbound call is ./notify, which is already sandbox-safe.
skills/cost-report. If you update one, update both.