Reference · How-to · ~5 min

How to profile token spend

Last updated

Find where money goes before optimizing blindly.

Find where money goes before optimizing blindly.

Steps

1. Log `tokens_in`, `tokens_out`, model, and route per request

2. Group by feature (`/support`, `/draft`, embed job)

3. Rank top 5 routes by daily cost

4. For #1 route: try semantic cache, batch embed, or model router

5. Set token budget alerts at 80% of monthly cap

**Try the lesson:** `cost-optimization-lab` in Lane D