Token Budgets and Cost Control
Day 48 · Week 10 · Mastery
Slack Message — copy & paste
🤖 Tip #48 — AI tools aren't free. A tiered pipeline costs ~$2.50 per run; the same pipeline all-Opus costs $25+. Tier your models.
#48 All Tools
What AI Actually Costs
- Token pricing (approximate per 1M tokens)
- › Opus: $15 input / $75 output
- › Sonnet: $3 input / $15 output
- › Haiku: $0.25 input / $1.25 output
- A tiered pipeline run — 4 Haiku lookups + 2 Sonnet implementations + 1 Opus review = ~$2.50. The same pipeline all on Opus = $25+. That's 10x more for the same result.
- Autonomous agents (CI/CD) — we set hard token budgets per Lambda run. If an agent exceeds its budget, it stops and reports what it completed. Better to stop early than to bankrupt the team.
Tokens Cost Budget
#48 Mastery
How to Control Costs
- 1 Cost control strategies
- › Tier your models — don't use Opus for file searches
- › Set maxTurns on agents — prevents runaway loops
- › Use pre-flight checks — don't burn tokens on doomed pipelines
- › Start fresh sessions — long conversations waste tokens on history
- › Use spawned agents — isolated context instead of growing the main window
- 2 Apply the tiering principle to your pipeline
- › Lookups and file search → Haiku ($)
- › Implementation and execution → Sonnet ($$)
- › Code review and architecture → Opus ($$$)
- 3 Check your AI spending for the last week — identify the most expensive operations and consider if they could use a cheaper model
- 4 Set maxTurns on all your agents to prevent runaway token consumption from infinite loops
Tokens Cost Budget
Your screenshot here Optional — add a screenshot from your own workflow