AI engineering

Stage 1 · Lesson 4 of 8

Token pricing and rate limits

How LLMs work: tokens and context

Hosted models charge per million tokens. Input (what you send) and output (what the model writes) have separate prices, and output usually costs several times more. Here is how works out in practice.

Take a request with 3,000 input tokens and 500 output tokens, on a model priced at $3 and $15 per million. Input costs about $0.009 and output about $0.0075, so roughly 1.7 cents per request. At 100,000 requests a month, that is about $1,650.

Providers also set : caps on requests per minute and tokens per minute for your account. Go over them and you get 429, an error that means "too many requests". Do this arithmetic before you build. A feature that works in a demo can be too expensive or too rate limited to launch.

A question to check yourself, an AI practice session and 2 cheat sheet entries come with the full roadmap. Unlock

Resources for this stage

Start with· follow one of these

Keep handy

Also worth your time

Mark this stage as not done?