Skip to content
Evaluation & shipping · 2 of 2 · about 15 minutes · With a year

Measure token cost

A model that a company runs for you, a hosted model, is paid for by the token. Text you send in and text the model writes back are counted separately, and output usually costs several times more than input. Prices are quoted per million tokens, so a typical request costs a small fraction of a dollar, and the mistakes hide in the unit conversion. Knowing the cost of one request lets you estimate a day of traffic before the bill arrives.

About this lesson

Words to know

token
The unit a model reads and writes: a word, a piece of a word, or a punctuation mark. Limits and prices are counted in tokens.
input and output tokens
Input tokens are what you send to the model; output tokens are what it writes back. They are counted and priced separately.

Why it matters

The fifth milestone asks for cost per request beside speed and quality. The prices in this lesson are made up; real ones change, and cached input or a model on your own machine is billed differently.

With a year

How it works, a worked example, the exercise with its tests, three hints and the explained solution are in the app, with a year of Algo150 for $19. The first chapter, Model foundations, is free for everyone: start with Vector dot product.

What a year includes