diff --git a/app/templates/admin/usage_report.html b/app/templates/admin/usage_report.html index b8b9404..3342502 100644 --- a/app/templates/admin/usage_report.html +++ b/app/templates/admin/usage_report.html @@ -75,7 +75,7 @@

Filtered totals

Prompt tokens{{ summary.prompt_tokens }}
Completion tokens{{ summary.completion_tokens }}
Total tokens{{ summary.total_tokens }}
-
Estimated cost{{ currency.symbol }}{{ '%.6f'|format(summary.cost_estimate) }}
+
Estimated cost{{ currency.symbol }}{{ '%.6f'|format(summary.cost_estimate) }}

Usage rows

Model Status Tokens - Estimated cost + Estimated cost @@ -111,7 +111,7 @@

Usage rows

{{ row.model or 'unknown' }} {{ row.status or 'unknown' }} {{ row.total_tokens or 0 }} - {% if row.cost_estimate is none %}—{% else %}{{ currency.symbol }}{{ '%.6f'|format(row.cost_estimate) }}{% endif %} + {% if row.cost_estimate is none %}—{% else %}{{ currency.symbol }}{{ '%.6f'|format(row.cost_estimate) }}{% endif %} {% endfor %} diff --git a/app/templates/billing/usage.html b/app/templates/billing/usage.html index d12c7ac..7d8526a 100644 --- a/app/templates/billing/usage.html +++ b/app/templates/billing/usage.html @@ -62,7 +62,7 @@

Totals

Prompt tokens{{ dashboard.totals.prompt_tokens }}
Completion tokens{{ dashboard.totals.completion_tokens }}
Operations{{ dashboard.totals['count'] }}
-
Estimated cost{{ dashboard.currency.symbol }}{{ '%.6f'|format(dashboard.totals.cost_estimate) }}
+
Estimated cost{{ dashboard.currency.symbol }}{{ '%.6f'|format(dashboard.totals.cost_estimate) }}

{{ title }}

Prompt Completion Total tokens - Estimated cost + Estimated cost @@ -92,7 +92,7 @@

{{ title }}

{{ row.prompt_tokens }} {{ row.completion_tokens }} {{ row.total_tokens }} - {{ dashboard.currency.symbol }}{{ '%.6f'|format(row.cost_estimate) }} + {{ dashboard.currency.symbol }}{{ '%.6f'|format(row.cost_estimate) }} {% endfor %} @@ -118,7 +118,7 @@

Daily time series

Prompt Completion Total tokens - Estimated cost + Estimated cost @@ -129,7 +129,7 @@

Daily time series

{{ row.prompt_tokens }} {{ row.completion_tokens }} {{ row.total_tokens }} - {{ dashboard.currency.symbol }}{{ '%.6f'|format(row.cost_estimate) }} + {{ dashboard.currency.symbol }}{{ '%.6f'|format(row.cost_estimate) }} {% endfor %} diff --git a/tests/test_admin_usage_report.py b/tests/test_admin_usage_report.py index 1dbe86d..6cf5f4a 100644 --- a/tests/test_admin_usage_report.py +++ b/tests/test_admin_usage_report.py @@ -206,3 +206,17 @@ def test_filters_persist_in_pagination_links(self, client, login): html = response.get_data(as_text=True) assert "source=chat" in html assert f"user_id={user.id}" in html + + def test_cost_values_are_explicitly_labelled_as_estimates(self, client, login): + user = _user("cost-reader", "cost-reader@example.com") + _admin() + _record(user) + login(email="admin@example.com") + + response = client.get("/admin/usage/report") + + assert response.status_code == 200 + html = response.get_data(as_text=True) + assert 'title="Estimated from the configured price table; not a provider-confirmed charge."' in html + assert 'aria-label="Estimated cost, USD"' in html + assert "Estimated cost" in html