Project 03 · AI Platform Economics
Understand platform economics.
Connect usage, payments and costs to understand business performance.
The brief
- The business question
- Calculate success rates and usage costs, prevent join fan-out, and reconcile split payments with refunds.
- What you’ll deliver
- Safe ratios, reconciled revenue and usage contribution margins.
- Skills
- Ratios · Reconciliation · Multi-table analysis
- Scope
- Intermediate level · 4 milestones · 6 tables
Available data
Request usage, fictional model rates, invoices, payments, and refunds. Rates are invented for learning, not real provider prices.
payments.invoice_id → invoices.idrefunds.invoice_id → invoices.idai_accounts
idintegerPKplantextregiontextsigned_up_attext
| # | id | plan | region | signed_up_at |
|---|---|---|---|---|
| 1 | 1 | pro | US | 2025-01-01 |
| 2 | 2 | free | US | 2025-01-02 |
| 3 | 3 | team | EU | 2025-01-02 |
| 4 | 4 | pro | IN | 2025-01-03 |
| 5 | 5 | free | EU | 2025-01-04 |
ai_requests
idintegerPKaccount_idintegermodeltextrequested_attextinput_tokensintegeroutput_tokensintegerstatustext
| # | id | account_id | model | requested_at | input_tokens | output_tokens | status |
|---|---|---|---|---|---|---|---|
| 1 | 1 | 1 | swift | 2025-01-01 10:00:00 | 1000 | 200 | success |
| 2 | 2 | 1 | reason | 2025-01-02 11:00:00 | 2000 | 600 | success |
| 3 | 3 | 2 | swift | 2025-01-02 12:00:00 | 500 | 0 | error |
| 4 | 4 | 3 | reason | 2025-01-02 13:00:00 | 8000 | 2000 | success |
| 5 | 5 | 3 | swift | 2025-01-03 14:00:00 | 4000 | 1000 | success |
model_rates
modeltextPKinput_per_millionrealoutput_per_millionreal
| # | model | input_per_million | output_per_million |
|---|---|---|---|
| 1 | swift | 1 | 4 |
| 2 | reason | 3 | 12 |
invoices
idintegerPKaccount_idintegerperiodtextbilled_amountreal
| # | id | account_id | period | billed_amount |
|---|---|---|---|---|
| 1 | 1 | 1 | 2025-01 | 20 |
| 2 | 2 | 3 | 2025-01 | 80 |
| 3 | 3 | 4 | 2025-01 | 20 |
| 4 | 4 | 6 | 2025-01 | 80 |
| 5 | 5 | 1 | 2025-02 | 20 |
payments
idintegerPKinvoice_idintegeramountreal
| # | id | invoice_id | amount |
|---|---|---|---|
| 1 | 1 | 1 | 10 |
| 2 | 2 | 1 | 10 |
| 3 | 3 | 2 | 80 |
| 4 | 4 | 3 | 15 |
| 5 | 5 | 4 | 80 |
refunds
idintegerPKinvoice_idintegeramountreal
| # | id | invoice_id | amount |
|---|---|---|---|
| 1 | 1 | 1 | 2 |
| 2 | 2 | 1 | 3 |
| 3 | 3 | 2 | 10 |
| 4 | 4 | 4 | 5 |
Milestones
Start01
Ratios, ROUND & NULLIF
Calculate safe ratios and round your results.
Not started
02Multi-grain joins without fan-out
Combine metrics at different levels without multiplying totals.
Not started
03Revenue & payment reconciliation
Reconcile revenue with payments and identify differences.
Not started
04AI usage cost & contribution margin
Compare usage revenue with costs to calculate contribution margin.
Not started