D10Intermediate

Token Cost Optimization

30 minEvery AI feature

Format: Learn how to reduce token consumption in AI API calls (save money).

Optimization strategies:

Strategy Savings Example
Shorten system prompt 10-30% Remove unnecessary instructions
Cache common answers 50-80% Don't call API for the same questions
Tiered models 60-70% Use Haiku for simple questions, Sonnet for complex ones
Limit output length 20-40% "Answer in 50 words or less"
Batch processing 30-50% Process multiple questions in one request

Exercise: Estimate the monthly AI cost for the following scenario:

AI customer service bot:
- 500 conversations per day
- Average 6 rounds per conversation
- Per round: 300 input tokens + 200 output tokens
- Using Claude Sonnet

Your estimate: $___/month
Then: Propose 3 ways to reduce costs by 50%

My Notes