Lesson 1.1

Tokens and context windows

Models read tokens, not characters, and they can only see a fixed window of them. Both your bill and your failures come back to this.

Duration
12m
Level
Intermediate
Students
26k students

Overview

Models read tokens, not characters, and they can only see a fixed window of them. Both your bill and your failures come back to this.

In this lesson you will:

  • Understand tokenisation and why cost is per token
  • Budget a prompt against the context window
  • Recognise the failure modes of an overflowing context

Resources

Claude API documentation

The official reference for the tools used in this lesson.