diff --git a/src/ucode/usage.py b/src/ucode/usage.py index 3fa0d2b..67a931b 100644 --- a/src/ucode/usage.py +++ b/src/ucode/usage.py @@ -504,7 +504,13 @@ class ToolUsageTotals(NamedTuple): cost: Decimal | None -TOOL_MODEL_TABLE_HEADERS = ["Model", "Requests", "Input (incl. cache)", "Output", "Cost (USD)"] +TOOL_MODEL_TABLE_HEADERS = [ + "Model", + "Requests", + "Input (incl. cache)", + "Output", + "Est. Cost (USD)", +] def aggregate_tool_model_usage(records: list[dict[str, object]], tool: str) -> list[ModelUsage]: @@ -815,6 +821,6 @@ def usage(warehouse_id: str | None = None) -> int: console.print(f"{label('Requests:')} {value(f'{totals.requests:,}')}") console.print(f"{label('Total tokens:')} {value(f'{totals.tokens:,}')}") if totals.cost is not None: - console.print(f"{label('Cost (USD):')} {value(format_cost_usd(totals.cost))}") + console.print(f"{label('Est. Cost (USD):')} {value(format_cost_usd(totals.cost))}") console.print(render_box_table(TOOL_MODEL_TABLE_HEADERS, rows, max_widths=table_widths)) return 0 diff --git a/tests/test_usage.py b/tests/test_usage.py index 1b8405d..0c7ba44 100644 --- a/tests/test_usage.py +++ b/tests/test_usage.py @@ -12,6 +12,7 @@ from ucode.databricks import SqlWarehouse from ucode.ui import label, value from ucode.usage import ( + TOOL_MODEL_TABLE_HEADERS, USAGE_BREAKDOWN_DAYS, USAGE_SUMMARY_DAYS, ModelPrice, @@ -465,6 +466,9 @@ def test_totals_cost_none_when_nothing_priced(self): _, totals = build_tool_model_rows(records, "claude", self._lookup()) assert totals.cost is None + def test_cost_header_is_explicitly_estimated(self): + assert TOOL_MODEL_TABLE_HEADERS[-1] == "Est. Cost (USD)" + class TestRenderBudgetLines: def test_no_lines_when_unavailable(self):