reserve / commit / release
The atomic three-step pattern that gates AI calls under concurrency: reserve atomically holds quota with a 60s TTL; commit confirms after the call succeeds; release rolls back on error.
Last updated: 2026-05-10
Definition
reserve / commit / release is the only correct way to enforce AI quotas under load. The naive canUse → call → track has a race window where two parallel requests can both pass the check before either has tracked. reserve closes that race by making the check-and-increment atomic. The 60-second TTL means a crashed worker leaks quota for at most 60 seconds - auto-released by the server. AIPricingLab exposes this as vevee.reserve(), vevee.commit(), vevee.release().
Example
Two parallel image-render calls hit a user with 1 render left. Exactly one reserve succeeds; the other returns allowed=false. No overshoot.
Related terms
Quota
A hard or soft cap on a usage unit (tokens, renders, seconds, cents) over a period (daily, monthly, lifetime). The "100 / month" in "100 image renders / month".
GlossaryLimit group
The basic unit of quota in AIPricingLab: a label, a unit, a quota, a period, and a list of match rules that decide which events count toward it.
GlossaryComposite event
A single tracked event (one vevee.track call) that, via match rules, increments more than one limit group at the same time. The default model in AIPricingLab.