Attribution
Attribution is how a billing system decides how much of a confirmed result is credited to an AI agent, expressed as the billing unit that gets multiplied by the price.
Attribution is how a billing system decides how much of a confirmed result is credited to the agent. The billable condition answers whether an outcome happened. Attribution answers how much of it to bill. The answer is a number, the billing unit, and the invoice line amount is the price per unit multiplied by that number.
How it works
Events carry an optional numeric quantity. In witn this is the reserved properties.attribution key. When an outcome confirms, the attribution method on the agent contract picks the billing unit from those quantities:
last: the most recent quantity, for running totals that update over time.first: the earliest quantity, for amounts locked in at the start.sum: all quantities added up, for partial deliveries that accumulate.minandmax: the smallest or largest observation, for floors and ceilings.
If no event carries a quantity, the billing unit is 1. A flat per-outcome agent needs no attribution at all.
Why it matters
Separating attribution from the billable condition keeps one contract able to express both "charge when the ticket resolves" and "charge for the kilograms actually delivered". The condition gates the charge. Attribution sizes it. Neither interferes with the other, so a metered quantity can grow while the condition is still being evaluated, and a reversal inside the settlement period still cancels the charge regardless of the accumulated quantity.
Related
- Agent attribution in the docs, including all five methods
- Billable condition
- Outcome-based pricing