Learn AI. Do. Grow.
← All modules

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

  1. Only include the material that is necessary for the question.

  2. Request an appropriate length and a usable format.

  3. Measure costs, waiting time, and quality together.

Remember: Shorter is meaningful as long as the answer remains usable and verifiable. Open het volledige schema ↗

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 situation

Fictitious 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.

Ende, your light pink practice buddy

The fictitious source is included. Only when selecting ‘Let Ende answer’ do you send your assignment to the AI service. Do not use private data.

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

Your result

No answer yet

Present your assignment to Ende.
Read the answer, change one thing, and compare.

You remain in control

What do you want to improve in your next attempt?

My own check

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?

Divide the space into practice tokens
2800 of 4000 tokens used.

Blue: inputGreen: answer spaceGrey: free space

1200tokens free
€0.0088fictitious costs at full usage

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.

A question? I'll help you on your way.

Drag Aldo to move it. Use the arrow keys on Aldo with the keyboard, Enter to save the position and Escape to cancel.