Nearby lessons

39 of 49

Prompt 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 PromptOptimized Prompt
High tokensLow tokens
ExpensiveCheap
SlowFaster
ClutteredEfficient

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
Loading editor…
📝 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 Questions
Progress: 0 / 2

Finished this lesson?

Mark it as complete to track your progress and see technology completion stats.