OpenAI API from A to Z · Lesson 3
Tokens, context, and cost
Count tokens with tiktoken and the count endpoint, context windows (1,050,000 for GPT-6), the long-context surcharge, truncation strategies and compaction, a price-per-1M-tokens table and cache costs.
One trial lesson is open without sign-up: what a large language model is →


