Analytics schema reference
This page documents all 15 views available to the
Analytics API. You can also fetch this live for your account from
GET /schema.
Conventions:
- Monetary columns are cents. Divide by 100 for display. Most are integers;
fact_cost.cost_amountis fractional cents (Decimal). UInt64/Int64values are returned as JSON strings (precision-safe); parse client-side.Nullable(...)columns can benull.- Facts join to dimensions on the
*_idcolumns called out below.
How the tables join
Common join keys:
Dimensions
dim_customer
One row per customer. Join id to any fact’s customer_id. Supports hierarchy
rollups (parent_customer_id), segmentation (annual_revenue, status,
churn_date), and geography (country/state/city).
dim_product
One row per product (also called an agent). Products are AI agents/services
or prepaid credit bundles. Join id to any fact’s product_id.
dim_plan
A plan is a pricing configuration within a plan group. Plans form an
upgrade/downgrade chain via has_next_plan/has_prev_plan. Join from
fact_order.plan_id.
dim_credits_currency
Defines the types of credits your organization uses. Join from
fact_credit_transaction.credits_currency_id or dim_product.credits_currency_id.
dim_organization
Your organization. Typically one row.
Usage
fact_signal
One row per signal (event). This is the core usage metric. COUNT over time, group by
signal_name, customer_id, or product_id. Join trace_id to fact_cost
for cost-per-signal, or signal_id to fact_delivered_value for value
delivered.
Cost
fact_cost
One row per AI/LLM call. SUM(cost_amount) for total spend; group by
vendor, model, customer_id, or product_id. Includes token usage and
latency.
cost_amount is exact fractional cents — a single AI call usually costs a
fraction of a cent, so values look like 3.71 (= $0.0371). Sums match the
Cost Explorer in the Paid UI.
Delivered value
fact_delivered_value
The business value delivered per signal, by value type. Join signal_id to
fact_signal, or customer_id/product_id to dimensions.
Rows can be denominated in different currencies — organizations using
value models can configure non-USD currencies, and delivered_value_cents
is always in that row’s delivered_value_currency. Never sum
delivered_value_cents across currencies; group by
delivered_value_currency (or filter to one currency) first.
Revenue & billing
fact_order
Contracts and subscriptions. One row per order. Join customer_id to
dim_customer, plan_id to dim_plan. Compare total_billed_amount to
total_amount for billing progress.
fact_order_line
Product-level order line items link products to revenue. SUM(total_amount)
by product_id for revenue-by-product. Filter effective_until IS NULL for
current lines only.
fact_invoice
One row per invoice. SUM(total_incl_tax) for revenue; filter status = 'posted'
for finalized invoices. Use due_date + payment_status for aging analysis.
fact_invoice_line
One row per line on an invoice. Join order_line_id → fact_order_line.id →
dim_product.id to break invoiced revenue down by product.
fact_payment
One row per payment received. SUM(amount) for cash collected; filter
payment_status = 'posted' for confirmed payments. Join invoice_id to
fact_invoice.id for reconciliation.
fact_usage_summary
Billed usage per signal per billing period links usage to revenue.
SUM(subtotal) by signal_name to see which signals drive revenue. Compare
signal_count to included_quantity to see overage.
Credits
fact_credit_transaction
One row per credit grant, spend, or pending grant. Filter type = 'SPEND' for
consumption; group by signal_name or product_id for usage breakdowns. Join
credits_currency_id to dim_credits_currency.