Skip to content
Telemetry
AI and LLM SQL recipe

Measure accepted AI outputs per dollar

Connect model spend to accepted, saved, or otherwise useful product outcomes.

Intermediatellm_requestsReviewed 2026-07-27Tested with Apache DataFusion 45.2.0

Reviewed by the Telemetry product team on . We checked the SQL syntax, required event fields, sample results, and limits on using the query. Who reviews this page

Question answered

Which model and feature combination produces the most accepted outputs per dollar?

A cheap model can still waste money when users discard its output. Compare accepted-output rate and spend to calculate the cost of a result users accept.

Event schema

Fields the query expects

FieldTypeWhy it exists
timestamp_utcTimestampWhen the workflow outcome was recorded.
featureUtf8Stable product feature.
modelUtf8Provider model identifier.
acceptedBooleanWhether the user accepted or saved the result.
estimated_cost_usdFloat64Cost of the model request.
DataFusion SQL

Copy the query

sql
SELECT
  feature,
  model,
  COUNT(*) AS completed_outputs,
  SUM(CASE WHEN accepted = true THEN 1 ELSE 0 END) AS accepted_outputs,
  100.0 * SUM(CASE WHEN accepted = true THEN 1 ELSE 0 END)
    / NULLIF(COUNT(*), 0) AS acceptance_rate_pct,
  SUM(estimated_cost_usd) AS cost_usd,
  SUM(CASE WHEN accepted = true THEN 1 ELSE 0 END)
    / NULLIF(SUM(estimated_cost_usd), 0) AS accepted_outputs_per_dollar
FROM llm_requests
WHERE timestamp_utc >= now() - INTERVAL '30 days'
GROUP BY feature, model
HAVING COUNT(*) >= 50
ORDER BY accepted_outputs_per_dollar DESC;

This read-only query is planned and executed against an empty typed table with Apache DataFusion 45.2.0. We review the synthetic sample output separately. Check field types, thresholds, and counting rules against your own data. Read the testing methodology.

Query result

Accepted outputs per dollar

The largest model wins on acceptance rate but loses on cost-adjusted throughput.

featuremodelcompleted_outputsaccepted_outputsacceptance_rate_pctcost_usdaccepted_outputs_per_dollar
support_draftfast-small4,2003,108746349.33
document_summarybalanced-medium1,7001,3948278.217.83
research_reportreasoning-large51046490.982152.16

Synthetic example output. Run the query against your own event schema and thresholds before using it for operational decisions.

Accepted outputs per dollar: static chart of synthetic accepted_outputs_per_dollar values from the Measure accepted AI outputs per dollar example result
Download this SVG chart of the sample results for an article, runbook, or design review. Please credit Telemetry.

Reproduce the example

Download the sample data

The JSON bundle includes the event schema with field types, illustrative input rows, exact SQL, expected output, review notes, and engine version. The CSV contains the displayed result.

How the SQL works

  1. 1Acceptance rate measures quality only among completed outputs. Accepted outputs per dollar adds economic efficiency.
  2. 2The minimum sample threshold avoids declaring a winner from a handful of requests.
  3. 3Define acceptance using product behavior, such as whether someone saved, sent, applied, or copied the result. A model-quality label does not measure that behavior.

Edge cases to check

  • A discarded output may still be useful if it informed a later action; choose the outcome signal with product context.
  • Compare models within the same feature because workflow difficulty changes acceptance.
  • Use confidence intervals before making costly model migrations from small differences.

Recommended dashboard

  • Bar chart: accepted_outputs_per_dollar by feature and model
  • Line chart: acceptance_rate_pct over time
  • Table: cost, latency, and outcome for model experiments

Alert guidance

Alert on sharp acceptance-rate drops after a model, prompt, or tool change; review cost efficiency as a dashboard rather than a paging alert.

Read alert setup

Set up the events this query needs

Related instrumentation and guides

Continue the analysis

Run it on your events

Create a table, adapt the fields, and save the result

Start free, send structured events, and use the query result as a chart, shared dashboard widget, or alert input.

Get an API key