Skip to content
Portrait of Lucian Andrei Negoita Lucian
ES
Things I made
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
  1. Coding agent Claude Code, Cursor or any compatible client.
  2. Reserve Before forwarding, it reserves the maximum possible cost against the budget.
  3. Provider The SSE stream flows unbuffered. Real cost comes from the provider's usage field.
  4. 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
Project view: peaje
Next project Real-time collaborative editor Thesis · Nominated for highest honours

Curious about the code?