FlockTab
Back to all articles

Reserve, commit, refund: the lifecycle behind a tab

Follow one metered call from an admission estimate to a final ledger outcome, including the uncertain cases.

FlockTabEngineering3 min read

A model request has a period during which it can incur cost but its final usage is not known. A useful ledger represents that period explicitly. Otherwise the dashboard either understates outstanding work or treats an estimate as if it were already final.

FlockTab's metered path uses a reservation before the provider request and a later commit or refund to resolve it.

Reserve the room before forwarding

The reservation checks tab state, available budget, and applicable policy. It places an estimate in the outstanding balance before the upstream call is allowed. Concurrent work therefore sees that room as occupied rather than available to spend again.

An illustrative tab has a $5 cap and $3 settled. A 50-cent reservation leaves $1.50 available for other admissions. The estimate is an operating hold, not an additional bill or a prepaid purchase of tokens. The customer still pays the provider under their own arrangement.

Commit the observed result

When supported usage is available, settlement records the measured amount and releases the reservation. If the illustrative call accounts for 30 cents, the tab now has $3.30 settled and no hold for that request. Its unused 20 cents becomes available again.

A meter should preserve the final result even if the original estimate was too low. FlockTab's ledger can close a tab after settlement leaves it over its cap. That makes conservative estimation and supported output bounds part of the enforcement story; a reserve-time check alone cannot make an underestimated provider response cost less.

Refund a known provider error

FlockTab refunds the hold for a known non-successful provider response. An uncertain successful response is different. If the provider accepted work but usable usage was not obtained, treating the call as free could erase real consumption. The proxy's documented fallback can settle at the reserved estimate.

Keep the outcome understandable in logs: measured settlement, estimated settlement, and a refunded provider error have different evidential strength. A user investigating a discrepancy should be able to tell which path produced the amount.

Make finalization happen once

Retries can repeat a commit or refund request after a network failure. The ledger must check that the reservation is still pending before changing balances. Once it has reached a final state, another finalization should not apply the money operation again.

A useful test matrix includes success with usage, a known provider error, a broken successful stream, and duplicate finalization. Check both the reservation state and the tab balance. The central promise is an explainable transition from admitted work to one accounted outcome, with uncertainty handled explicitly rather than silently written off.

Sources checked 23 September 2026. Numerical scenarios are illustrative unless explicitly identified as provider data. Vendor limits and interfaces can change; consult the linked documentation for current details.