Understanding Tokens
Tokens are the unit of LLM pricing. Roughly:- 1 token ≈ 4 characters (English)
- 1 token ≈ 0.75 words
- 100 tokens ≈ 75 words
Pricing by Provider
- Anthropic (Claude)
- OpenAI
- Google (Gemini)
- xAI (Grok)
Prices change frequently. Check provider pricing pages for current rates. Output tokens typically cost 3-5x more than input.
Cost Estimation
Per-Task Estimates
Monthly Projections
Optimization Strategies
1. Reduce Input Tokens
Use targeted reads instead of full files:- Claude Code
- Gemini CLI
- Cursor
- OpenCode
2. Reduce Output Tokens
Request concise responses:3. Use Appropriate Models
- Anthropic
- OpenAI
- Google
4. Cache Expensive Operations
5. Batch Operations
Monitoring Costs
Track Usage
Set Budgets
Define budget limits in agent configurations:Cost Alerts
Cost-Saving Patterns
Progressive Enhancement
- Anthropic
- OpenAI
- Google
- Multi-Provider
Summarize Before Processing
Parallel with Haiku, Synthesize with Sonnet
1
Fan out (cheap)
Run Task 1, Task 2, Task 3 in parallel with Haiku
2
Synthesize (quality)
Sonnet combines all results into final output
ROI Framework
Calculate Value per Token
When to Optimize
Best Practices
- Monitor costs weekly at minimum
- Set per-agent and per-squad budgets
- Use fast/cheap models for high-volume tasks
- Cache expensive research results
- Batch similar operations
- Track ROI, not just costs
Related
Multi-LLM Usage
Choose the right model for each task
Context Optimization
Reduce input token usage