Nearby lessons
39 of 49Prompt Engineering - Tokens and Cost
Tokens — Cost and Performance
A token is a small piece of text that AI reads — AI processes your prompt token by token, roughly word by word.
- More tokens → more processing → more cost.
- Short prompts = low tokens = low cost.
In simple words: Less tokens = more efficiency. Smart engineers optimize, not just create.
| Long Prompt | Optimized Prompt |
|---|---|
| High tokens | Low tokens |
| Expensive | Cheap |
| Slow | Faster |
| Cluttered | Efficient |
The bus-ticket example:
- Short distance → low cost.
- Long distance → high cost.
In AI: short prompt = low tokens = low cost. In real projects every API call costs money — minimize tokens without losing meaning.
Example01
📝 Key Takeaways
- A token is a small piece of text that AI reads — roughly word by word.
- More tokens means more processing and more cost.
- Short prompts = low tokens = low cost.
- The bus-ticket example: short distance = low cost, long distance = high cost.
- Every API call costs money — minimize tokens without losing meaning.
- Smart engineers optimize, not just create.
🧠 Test Your Knowledge
2 QuestionsProgress: 0 / 2