Q&A-3Define useful unit economics for an API product.
Answer
The 90-second answer. A useful unit is the smallest thing a customer buys or does that also moves your cost. For most API products that is a successful request or a completed workflow, not a raw request, and not an active tenant. Two tests decide it: does the unit's count correlate with the resources you actually pay for, and can a decision change because of the number? Fail either test and you have a dashboard metric, not a unit economic. The definition also names its window (calendar month, UTC), its exclusions (health checks, internal traffic, retries counted once), and one owner who can change it.
Assumptions I'd state up front: multi-tenant API, per-tenant metering already in place, shared infrastructure (compute, database, egress) that no invoice line attributes cleanly, and a pricing decision on the table this quarter.
Why successful, not raw. Failed requests are cheap (they fail fast, often before touching the database) so counting them makes a broken tenant look efficient. Client retries inflate the count without adding value. Cost per successful request is the only version that moves the right way when reliability changes.
Worked allocation (hypothetical month). Three tenants, $30,000 shared pool, CPU-seconds as the cost driver.
| tenant | requests | CPU-s | CPU share | cost by CPU-s | cost by request count |
|---|---|---|---|---|---|
| A | 10.0M | 80,000 | 39.0% | $11,707 | $23,077 |
| B | 2.0M | 120,000 | 58.5% | $17,561 | $4,615 |
| C | 1.0M | 5,000 | 2.4% | $732 | $2,308 |
Per request: A $0.00117, B $0.00878, C $0.00073. Allocating by request count gives every tenant $0.00231: identical, and wrong by 7.5x for B. B's requests cost 60 ms of CPU each against A's 8 ms. That is the whole argument for choosing the driver that consumes the resource, not the one that is easy to count.
The cheaper-but-degraded trap. Take a tenant at 1M requests, a success costing $0.001 and a failure $0.0002. At a 1% error rate: 990,000 successes, cost $992, so $0.000992 per request and $0.001002 per success. At 12%: 880,000 successes, cost $904. $0.000904 per request (−8.9%) but $0.001027 per success (+2.5%). A dashboard showing the first number will let you ship the regression.
Failure modes and how you catch them.
- Unit decoupled from cost: per-seat pricing on a compute-heavy product. Detect by regressing monthly cost on unit count per tenant; if the top decile of cost-per-unit is more than 5x the median, the average is fiction.
- Allocation driver mismatch: charging by requests when CPU is the driver. Detect by rank-correlating the driver against measured resource consumption; below roughly 0.8, re-pick the driver.
- Averaging over the tail: one tenant at 40% of the pool disappears into a mean. Detect by computing cost per unit by decile, not mean.
- Degradation hidden by cost: detect by alerting when cost per successful unit and error rate move in opposite directions for two consecutive weeks.
What would change the answer. If compute is under 5% of COGS and the product sells per seat, the seat is the unit and request-level cost is diagnostic only. If one tenant exceeds about 20% of the shared pool, per-tenant allocation stops being an average and becomes a negotiation: model that tenant directly.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.