Telemetry
Interactive SaaS SQL Lab

AI economics · Advanced

Estimate AI gross-margin inputs by account

How does accepted-output cost compare with successfully collected revenue for each account?

Join account-level model cost and accepted outcomes to billing results without treating analytical estimates as invoice truth.

Reviewed by the Telemetry product team on . Read-only SQL, connected-table grain, deterministic result, visualization, and interpretation boundaries. Review standards and ownership

Runs against one versioned 15-table dataset

Edit and execute the query locally in your browser, then download the same synthetic schema and rows for DuckDB.

AI economicsAdvanced

Estimate AI gross-margin inputs by account

How does accepted-output cost compare with successfully collected revenue for each account?

Join account-level model cost and accepted outcomes to billing results without treating analytical estimates as invoice truth.

The dataset and query remain in this browser.

Published expected result

Estimated AI cost by account

account_idplancollected_usdestimated_ai_cost_usdaccepted_outputscost_per_accepted_output_usdai_cost_pct_of_collected
acct_deltagrowth1,8000.07930.02630.0044
acct_acmegrowth2,4000.0520.0250.0021
acct_beaconbusiness1,2000.02110.0210.0018
acct_emberstarter00.0060
acct_cinderstarter00.0050
acct_fjordfree00.00410.004

How to read the query

  • Model usage is reduced to one account row before the billing join.
  • Cost per accepted output uses a reviewed product outcome rather than provider success alone.
  • Accounts without collected revenue remain visible with a null cost percentage instead of an invented infinite margin.

Decisions the SQL cannot make

  1. 1Use versioned provider prices and reconcile estimates with provider invoices.
  2. 2Define accepted outcomes per feature and guard against missing feedback.
  3. 3Include non-model infrastructure and labor costs before claiming gross margin.

Continue from this lesson