Early access, with metered billing.
How it works
1
Hold before the work
201with the hold (hold_…).amountis what it takes from the credit. Go ahead.402 insufficient_credit, withavailableandneeded. Nothing is reserved. Stop here.409 spending_cap_reachedwhen the usage would go past a spending cap that stops billing.
2
Do the work
3
Commit what was actually used
POST /credit-holds/{id}/release instead.Idempotency-Key.
Details
- Expiry.
expiresInis in seconds: 3,600 by default, 7 days at most. A hold neither committed nor released stops counting when it expires, and you getcredit_hold.updated. Committing it afterwards is refused with409 hold_expired: send the usage as a meter event instead. - Which meters. Holds work on meters that
sumtheir values, billed by one of the customer’s active subscriptions. When those meters bill in two currencies, passcurrency. - On the balance. Open holds show as
heldon the credit balance and come offprojectedAvailable. - Scopes. Holds use the
creditsscope. Committing records usage without needingusage:write.