Credits for Laravel
Features
- Holds for AI calls: reserve an estimate before the call, settle what it cost after; a dead worker leaks nothing.
- Credits that expire, spent in order: every grant is a lot with its own expiry, taken soonest-expiring first.
- Meters with exact fractions: 400 tokens at 1 credit per 1,000 charge nothing yet; the remainder carries to the next call.
- Plan allowances without a cron: granted once per period on first use, however many workers race; anchored or calendar.
- Idempotency keys: a retried job or webhook never charges twice; a reused key for a different request is an error.
- Refunds and transfers: credits go back to the lots they came from, or move to another wallet, keeping their expiry.
- Upgrades, rollover, rates per plan: a bigger plan grants the difference at once; quotes before charging.
- Reporting from the ledger: what expires when, the balance at any moment, credits spent and usage per period.
- Books that balance: append-only lines, row locks, and
credits:auditto prove every cached number from the rows under it.
Integer credits throughout (pick your scale: 1 credit = 1/1000 of a cent works), no floats, SQLite, MySQL, MariaDB and Postgres.