Why We Built a Daily Spend Dashboard for Token-Based AI Tools — The $3,600 Surprise That Changed Everything
GitHub Copilot AI Credits (~$0.04/1k tokens), Anthropic API, OpenAI API — token billing makes costs invisible until the invoice arrives. We built a unified daily tracker across all tools and cut surprise spend to zero.
Published 2026-06-10
Why We Built a Daily Spend Dashboard for Token-Based AI Tools — The $3,600 Surprise That Changed Everything
TL;DR: June 2026: Copilot AI Credits ($0.04/1k tokens) + Anthropic API + OpenAI API = three token-based bills, zero visibility mid-month. Our $380/mo predictable spend jumped to $3,600+ projected. We built a daily cron dashboard aggregating claude-code usage, gh copilot usage, and OpenAI usage API — now alert at 80% budget. Dashboard code →
The Context
Two-dev team, 120 hrs/mo AI coding across 5 codebases. Pre-June 2026: Copilot Business ($38/mo flat) + Anthropic API direct ($150–300/mo). June 1: Copilot switches to AI Credits (~$0.04/1k tokens for agentic). June 15: Claude Code credit pool launches ($100/mo for ~100 credits/day). OpenAI API unchanged (per-token). Three different token economies, three different billing cycles, zero unified view. May bill: $380. June projected (first 2 weeks actuals): $1,800 → $3,600/mo annualized.
What We Tested
| Tracking Approach | Tools Covered | Verdict | Why |
|---|---|---|---|
| Manual spreadsheet (weekly) | All three | ❌ | 1-week lag; surprises still happen |
| Individual tool dashboards | Each separately | ❌ | Context-switching; no aggregate view; different units (credits vs tokens vs $) |
| Custom cron + Slack alerts (our build) | All three unified | ✅ | Daily 5pm rollup; single $ view; alerts at 80% threshold |
| Third-party (Langfuse, Helicone) | API-only (Anthropic/OpenAI) | ❌ | Misses Copilot credits; no Claude Code CLI integration; $50+/mo |
The Pivot Point
June 8, 2026: Mid-month check. Copilot credits: 2.4M tokens used ($96) — on track for $192/mo vs $19 prior. Anthropic API: $420 (Opus-heavy debugging). OpenAI: $45 (Codex included in Plus). Total: $561 in 8 days → $2,100/mo projected. No single tool warned us. Copilot’s “300 credits included” = 7.5M tokens, but agentic sessions burn 500k–1M each. We’d exhausted included pool by June 12. Realization: Token billing is opaque by design. You need daily rollups in dollars, not tokens/credits, with a single budget threshold across all tools.
What We Use Now
Daily Spend Dashboard (.toolcrucible/token-spend-dashboard.sh, runs via cron 5pm daily):
#!/bin/bash
# Unified daily spend tracker for token-based AI tools
# Outputs: Slack alert if >80% daily budget; logs to ~/.toolcrucible/spend.log
DATE=$(date +%Y-%m-%d)
BUDGET_DAILY=120 # $120/day = ~$3,600/mo ceiling
THRESHOLD_PCT=80
# 1. Claude Code credit pool (via CLI)
CC_USAGE=$(claude-code usage --json --since yesterday 2>/dev/null || echo '{}')
CC_CREDITS=$(echo "$CC_USAGE" | jq -r '.credits_used // 0')
CC_USD=$(echo "$CC_USAGE" | jq -r '.usd_estimate // 0')
# 2. GitHub Copilot AI Credits (via gh API)
GH_USAGE=$(gh api /user/copilot/usage --jq '.[] | select(.date=="'"$DATE"'") | .tokens_used' 2>/dev/null || echo 0)
GH_USD=$(echo "scale=4; $GH_USAGE * 0.00004" | bc) # $0.04/1k tokens
# 3. OpenAI API (via usage endpoint, requires org key)
# OAI_USAGE=$(curl -s -H "Authorization: Bearer $OPENAI_KEY" \
# "https://api.openai.com/v1/usage?date=$DATE" | jq '.total_usd // 0')
OAI_USD=0 # Codex covered by ChatGPT Plus $20 flat
# Aggregate
TOTAL_USD=$(echo "scale=2; $CC_USD + $GH_USD + $OAI_USD" | bc)
THRESHOLD_USD=$(echo "scale=2; $BUDGET_DAILY * $THRESHOLD_PCT / 100" | bc)
# Alert
if (( $(echo "$TOTAL_USD > $THRESHOLD_USD" | bc -l) )); then
slack-post "#dev-alerts" "💸 AI Spend Alert: $${TOTAL_USD}/$${BUDGET_DAILY} daily (${THRESHOLD_PCT}% threshold). CC: $${CC_USD} (${CC_CREDITS} credits), GH: $${GH_USD} (${GH_USAGE} tokens)"
fi
# Log
echo "[$DATE] Total: $${TOTAL_USD} | CC: $${CC_USD} (${CC_CREDITS} cr) | GH: $${GH_USD} (${GH_USAGE} tok) | OAI: $${OAI_USD}" >> ~/.toolcrucible/spend.log
Budget protocol:
- Daily ceiling: $120 (allows bursts, caps month at ~$3,600)
- Alert at 80% ($96): Triggers “Opus flag review” + “Copilot agentic pause”
- Weekly review (Mon 9am):
cat ~/.toolcrucible/spend.log | tail -7→ adjust allocations - Hard cap: If daily > $150, auto-disable Copilot agentic + force Opus flag for remainder of day
When You’d Choose Differently
- Single-tool teams: Individual tool dashboard suffices (Claude Code
usage, Copilotgh api, OpenAI usage page). - Enterprise with negotiated flat-rate: Token tracking irrelevant if fixed contract.
- Light usage (<$100/mo total): Manual weekly check fine; dashboard overhead not worth it.
- Teams using Langfuse/Helicone for observability: Extend existing pipeline rather than build custom.
Tool Crucible Rating
| Dimension | Rating (1–5) | Notes |
|---|---|---|
| Overall | 4 | Solves real pain; DIY maintenance burden |
| Ease of Use | 3 | Requires CLI/API access for each tool; bc math fragile |
| Value | 5 | Prevented $2,000+/mo surprise; zero SaaS cost |
| Support | N/A | Internal tool; evolves with provider APIs |
This is part of our AI Coding Tool Evaluation series. See full dashboard code: Token-Based AI Spend Dashboard 2026: Unified Daily Tracking Across Copilot, Claude, OpenAI
Last reviewed 2026-06-10. See our methodology and affiliate policy.