mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
(feat) show analytics on admin UI
This commit is contained in:
parent
4fb723f119
commit
e6d13261ce
1 changed files with 8 additions and 4 deletions
|
@ -3869,11 +3869,15 @@ async def view_spend_logs(
|
|||
"spend:" : spend
|
||||
}
|
||||
"""
|
||||
response_keys = {}
|
||||
# we need this to show on the Admin UI
|
||||
response_keys = []
|
||||
for key in top_api_keys.items():
|
||||
response_keys["key"] = key[0]
|
||||
response_keys["spend"] = key[1]
|
||||
|
||||
response_keys.append(
|
||||
{
|
||||
"key": key[0],
|
||||
"spend": key[1],
|
||||
}
|
||||
)
|
||||
daily_metrics["top_api_keys"] = response_keys
|
||||
|
||||
return daily_metrics
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue