upto scheme handles the case where the seller does not know the final price at request time. The client authorizes a ceiling, the seller does the work, and settlement charges the actual amount consumed (never more than the ceiling).
Wire shape
amount is the ceiling, not the final price. extra.pricing is optional but strongly recommended: it tells buyers what unit they are being metered on. See Declaring Discovery Metadata.
Settlement
After the seller finishes the work, they call/settle with an actualAmount less than or equal to amount. The facilitator settles for actualAmount and discards any remaining authorization. There is no refund step, because no funds move until settle.
actualAmount exceeds amount, /settle returns amount_exceeds_ceiling and no funds move.
When to use it
- LLM completions, transcription, translation, any pay-per-token workload.
- Data queries where response size determines cost.
- Long-running jobs where the final cost is only known when the job finishes.
When not to use it
- Simple per-request pricing. Use
exactso buyers can budget precisely.