Skip to main content

Metering and Billing

Every AI call Reveal makes spends tokens on the developer's provider account. Reveal gives the developer two hooks to track and control that spend. Both see AI calls from every feature and provider. Usage tracking records every call, including background work Reveal performs on its own; the quota gate skips that background work by default.

 Usage trackingQuotas and billing
PurposeObservability: record what each call used.Policy: decide whether a call may run, and charge for it.
HookUsage sink (IAIUsageSink, or the usageSink callback)Quota gate (IAIQuotaGate, or the quotaGate and quotaSettle callbacks)
RunsAfter each call, outside the requestBefore each call, and after it inside the request
DeliveryBest effortEvery call that passed the check
User dataThe user's IDThe full user context, including per-request claims
Can block callsNoYes, with a structured error for the client
Without setupUsage is logged and counted in metricsNo gate: every call is allowed

Use usage tracking to see where tokens go: per user, feature, profile, or model. Use the quota gate to enforce plans and budgets and to debit actual usage against a balance. The developer can use either one or both.