Broker usage: expose allowance and credits buckets to dashboard

This commit is contained in:
inference-bot committed 2026-09-27 22:39:54 -06:00
1 parent b7d239d9b6
commit b93b208659
1 file changed
+6 -1
+6 -1
View File
@@ -2104,7 +2104,8 @@ async def broker_get_usage(email: str, days: int = 0) -> dict:
"""
team_id = await litellm_get_or_create_team(email, get_member_balance(email))
balance = get_member_balance(email)
allowance = get_member_balance(email)
credits = get_credit_balance(email)
spend = 0.0
reset_at = None
@@ -2126,6 +2127,8 @@ async def broker_get_usage(email: str, days: int = 0) -> dict:
return {
"email": email,
"balance": balance,
"allowance": allowance,
"credits": credits,
"spend": spend,
"remaining": max(balance - spend, 0.0),
"total_tokens": usage["totals"]["total_tokens"],
@@ -2192,6 +2195,8 @@ async def broker_get_usage(email: str, days: int = 0) -> dict:
return {
"email": email,
"balance": balance,
"allowance": allowance,
"credits": credits,
"spend": spend,
"remaining": max(balance - spend, 0.0),
"total_tokens": total_tokens,