+ The token, cost, and per-day analytics on this page are a
+ local debug estimate. They only count successful main-agent
+ responses with a usable usage{" "}
+ block, and silently exclude auxiliary calls (context
+ compression, title generation, vision, session search, web
+ extract, smart approvals, MCP routing, plugin LLM access)
+ plus provider-side retries and fallback attempts. Cache
+ writes are missing entirely.
+
+
+ On models with heavy auxiliary traffic (Kimi K2.6, MiniMax
+ M2.7) the local total can be 10x–100x lower than what your
+ provider bills. Hiding these numbers is safer than letting
+ them look authoritative.
+
+
+ Check your provider dashboard (OpenRouter, Anthropic, etc.)
+ for actual usage and billing. To re-enable the local debug
+ estimate anyway, set{" "}
+
+ dashboard.show_token_analytics: true
+ {" "}
+ in Config.
+
- {entry.estimated_cost > 0 && (
+ {showTokens && entry.estimated_cost > 0 && (
{formatCost(entry.estimated_cost)}
)}
- {entry.tool_calls > 0 && (
+ {showTokens && entry.tool_calls > 0 && (
{entry.tool_calls} {t.models.toolCalls}
@@ -752,9 +771,26 @@ export default function ModelsPage() {
const [loading, setLoading] = useState(true);
const [error, setError] = useState(null);
const [saveKey, setSaveKey] = useState(0);
+ // Gate the token/cost UI on `dashboard.show_token_analytics`. See
+ // hermes_cli/config.py for the rationale: the numbers exclude auxiliary
+ // calls and retries, so they're misleading next to provider billing.
+ const [showTokens, setShowTokens] = useState(false);
const { t } = useI18n();
const { setAfterTitle, setEnd } = usePageHeader();
+ useEffect(() => {
+ api
+ .getConfig()
+ .then((cfg) => {
+ const dash = (cfg?.dashboard ?? {}) as { show_token_analytics?: unknown };
+ setShowTokens(dash.show_token_analytics === true);
+ })
+ .catch(() => {
+ // Default to hidden on any failure — safer than showing wrong numbers.
+ setShowTokens(false);
+ });
+ }, []);
+
const load = useCallback(() => {
setLoading(true);
setError(null);
@@ -842,35 +878,59 @@ export default function ModelsPage() {
+ {!showTokens && (
+
+ Token & cost analytics are hidden because the local counts
+ exclude auxiliary calls (compression, vision, web extract,
+ …) and provider retries, so they diverge from your provider
+ bill. Enable{" "}
+ dashboard.show_token_analytics{" "}
+ in Config to
+ show the local debug estimate anyway.
+