OptionalestimateOptional typical total for one call (µ$), for display + tests when usage isn't yet known.
OptionaltriggerWHEN/WHAT fires this cost (C024; default "synchronous"). STATIC — decouples accrual-time from the declaring op.
Optionaltriggerthe by-name handle (C009) of the webhook/callback/op whose firing accrues this cost (for a non-sync trigger).
OptionalattributionWHO is charged when there is no live session (runtime strategy; the expression never enters the static matcher).
Optionalidempotencya runtime-expression yielding a stable id to DEDUPE at-least-once delivery (e.g. "{$event.id}") — prevents double-counting a cost charged on both the receipt op and the triggered op. Runtime-only.
OptionalreconciliationHow the amount RECONCILES with the third party's actual charge (C026; default "declared-estimate"). A declared estimate is a guess; "payload-reconciled" reads the ACTUAL charged amount from the event at runtime (the real invoice line — proration/tax/refund included), so the recorded cost is authoritative, not an approximation.
Optionalamountfor "payload-reconciled": a runtime-expression yielding the ACTUAL amount (e.g. "{$event.body#/amount}").
Runtime-only — never the static matcher. Interpreted in amountUnit.
Optionalamountthe unit amountExpression yields (default "micro-usd"). "cents" (Stripe) → ×10_000; "usd" → ×1_000_000.
OptionalsettlementHOW the operator RECOVERS this cost (C044). The fifth orthogonal axis — basis=how-meters · trigger=when-fires · attribution=who-pays · reconciliation=declared-vs-actual · settlement=how-recovered.
@suluk/cost— cost as a contract facet + runtime metering. You can't price a user without knowing what they cost you. So: declare per-operation cost (incl. third-party usage) on the contract — it bubbles into the v4 doc, Scalar, and the audit; meter the ACTUAL cost per request at runtime, traced from the frontend action down to each third party; and read the raw per-user picture from the ledger. We display the data as it is and let you build pricing on top (Stripe via @suluk/stripe). CANDIDATE tooling — NOT official OAS.