The Cost & Quality tab helps you compare an AI application’s gateway spend and token usage with its AI evaluation results over the same time period.

Use this view to identify periods where changes in spend or token consumption coincide with changes in evaluated response quality. You can then continue the investigation in AI Evaluation, AI Traces, or the related AI Gateway views.

Open Cost & Quality

  1. Go to Infrastructure > AI Observability and select an AI environment.
  2. In AI Apps, open an application.
  3. Select Cost & Quality.
  4. Select the time range you want to investigate.

The Cost & Quality page uses the application and time range selected at the top of the application page.

Cost and Quality tab comparing application spend, token usage, and AI evaluation scores

Understand the summary

The summary cards provide application-level cost and usage information for the selected time range.

CardWhat it showsHow to use it
Spend in RangeGateway spend attributed to the application during the selected time range.Understand application spending for the investigation period and compare it with token usage and evaluation results.
Tokens in RangeInput and output tokens attributed to the application during the selected time range.Determine whether a change in spend is accompanied by a change in token consumption.
Cost EfficiencyApplication spend normalized per one million tokens.Compare cost efficiency across comparable periods without relying only on total spend.

For example, 1.00 / 1M TOK means that the displayed application cost is normalized to one million attributed tokens.

Understand the charts

A separate chart can be displayed for each available AI evaluation metric.

Examples include:

  • Bias
  • Coherence
  • Completeness
  • Faithfulness
  • Groundedness
  • Hallucination
  • Helpfulness
  • Relevance
  • Safety
  • Toxicity

The metrics available depend on the configured evaluator and evaluation data available for the application.

Chart values

Each chart compares cost, usage, and the selected evaluation metric over the same hourly interval.

Chart elementColorWhat it representsScale
SpendBlueGateway spend attributed to the application for the hour.Currency axis
Token UsageGreenTokens attributed to the application for the hour.Token-usage axis
Agent Evaluation Score (P95)OrangeP95 evaluation score for the selected metric across evaluated sessions for the hour.0–1 evaluation-score axis

The chart uses separate axes because currency, tokens, and evaluation scores represent different units. Do not compare the physical height of two bars without checking the corresponding scale.

Understand the hourly comparison

Cost & Quality groups available values into hourly intervals. For each interval, compare:

  • Spend
  • Token usage
  • Evaluation score

Use the hourly comparison to answer questions such as:

  • Did token usage increase during the same hour that application spend increased?
  • Did an evaluation metric change during a period of unusually high usage?
  • Did quality change after application traffic or model usage changed?
  • Did spending increase without a comparable increase in token consumption?
  • Does a quality change appear only during specific periods?

Hover over an hourly data point or bar to review the values available for that interval. Depending on configured gateway telemetry, hover information can also include the team associated with a virtual key.

Understand the evaluation score

The orange Agent Evaluation Score (P95) bar represents the 95th-percentile value for the selected evaluation metric during the hourly interval.

P95 is the value at or below which 95 percent of the observed evaluation scores fall.

Interpret P95 according to the metric being displayed.

Metric typePreferred directionExamples
RiskLower is generally betterHallucination, Toxicity, Bias
QualityHigher is generally betterFaithfulness, Groundedness, Coherence, Completeness, Helpfulness, Relevance
EfficiencyHigher is generally betterApplicable Agent Efficiency scores

Do not interpret a high P95 score as automatically positive. For example, a high Hallucination score represents increased risk, while a high Faithfulness score represents stronger evaluated quality.

For metric definitions, thresholds, and pass rules, see AI Evaluation.

Understand repeated spend and token values

Spend and Token Usage are displayed alongside each evaluation metric so that you can compare the same cost and usage context with different quality or risk indicators.

For example:

Evaluation chartValues compared
BiasSpend + Token Usage + Bias P95
CoherenceSpend + Token Usage + Coherence P95
CompletenessSpend + Token Usage + Completeness P95

The Spend and Token Usage bars repeated across these charts are not additional independent totals. Do not add spend or token values across evaluation charts.

Interpret cost and quality together

Use Cost & Quality to identify periods worth investigating rather than to establish direct causation.

What you observeWhat it can indicateWhat to review next
Spend and token usage both increaseIncreased application or model usage can be contributing to higher spend.Application traffic, sessions, model usage, and token consumption.
Spend increases but token usage remains similarPricing, model selection, or gateway usage can have changed.AI Gateway usage, model selection, and gateway cost data.
Token usage increases and quality decreasesLarger prompts, responses, or execution paths can coincide with poor evaluated results.Affected sessions, traces, prompts, model calls, and tool calls.
Spend increases while quality remains stableHigher usage can be increasing cost without a visible quality change.Request volume and token consumption.
Quality changes while spend and tokens remain stablePrompt, tool, retrieval, model, or workflow behavior can be contributing rather than usage volume.AI Evaluation findings, affected sessions, and traces.
Risk score increasesEvaluation identifies increased risk for the corresponding metric.Pass rule, judge reasoning, and impacted spans.
Quality score decreasesEvaluated response quality changed for the corresponding metric.Affected sessions compared with representative sessions that performed as expected.

Application cost attribution

Application-level cost requires gateway requests to be attributed to the corresponding AI application.

For LiteLLM-based gateway telemetry, configure the required end-user tracking and ensure that the application identity reported in requests matches the AI application identity expected by the integration.

Without the required application attribution:

  • Gateway-level spend can still be available.
  • Token totals can still be available from other telemetry sources.
  • Application-level spend can be missing or incomplete.

Do not interpret missing application spend as zero spend.

For LiteLLM and AutoI prerequisites and gateway-level cost information, see AI Gateways.

Investigation workflow

Use these steps to investigate unexpected changes in cost, token usage, or evaluation quality.

1. Select the application and time range

Select the application and the time range in which the issue occurred. Use the same time range when checking related data.

2. Check the summary

Review Spend in Range, Tokens in Range, and Cost Efficiency to understand how spending and token usage have changed.

Review the evaluation charts and compare score changes with spend and token usage during the same period.

4. Understand the evaluation scores

Check whether the metric measures risk or quality.

For example:

  • Increasing Hallucination may indicate higher risk.
  • Decreasing Faithfulness may indicate lower response quality.

5. Review affected sessions

Open AI Evaluation and check the affected sessions. Review the evaluation score, pass rule, judge reasoning, failed metrics, and impacted spans.

6. Check request traces

Open AI Traces to understand how requests were processed. Review token usage, model calls, LLM spans, tool calls, retrieval operations, latency, and execution steps.

7. Check gateway usage

Open AI Gateways to review gateway spend, model usage, token consumption, virtual-key usage, and budget limits.

8. Compare and confirm

Compare the affected period with a period when the application was working as expected. Review the application, evaluation, trace, model, and gateway data before identifying a possible cause.

Data availability

Cost & Quality depends on multiple data sources. A value or chart can be unavailable for several reasons.

SituationPossible reason
Spend is missingGateway cost telemetry is unavailable or requests cannot be attributed to the application.
Token usage is missingRequired token telemetry was not collected for the application or time range.
Evaluation score is missingNo applicable sessions were evaluated for the hour or the metric is not produced by the configured evaluator.
An evaluation chart is missingNo data is available for that evaluation metric.
Spend exists at gateway level but not application levelApplication identity attribution is missing or does not match the expected application identity.
Latest hour has incomplete evaluation dataThe evaluation cycle might not have completed yet.

Collecting one signal does not automatically provide the others. Cost, token usage, traces, and AI Evaluation can have different collection, timing, and attribution requirements.

If per-application spend is missing, verify LiteLLM telemetry, end-user tracking, and application identity mapping before treating the value as zero.