# build-a-token-usage-dashboard

Turn per-key usage into a usage dashboard (by user, team, day and key) as one static HTML page

- **Space:** token-management-public (https://github.com/Tech-Realm/space-token-management-public/tree/main/build-a-token-usage-dashboard)
- **Level:** L2 (as the registry reports it)
- **Keys it needs (names only):** none
- **Tools:** python3
- **Routes:** static-html, metabase; checks: 2
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use token-management-public/build-a-token-usage-dashboard` or MCP `get_pack token-management-public/build-a-token-usage-dashboard`
- **Files:** CHANGELOG.md, code/usage_dash.py, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/fixtures/usage.csv, outcome/results.json, pack.yaml, refs/refs.yaml, spec/SPEC.md, spec/source.md

## Purpose (spec/SPEC.md)

Turn per-key usage into a usage dashboard (by user, team, day and key) as one static HTML page

## Goal
Anyone can open one page and see where API spend goes per user, team, day and key.

## Steps
1. Export usage: `tokens.py --db tokens.db usage-csv > usage.csv` (or LiteLLM /spend/logs).
2. `python3 code/usage_dash.py usage.csv usage.html`.
3. Open locally (`agopen usage.html`) or serve via the tunnel; never publish to a third-party host.

## Edge cases
- Empty CSV -> page says 0 rows.
- Many keys: the page is sorted by spend; add pagination past ~500 rows.

## Don'ts
- Don't include raw tokens or prompt text in the export.



---

Canonical URL: https://logicpacks.io/packs/token-management-public/build-a-token-usage-dashboard

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
