Terminal
Terminal/Skill
Shows spend and token usage on a LiteLLM proxy by day, grouped by user, team, org, tag, job, or model.
By LiteLLM
Works with
npx skills add berriai/litellm-skills --skill view-usageQuery daily activity and spend data from a live LiteLLM proxy.
Ask for these if not already known:
LITELLM_BASE_URL — e.g. https://my-proxy.example.com
LITELLM_API_KEY — proxy admin key
API reference: https://docs.litellm.ai/docs/proxy/users#get-user-spend
job:nightly-eval or job=batch-import.LiteLLM attributes per-request costs through request tags. For LLM jobs, prefer
tagging requests with a stable job label such as job:<job-name> and then query
tag APIs:
/tag/daily/activity?tags=<tag> for daily spend, tokens, request count,
and model/provider breakdowns for one or more job tags./global/spend/tags?tags=<tag> for a top-level spend total by tag over a
date range./global/spend/tags
without a tags filter, sort by spend descending, and present the top tags
that look like job labels.curl -s "$BASE/user/daily/activity?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD&page_size=30" \
-H "Authorization: Bearer $KEY"
curl -s "$BASE/global/activity?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD" \
-H "Authorization: Bearer $KEY"
curl -s "$BASE/team/daily/activity?team_ids=<team_id>&start_date=YYYY-MM-DD&end_date=YYYY-MM-DD" \
-H "Authorization: Bearer $KEY"
curl -s "$BASE/organization/daily/activity?organization_ids=<org_id>&start_date=YYYY-MM-DD&end_date=YYYY-MM-DD" \
-H "Authorization: Bearer $KEY"
curl -s "$BASE/user/daily/activity?user_id=<user_id>&start_date=YYYY-MM-DD&end_date=YYYY-MM-DD" \
-H "Authorization: Bearer $KEY"
curl -s "$BASE/tag/daily/activity?tags=<tag>&start_date=YYYY-MM-DD&end_date=YYYY-MM-DD&page_size=30" \
-H "Authorization: Bearer $KEY"
For multiple tags, pass a comma-separated list:
curl -s "$BASE/tag/daily/activity?tags=job:nightly-eval,job:batch-import&start_date=YYYY-MM-DD&end_date=YYYY-MM-DD&page_size=30" \
-H "Authorization: Bearer $KEY"
curl -s "$BASE/global/spend/tags?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD" \
-H "Authorization: Bearer $KEY"
Filter to a specific job tag:
curl -s "$BASE/global/spend/tags?tags=<tag>&start_date=YYYY-MM-DD&end_date=YYYY-MM-DD" \
-H "Authorization: Bearer $KEY"
{
"results": [
{
"date": "2026-03-14",
"metrics": {
"spend": 1.23,
"prompt_tokens": 45000,
"completion_tokens": 12000,
"total_tokens": 57000,
"api_requests": 120,
"successful_requests": 118,
"failed_requests": 2
},
"breakdown": {
"models": { "gpt-4o": { "metrics": { "spend": 1.23, ... } } }
}
}
],
"metadata": { "page": 1, "page_size": 10, "total_count": 31 }
}
Note: top-level key is results (not data).
curl -s "$BASE/user/daily/activity?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD&page_size=30" \
-H "Authorization: Bearer $KEY" | python3 -c "
import sys, json
d = json.load(sys.stdin)
rows = d.get('results', [])
print('{:<12} {:>10} {:>12} {:>10}'.format('Date', 'Requests', 'Tokens', 'Spend'))
print('-' * 46)
total_spend = 0
for r in rows:
m = r.get('metrics', {})
print('{:<12} {:>10} {:>12} ${:>9.4f}'.format(
r.get('date', ''),
m.get('api_requests', 0),
m.get('total_tokens', 0),
m.get('spend', 0),
))
total_spend += m.get('spend', 0)
print('-' * 46)
print('{:<12} {:>10} {:>12} ${:>9.4f}'.format('TOTAL', '', '', total_spend))
"
Before processing results, check the HTTP status:
LITELLM_API_KEY; ask the user to verifyfailed_requests > 0.metadata.total_pages > 1, offer to fetch remaining pages.