In progress
spent + held ≤ budget, at every instant
Sits between coding agents and LLM providers, records the exact cost of every request and enforces hard per-key budgets. One Go binary, zero dependencies, backed by SQLite.
How it works
two-phase reserve and settle- Coding agent Claude Code, Cursor or any compatible client.
- Reserve Before forwarding, it reserves the maximum possible cost against the budget.
- Provider The SSE stream flows unbuffered. Real cost comes from the provider's usage field.
- Settle Settles exactly once over a crash-safe journal.
Why I built it
Teams adopting coding agents find out their spend on the invoice, a month late. Billing APIs lag 24 to 48 hours, and gateways that track cost do it without guarantees exactly where the money is: between admission and settlement of concurrent requests.
What it taught me
- Money is stored as integers (micro-USD), never floating point.
- I write the ledger core by hand. It is the part I need to defend line by line.
Built with
- Go
- SQLite
- SSE
- Two-phase accounting