Calculate LLM cost per accepted output
Which plans consume the most model spend, and how much does each accepted output cost?
Join normalized provider usage to account context, then compare raw request cost with a reviewed product outcome.
Expected result
Estimated LLM cost by plan
| plan | requests | automatic_retries | estimated_cost_usd | accepted_outputs | cost_per_accepted_output_usd |
|---|---|---|---|---|---|
| growth | 6 | 1 | 0.129 | 5 | 0.0258 |
| business | 2 | 0 | 0.021 | 1 | 0.021 |
| starter | 2 | 0 | 0.011 | 0 | — |
| free | 1 | 0 | 0.004 | 1 | 0.004 |
How to read the query
- The input events use the same usage fields for every provider, so the query can compare them.
- Acceptance is a product outcome, not a property of the provider response itself.
- NULLIF leaves cost per accepted output undefined when a segment has no accepted outputs.
How to interpret the results
- 1Keep current model pricing in versioned configuration and retain the pricing version on each event.
- 2Separate automatic retries from deliberate user regenerations.
- 3Use invoices to confirm charges. The event field contains an estimate.
Related lessons
Keep the result
Run this query on your own events
Create a free workspace only when you are ready to save the query, connect real events, and monitor the result. No credit card is required.