Webhooks allow you to keep downstream systems in sync by streaming real-time credit events. Each webhook payload provides enough context to understand what happened and to reconcile it against your own systems.

Events

Grant-level events

  • credits.granted — A new credits grant (block) was created.
  • credits.grant.updated — An existing credits grant changed (e.g., amount, dates, cost).
  • credits.grant.usage_low — A specific grant crossed the configured low-credits threshold.
  • credits.grant.depleted — A specific grant’s balance reached zero.
  • credits.expired — A grant reached its expiration time.

Balance-level events

  • credits.balance.usage_low — Aggregate balance (per customer/resource/currency) fell below the configured threshold.
  • credits.balance.depleted — Aggregate balance (per customer/resource/currency) reached zero.

Credit consumption

FieldData type (typical)Notes
environment_idstring/uuidEnvironment identifier
customer_idstring/uuidCustomer identifier
resource_idstring/uuidResource identifier
event_idstring/uuidUsage event identifier
feature_idstring/uuidMetered feature identifier
partial_costdecimalPortion of cost attributed to a specific grant/block
total_costdecimalTotal cost of the event across all grants/blocks
credit_grant_idstring/uuidReference to the credit grant used
credit_currency_idstring/uuidCredit currency identifier
consumption_timestamptimestampWhen consumption was recorded
event_timestamptimestampWhen the underlying event occurred
created_attimestampIngestion/row creation time

Credit grants

FieldData type (typical)Notes
idstring/uuidPrimary identifier of the credit grant
created_attimestampRow creation time
updated_attimestampLast update time
account_idstring/uuidAccount identifier
environment_idstring/uuidEnvironment identifier
display_namestringHuman-readable name/label
amountdecimalGranted credits amount
consumed_amountdecimalCredits consumed from this grant
grant_typestring/enumGrant category/type (e.g., promo, purchase)
priorityintegerConsumption priority among grants
effective_attimestampWhen the grant becomes usable
expire_attimestampWhen the grant expires
additional_meta_datajsonArbitrary metadata
commentstringOptional note/comment
customer_idstring/uuidCustomer identifier
customer_ref_idstringExternal/customer reference ID
resource_idstring/uuidResource identifier
resource_ref_idstringExternal/resource reference ID
custom_currency_idstring/uuidReference to custom currency (if applicable)
currency_idstring/uuidReference to base currency
cost_amountdecimalMonetary cost amount (if tracked)
cost_currencystringISO currency code for cost_amount
credit_grant_idstring/uuidGrant identifier (if separate from id)

Custom currencies

FieldData type (typical)Notes
idstring/uuidPrimary identifier
created_attimestampRow creation time
updated_attimestampLast update time
account_idstring/uuidAccount identifier
environment_idstring/uuidEnvironment identifier
display_namestringCurrency display name
currency_idstring/uuidBase currency reference
symbolstringDisplay symbol (e.g., “AIT”)
descriptionstringOptional description
additional_meta_datajsonArbitrary metadata
units_singularstringSingular unit label (e.g., “AI Token”)
units_pluralstringPlural unit label (e.g., “AI Tokens”)