Skip to content

Budget & Cost

Every LLM call is logged with its dollar cost. The budget guard enforces the daily soft pause (\(20) and the monthly hard cap (\)100).

Design references: spec_v3.md §4.3 Structured Invocation Logging, CLAUDE.md budget section.

Where Costs Live

Useful Queries

-- Today
SELECT task_type, model, COUNT(*) AS calls, ROUND(SUM(cost_usd), 4) AS usd
FROM invocation_log
WHERE date(ts) = date('now')
GROUP BY 1, 2 ORDER BY usd DESC;

-- Last 14 days by day
SELECT date(ts) AS d, ROUND(SUM(cost_usd), 4) AS usd, COUNT(*) AS calls
FROM invocation_log
GROUP BY 1 ORDER BY 1 DESC LIMIT 14;

-- Model leaderboard this month
SELECT model, COUNT(*) AS calls, ROUND(SUM(cost_usd), 4) AS usd
FROM invocation_log
WHERE ts >= datetime('now', 'start of month')
GROUP BY 1 ORDER BY usd DESC;

When the Budget Trips

Jump to Workflow → Handle Budget Breach.