runtime
AI Platform Economics · brief

project 03 AI Platform Economics

Understand platform economics.

Connect usage, payments and costs to understand business performance.

business question
Calculate success rates and usage costs, prevent join fan-out, and reconcile split payments with refunds.
you deliver
Safe ratios, reconciled revenue and usage contribution margins. Exported as a report with your checked SQL, result evidence and written findings.
skills
Ratios · Reconciliation · Multi-table analysis
scope
4 milestones · 6 tables · intermediate
Start the first milestone

milestones

  1. 01Ratios, ROUND & NULLIFCalculate safe ratios and round your results.
  2. 02Multi-grain joins without fan-outCombine metrics at different levels without multiplying totals.
  3. 03Revenue & payment reconciliationReconcile revenue with payments and identify differences.
  4. 04AI usage cost & contribution marginCompare usage revenue with costs to calculate contribution margin.

data ModelWorks · 6 tables

Request usage, fictional model rates, invoices, payments, and refunds. Rates are invented for learning, not real provider prices.

ai_accounts4 columns · 6 rows
idinteger · keyplantextregiontextsigned_up_attext
1proUS2025-01-01
2freeUS2025-01-02
3teamEU2025-01-02
4proIN2025-01-03
5freeEU2025-01-04

showing 5 of 6 rows

ai_requests7 columns · 12 rows
idinteger · keyaccount_idintegermodeltextrequested_attextinput_tokensintegeroutput_tokensintegerstatustext
11swift2025-01-01 10:00:001000200success
21reason2025-01-02 11:00:002000600success
32swift2025-01-02 12:00:005000error
43reason2025-01-02 13:00:0080002000success
53swift2025-01-03 14:00:0040001000success

showing 5 of 12 rows

model_rates3 columns · 2 rows
modeltext · keyinput_per_millionrealoutput_per_millionreal
swift14
reason312

all 2 rows

invoices4 columns · 6 rows
idinteger · keyaccount_idintegerperiodtextbilled_amountreal
112025-0120
232025-0180
342025-0120
462025-0180
512025-0220

showing 5 of 6 rows

payments3 columns · 7 rows
idinteger · keyinvoice_idintegeramountreal
1110
2110
3280
4315
5480

showing 5 of 7 rows

refunds3 columns · 4 rows
idinteger · keyinvoice_idintegeramountreal
112
213
3210
445

all 4 rows

AI Platform Economics — SQL project · Runtime