Five AI Spend Reports to Run Before Your Next 1:1
Five AI spend reports from your terminal
An engineering manager needs more than a monthly total. I want to know which team moved the number, whether a spike shipped anything, and whether failed requests consumed money. These five reports turn a small billing ledger into something useful before your next team check-in.
Fluxo gives developers one key and one base URL, https://api.fluxorelay.com, across providers. It works with Claude Code, Codex, Gemini CLI, and any OpenAI SDK. That simplifies access, but a shared relay still needs attribution. Record the team and workflow where each request originates.
1. Build a ledger with actual billed amounts
Use a recent sqlite3 CLI and a shell. Start with this fixture, then replace it with your own reconciled usage records. The dollar amounts below are invented examples, not model prices. Each row represents one billable request attempt; repeated attempts need separate rows.
printf '%s\n' 'day,team,model,input_tokens,output_tokens,cache_read_tokens,cache_write_tokens,billed_usd,status' '2026-06-01,platform,Claude Sonnet 5.5,20000,3000,15000,2000,0.12,ok' '2026-06-01,product,DeepSeek V4 Flash,30000,4000,0,0,0.03,ok' '2026-06-02,platform,Claude Sonnet 5.5,22000,3500,16000,2000,0.14,ok' '2026-06-02,product,DeepSeek V4 Flash,50000,6000,0,0,0.05,ok' '2026-06-03,platform,Claude Sonnet 5.5,200000,30000,0,20000,1.20,error' '2026-06-03,unknown,DeepSeek V4 Flash,10000,1000,0,0,0.01,ok' > spend.csv
Create the table once in a fresh database, then import the file. Keep dates in UTC and use the same currency throughout.
sqlite3 spend.db 'CREATE TABLE usage(day TEXT, team TEXT, model TEXT, input_tokens INTEGER, output_tokens INTEGER, cache_read_tokens INTEGER, cache_write_tokens INTEGER, billed_usd REAL, status TEXT);'
sqlite3 spend.db '.import --csv --skip 1 spend.csv usage'
Fluxo bills per real token, including cache reads and writes, with no monthly fee. Preserve those categories separately. Populate billed_usd from actual billing records; multiplying every token by one headline rate will misstate costs.
2. Rank weekly spend by team
sqlite3 -header -column spend.db "SELECT team, COUNT(*) AS attempts, ROUND(SUM(billed_usd),4) AS spend_usd FROM usage WHERE day >= '2026-06-01' AND day < '2026-06-08' GROUP BY team ORDER BY spend_usd DESC;"
This is the first report I open. Platform leads the fixture at $1.46, but that is a conversation starter, not a performance score. Ask which workloads produced useful results. Treat unknown as an attribution bug: assign an owner before the next reporting cycle.
3. Find daily spikes before projecting the month
sqlite3 -header -column spend.db "SELECT day, COUNT(*) AS attempts, ROUND(SUM(billed_usd),4) AS spend_usd FROM usage GROUP BY day ORDER BY day;"
June 3 jumps to $1.21. Check deployments, batch jobs, and agent loops for that date before extrapolating. In production, restrict this query to your reporting window. A rolling seven-day average becomes useful once you have complete days, including days with zero activity.
4. Compare model spend alongside cache activity
sqlite3 -header -column spend.db "SELECT model, COUNT(*) AS attempts, SUM(cache_read_tokens) AS cache_reads, SUM(cache_write_tokens) AS cache_writes, ROUND(SUM(billed_usd),4) AS spend_usd FROM usage GROUP BY model ORDER BY spend_usd DESC;"
Claude Sonnet 5.5 and DeepSeek V4 Flash now have separate totals. These workloads differ, so cheaper requests do not establish a better model choice. Run the same representative tasks and measure accepted results before changing routing.
Cache counts explain traffic patterns, not savings by themselves. Compare equivalent workloads and their actual charges. Also document whether your instrumentation includes cached tokens inside input_tokens; adding overlapping counters creates fictional usage.
5. Put a dollar amount on failed attempts
sqlite3 -header -column spend.db "SELECT team, status, COUNT(*) AS attempts, ROUND(SUM(billed_usd),4) AS spend_usd FROM usage WHERE status != 'ok' GROUP BY team, status ORDER BY spend_usd DESC;"
The fixture exposes a $1.20 failed attempt. Investigate its request trace: a timeout can follow substantial generation. For a real ledger, retain request identifiers and retry relationships so you can distinguish one expensive failure from repeated attempts.
Reconcile these totals against billing before sharing them. Keep credits and referral earnings separate from gross usage; Fluxo users earn a referral share when people they invite pay, which should not obscure workload costs.
If you want to try this with your own editor workflow, create a Fluxo account and start with one team's weekly ledger. Repeat the same queries each week, attach workload context, and give every unexplained spike an owner.