diff --git a/app/main.py b/app/main.py index e64ece4..6228f5a 100644 --- a/app/main.py +++ b/app/main.py @@ -124,7 +124,7 @@ async def api_usage(request: Request): data["keys"] = keys.get("keys", []) # Co-op-wide model popularity (aggregate, anonymized) for the leaderboard. try: - board = await broker_get(identity, "/broker/model-leaderboard") + board = await broker_get(identity, "/broker/model-leaderboard?days=30") data["coop_models"] = board.get("models", []) except HTTPException: data["coop_models"] = [] # best-effort; never block the main view @@ -493,14 +493,14 @@ PAGE_HTML = """
— - of your balance used + of your current balance used
-
—
remaining
-
—
monthly allowance left
+
—
remaining now
+
—
allowance left
—
credits (never expire)
-
—
tokens used
-
—
requests
+
—
tokens, all time
+
—
requests, all time
Shared across chat and API.
@@ -569,7 +569,7 @@ async function load() { const allowanceLeft = Math.max(0, allowance - spentThisCycle); $('spend').textContent = fmtMoney(spend); - $('of').textContent = 'of ' + fmtMoney(balance) + ' used'; + $('of').textContent = 'of ' + fmtMoney(balance) + ' current balance used'; $('remaining').textContent = fmtMoney(remaining); $('allowance').textContent = fmtMoney(allowanceLeft); $('credits').textContent = fmtMoney(credits); @@ -633,17 +633,16 @@ function renderBoard(models) { const top = Math.max(...rows.map(m => m.requests || 0), 1); el.innerHTML = rows.map((m, i) => { const req = m.requests || 0; - const cpr = req > 0 ? (m.spend || 0) / req : 0; // cost per request const pct = Math.round((req / top) * 100); return '
' + '
' + (i + 1) + '
' + '
' + '
' + '
' + escapeHtml(m.model) + '
' + - '
' + fmtMoney(cpr) + ' / request
' + + '
' + fmtMoney(m.spend || 0) + ' total
' + '
' + '
' + - '
' + req.toLocaleString() + ' requests by members
' + + '
' + req.toLocaleString() + ' requests by members · last 30 days
' + '
' + '
'; }).join('');