The budget guard

Two ceilings — one per cron pass, one per month — are checked before every model call and every image, and the meter reads off the same ledger the record writes to.

What it is

A monthly cap and a per-run cap, both in cents, both editable from the panel. Before a post is written or an image started, canSpend() adds the estimate to what the run and the month have already spent and refuses if either ceiling would break. After the call, the true cost from real token usage is recorded. The month's spend is summed from the ledger rows themselves.

Also called: AI spend cap · monthly budget · cost control · run budget

See it
The budget guard
CustomerBuildingAmountStatus
Gideon AltHobby Shop$6,710Paid
Ronan PetschRiding Arena$11,270Approved
Gideon Alt30×40 Garage$16,400Paid
Ivy BrubakerBarndominium$11,080Open
Sutter Kline40×64 Shop$7,090Approved
The spend card: dollars spent this month, the cap beneath it, and the progress bar that turns red past 85%. Sample data — no customer information appears here.
How it works
  1. 1spentThisMonth() sums cost_cents from seo_actions since the start of the UTC month.
  2. 2canSpend(cents) checks the run ceiling first, then the month ceiling, and returns a plain-English reason when it refuses.
  3. 3The writer estimates about 30 cents per post and an image about 8 cents; refusal is recorded as a skipped action with the reason.
  4. 4After the model call, real input and output token counts produce the actual cost, which is what lands in the ledger.
  5. 5The panel shows spend against cap as a bar that turns red past 85%.
Why we built it

The design note explains why an estimate is checked but the truth is recorded: "Callers ask can(estimate) BEFORE the expensive call and spend(actual) after — an estimate that turns out low still gets recorded truthfully, it just can't be prevented retroactively. That is the correct trade: the ledger stays honest, and the next check sees the real number." And the meter is deliberately not a separate counter: "The spend meter reads back the SAME ledger rows the record writes, so the limit and the audit trail can never disagree with each other."

The problem
  • Automated spend was unbounded and only visible on the invoice.
  • A separate spend counter can drift from the actual record of work.
Sound familiar?
What you get
Work stops at the cap instead of overspending
The spend meter and the audit trail are the same rows
Refusals are recorded with the reason, so nothing fails silently

See it on your own jobs

Twenty minutes, your numbers, no slide deck. We’ll build one of your real buildings in front of you and send you the estimate link at the end — yours to keep either way.

or keep browsing features →