Deep dive · module 80 of 100
Managing costs and tokens
Understand how tokens and costs are related and how to limit them.
After this lesson
You can name simple ways to limit token usage and costs.
In view · Side by side
Fewer tokens while maintaining utility
Only include the material that is necessary for the question.
Request an appropriate length and a usable format.
Measure costs, waiting time, and quality together.
Part 1 of 3 · Relevant input
Your preference for less movement is on. Choose each part yourself.
Tokens = costs
More tokens usually means higher costs or longer waiting times.
Limit the input
Only include relevant text. You can summarise long documents first.
Limit the output
Ask for short answers if you do not need long text.
New practice example
From explanation to a usable result.
AI costs depend on input, output, repetitions and the way the provider calculates.
Fictional practice situationFictitious calculation task: input costs 2 calculation units per thousand tokens, output 6. A task uses 1500 input tokens and 500 output tokens, with an average of two attempts.
View a possible solution
This is how it can be done
Per attempt: 1,5 × 2 + 0,5 × 6 = 6 calculation units. Two attempts cost 12. Count preparation and verification separately as working time; these practice figures are not provider rates.
Why this works
Counting only the first model call underestimates repetitive work. Make it clear which unit you are comparing.
Make it slightly more difficult
Halve the output length and increase the number of attempts to three. Calculate whether the total model costs in this fictitious trial decrease or increase.
Extra practice, at your own pace. You do not need to submit anything. This does not count towards an automatic assessment.
Your workplace · learning by doing
Make something. See what changes.

Checking the AI connection… You can already view the written example.

Present your assignment to Ende.
Read the answer, change one thing, and compare.
Previously held
New version
You remain in control
What do you want to improve in your next attempt?
On this device only. AI answers remain only in this page memory. This is self-review, not a grade.
Why this approach works
Counting only the first model call underestimates repetitive work. Make it clear which unit you are comparing.
A step further
Halve the output length and increase the number of attempts to three. Calculate whether the total model costs in this fictitious trial decrease or increase.
Try & discover · no obligation
Fill the context window
Make your input longer. Then reserve more space for the answer. Where is the limit?
Blue: inputGreen: answer spaceGrey: free space
The specified input and reserved output fit together in this window.
Practice model, not a real tokenizer or product limit. Input also includes instructions and history. Fictitious rate: € 0,002 per 1.000 input tokens and € 0,006 per 1.000 output tokens. Actual rates and calculation rules differ.
This trial works locally with fictitious data and does not count towards your lesson completion. It starts anew with a new lesson or reload.
A prompt to get you started
Give three practical tips to limit token usage when working with long documents.
Apply it
Every API request contains a full archive, while the task only requires one short section.
Which approach best fits this situation?
- Remove all context without paying attention to quality.
- Only count output tokens and ignore the provided input.
- Send only relevant context and measure input, output, and quality.
With JavaScript, you can check your approach and receive immediate feedback.
Test your insight
What is an effective way to limit costs?
- Always using the longest prompt.
- Only including relevant information and asking for concise answers.
- Never paying attention to tokens.
Extra practice
Note two ways in which you can limit token usage in your daily work.
1. Only including the relevant section. 2. Asking for an answer of maximum 100 words.

