-
Notifications
You must be signed in to change notification settings - Fork 0
Token usage + cost tracker per universe run #9
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Overview
Show users exactly how many tokens were used and what each universe run cost — broken down per agent and per provider.
UI mockup
After a run completes, show in the post-analysis panel:
Run cost breakdown
──────────────────────────────────────────
Researcher claude-sonnet-4-6 1,240 in / 890 out $0.017
Analyst gemini-2.5-flash 980 in / 650 out $0.001
Coder gpt-4.1-mini 870 in / 720 out $0.002
Reviewer llama-3.3-70b (Groq) 760 in / 540 out $0.001
Synthesis claude-sonnet-4-6 3,200 in / 980 out $0.024
──────────────────────────────────────────
Total $0.045
Implementation
- Parse
usagefield from each provider's streaming response (all major providers return this) - Store
{ inputTokens, outputTokens }per agent inMAAgent - Look up price per token from the
ALL_MODELStable already inSettingsPage.tsx - Display in post-analysis panel and the Analytics page
Relevant files
src/lib/multiAgentEngine.ts— capture usage from SSE responsessrc/components/pages/UniversePage.tsx— display in post-analysis panelsrc/components/pages/AnalyticsPage.tsx— aggregate cost over time
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request