Transactions & Reservations

Learn when to use direct transactions versus reservations for credit operations.

Transactions

Use transactions for immediate, one-off credit adjustments. This includes manual credits or debits — for example, refunding credits to a customer, applying a promotional bonus, or charging for a fixed-cost operation where the amount is known upfront.

Reservations

Use reservations when you need to pre-authorize credits before knowing the final cost. This is the recommended pattern for LLM calls: reserve an estimated amount before the call, then confirm with the actual cost (or cancel if the call fails). This prevents over-spending while allowing flexibility.

Reservation lifecycle

  1. Reserve — Hold credits before an operation (e.g. before an LLM call)
  2. Confirm — Finalize the reservation with the actual amount used
  3. Cancel — Release the held credits if the operation fails or is abandoned

Unconfirmed reservations can be configured to auto-expire after a timeout period to prevent credits from being held indefinitely.

Configuration

Reservations support configurable timeouts, automatic expiration, and metadata for tracking. You can attach external reference IDs to link reservations back to specific operations in your system.