Hold first, then spend: how a call is kept within budget

How Slen holds money before a model call, what the hold does to your budgets, and how it is settled afterwards.

4 min read

Every model call of a flow starts with a hold. Before the provider is asked, Slen estimates what the call will cost and holds that amount in your budgets. After the call it settles the hold: a capture records what the call cost, and a release gives the hold back. A budget can therefore refuse a call before it has cost anything. The API calls a hold an authorization, and the console lists the holds on the Authorizations tab of Operations.

Where a hold comes from

A hold is taken by the AI Model node of a flow, for the model call of that node, and Slen settles it by itself after the call. Only a model call of a flow takes a hold.

What a hold does to a budget

A hold is the estimate of the call multiplied by a safety multiplier, so it is a little more than the call is expected to cost. A budget counts what it has captured and what it holds together: a new hold is allowed only when both and the new hold stay within the limit. Otherwise the call is refused with budget_exceeded.

Two kinds of budget count something else. A Per operation budget refuses a single hold larger than its limit, with operation_limit_exceeded. A Concurrent holds budget counts the holds that are open at once, and refuses one more with concurrency_limit_exceeded.

Open a budget on Budgets to see how the two parts add up: Captured is what calls have cost, On hold is what open holds keep, and Available is what is left of the limit.

A call made for one of your customers also holds its price in credits on their account. Customer credits explains that second hold.

How a hold ends

StatusWhat happened
authorizedThe hold stands: the call is about to be made, is under way, or has not been settled yet
capturedThe call is settled: its cost is spent, and the hold went back
overrunThe call cost more than its hold. The whole cost is spent all the same
partially_capturedThe call is settled with a usage known to be incomplete
releasedThe hold was given back: the call did not happen or failed
expiredNobody settled the hold in time, and Slen gave it back

A hold lives 15 minutes. A model call that a flow hands to the provider to run in the background keeps its hold for 30 minutes from the start of the call. That time bounds the hold and not the call: the provider goes on, and the call is settled when it ends. The service may be set up with other times. Once a minute Slen gives back the holds whose time is over.

A hold that was given back can still be captured. When a call turns out to have been paid for after its hold was released or had expired, the capture records its cost and gives nothing back a second time. The hold then leaves released or expired for the status of a settled call: captured, overrun or partially_captured. So released and expired mean that the held money went back, not that nothing will be spent: read the status once the call has ended.

Where to see the holds

On Operations, the Authorizations tab lists the holds of the project, newest first. Estimated is what the call was expected to cost, Held is the hold, and Captured is what the call cost. The Ledger tab lists the money movements the holds made. A hold and its capture are two entries there, so do not add the entries up: Ledger entries says how to read them.

Where to go next

  • Operations — the same holds over the API.

  • Estimate Cost — what a call is expected to cost, written into the trace before its hold.

  • Customer credits — the hold on the credits of your customer.

  • Policies — the rules that can refuse a call before its hold.

  • Budgets — create a budget and read how much of it is left.