AIBillingSaaS
The AI Billing Data Model You Actually Need

Vijay Gorfad
August 23, 2025
8 min read
The minimal tables
- Customers, Accounts, Subscriptions
- Agents & Signals (events you meter)
- UsageEvents (immutable, versioned)
- Costs (vendor, rate, allocation)
- PriceVersions (effective_at, rules)
- Invoices & LineItems (ties to usage + outcomes)
Event example (JSON)
json
{
"customer_id": "acme",
"agent_id": "outbound_v2",
"signal": "meeting_held",
"quantity": 1,
"metadata": {"duration_min": 27, "attendee_role": "VP Sales"},
"occurred_at": "2025-08-28T09:15:00Z",
"price_version": "v1.3"
}Cost example (allocation)
- LLM tokens → workflow step → customer.
- RAG queries/minutes → feature → customer.
- Storage/egress → monthly proration → customer.
Rev-rec pointers
- Usage lines: recognize on consumption.
- Outcome lines: recognize on completion/acceptance.
- Commitments: recognize over term; overages as consumed.
Why this model future-proofs you
You can switch value metrics, add outcomes, or re-price without data migrations—just add a new PriceVersion and keep the event log immutable.
Want the full schema (SQL) as a downloadable? Ping us—we'll share the UnitPay starter pack.
Ready to transform your AI billing?
See how UnitPay can help you monetize your AI products with precision.