Skip to main content
Mythos

Cost Tracking and Budget Controls

Part of: Effective AI Utilization — Table of Contents

You can't optimize what you don't measure. BrianBot has the measurement infrastructure (token counts per step, UsageRecord per run) but hasn't connected it to dollars.

From Tokens to Dollars

The conversion is straightforward but model-specific. As of early 2026, approximate per-million-token costs: Claude Haiku input ~$0.80, output ~$4.00. Claude Sonnet input ~$3.00, output ~$15.00. These change — maintain a lookup table, not hardcoded constants.

BrianBot's costEstimateCents field on UsageRecord is the right schema design, it just needs to be populated. After each pipeline run, multiply input/output tokens by the model's per-token rate and store the result.

Per-Episode Cost Visibility

BrianBot processes episodes through a 5-step pipeline. Tracking cost per step (not just per episode) reveals which steps dominate spend. If the transcript step (Sonnet, 8192 max tokens) costs 10x the extraction step (Haiku, 2048 max tokens), that's expected — but if metadata generation (Haiku, 1024 max tokens) is unexpectedly expensive, you've found an optimization target.

Budget Guardrails

Three levels of protection: per-call limits (maxTokens, already in place), per-episode limits (abort if cumulative cost exceeds threshold), and per-period limits (daily/monthly spend caps with alerting). None of the latter two exist in BrianBot today.

Show-Level Economics

Since BrianBot supports multiple shows with potentially different model configs, cost tracking per show enables per-customer economics: does this show's usage justify its subscription? Which shows are most expensive to serve?

Related: Token Optimization Playbook, Model Routing Strategies, AI Observability and Debugging

🏷️#ai 🏷️#cost 🏷️#budget 🏷️#brianbot

Created with 💜 by One Inc | Copyright 2026