Pricing
Price per million tokens
What a million tokens cost, listed for input and output separately. The smallest unit for comparing providers, models, cached and uncached traffic, and renting.
Token pricing is quoted per million tokens, with a rate for input (what you send) and a usually higher rate for output (what the model writes). Output costs more because each output token runs a decode pass through the whole model, while input tokens ride through together in one prefill pass, which is cheaper per token.
The number only means something next to its assumptions. Cached input tokens (from a prefix cache) are billed at a steep discount. Long-context or premium models are listed higher. And on self-hosted hardware, nobody quotes you a per-token price - you derive it by dividing hourly cost by tokens per second, and utilization is the variable that decides whether that division gives a good number or an embarrassing one.
Working with the number is simple arithmetic, which is the point: input tokens times input rate plus output tokens times output rate gives a turn cost, and turn cost times requests gives a bill. Any plan for cutting the bill has to touch one of those factors - fewer tokens, cheaper caching, or cheaper tokens per second.
In interviews this is where economics questions open: quote the rate, state the utilization assumption, and walk the division. A candidate who reaches for the formula and shows the arithmetic is doing the job of a serving engineer; one who argues about model quality without a unit price is doing marketing.
A worked example
One chat turn carrying a 3,000-token prompt and receiving a 500-token reply, at assumed list prices of $1.20 per million input tokens and $4.80 per million output tokens.
- Input: 3,000 / 1,000,000 x $1.20 = $0.0036.
- Output: 500 / 1,000,000 x $4.80 = $0.0024.
- Per turn: $0.0036 + $0.0024 = $0.0060.
- At 1,000 turns a day: $0.0060 x 1,000 = $6.00 per day, about $180 for a 30-day month.
A single heavy user costs about $180 a month at these list prices, which is why caching, shorter prompts, and per-token economics dominate the conversation.
Where this shows up
- Inference Economics & LatencyEvery time someone sends a message to an AI feature, the model has to run on that request, and the run has a price in dollars and a wait in seconds. The industry word for the run itself is inference: the model processing your prompt and producing an answer, and it is the line item that grows with usage. Where does the money go? Mostly into tokens, the word-sized pieces of text that both prompts and answers are made of. Input tokens are re-sent with every call; output tokens are generated one at a time at a premium rate; and a large discount called prompt caching applies only while the opening of your prompt matches what the provider already has stored, which one careless changing detail destroys. The wait decomposes into stages that scale differently: reading the prompt grows with prompt size, writing the answer grows with answer length, and a fixed network round trip is attached either way - and the stages disagree about which lever is worth pulling. Interviewers pursue this topic because cost and latency are the two numbers that decide whether an AI feature survives its first real month, and both are governed by arithmetic you can do on a whiteboard. The three challenges below work that arithmetic: the cache hit rate and the savings a rotating preamble quietly destroys, the share of a latency budget that writing the answer consumes, and the work a hard output cap clips off real requests.
- Metering & Cost AttributionThe fourth serving job is the meter: the model serves traffic, the fleet is paid for, and the dollars land on an invoice that says per 1M, in and out, so the interview question becomes who spent what and on whose behalf. The model is one month of one product. Tokens per request are stated per side - a chat assistant sends 800 prompt tokens and writes 300 out, a coding copilot 2,400 and 600, and a research agent 12,000 and 4,000, because an agentic loop re-sends its context after every tool call and produces tool chatter of its own, so the same "request" moves 15x the tokens. Rates are per 1M tokens, priced separately for prompt and output: the fast tier is $0.80 in and $4.00 out, the flagship $3 and $15, the frontier $15 and $75 - and the out-rate is always the 5x side, because output is generated token by token against a weight read that a prompt prefix caches but an answer never does. Three policy lines decide whether the ledger can be trusted. The prefix cache sells the repeated prompt at a tenth of the fresh rate, so the cached share of prompt tokens is the cheapest dollar on the bill and the saved line meters the discount forgone. Retries re-bill the whole request at full price - both sides - so a 20% retry rate is a 17% tax that product analytics never sees, because from the code's point of view nothing changed. Attribution, tagging the bill by named spender, adds no dollars at all, but a bill with no owner is invisible to the chargeback, the margin check, and the anomaly alert, and the sim lets at most 10% of the bill go untagged before it stops being a ledger. The output numbers compound: the blended rate - bill over every token moved - is the one-line answer to "what does this product cost us per use," and the raw bill against the budget line is the one finance reads. Interviewers test this because the meter is where engineering meets accounting: the xAE-style system-design round asks how you would bill two teams sharing one serving pool, and cost-per-request arithmetic shows up under the scaling follow-ups of nearly every AI design question. The three challenges below work the meter: the dollars one request bills, the bill the cached prefix discounts, and the ghost dollars a half-tagged bill leaks.
- Buying the FleetThe third serving job is the balance sheet: the product found users, the token demand no longer fits on a demo pod, and the interview question becomes procurement. Do you buy the fleet, rent it month to month, or route the overflow through a frontier API's meter? The model is one month. Demand is stated in terabytes of tokens (10T a month is a serious product, 1000T is frontier traffic), a month is 730 hours, and each card contributes an aggregate tokens/sec rate a well-fed, batched steady state sustains: an H100 carries about 10,000 tokens/sec on an 8B chat and 700 on a 70B premium, a B200 is 2.4x either, and a used A100 is 0.45x an H100. Three dollar lines then price the month. Owned cards bill their card-month no matter what flows - about $2,100 to $2,900 for the modern chips once the capex is amortized over 36 months and power, colo, network, and staff are added - rented cards bill the cloud's roughly 1.35x premium on the same floor, and the API bills per token at retail: $0.20 per 1M for the 8B chat, $2.50 for the 70B premium. Notice what that ordering says: ownership beats renting on the per-token rate everywhere, because the cloud premium is the margin it takes for owning. So the question is never "own or rent on rate" - it is utilization. An owned GPU idling is a mortgage payment, and the idle check lets at most 15% of owned capacity sit unused; sizing the fleet to a story about growth instead of the demand curve is how a $441M bet runs 71% idle. The margin check says self-hosting must beat the API by a real quarter - blended cost at most 75% of the API's price - because owning takes financing risk a rental does not: a failed chip generation or a slower model year erases a thin saving. The overflow check caps the API's share at 10% of needed tokens, because the API is metered per token at retail while rented cards bill wholesale: at sustained volumes, 40% of a big month's shortfall bills more than the whole rented cloud would. The sim's three stories are the used-chip bargain that was cheap per card and expensive per token, the shiny chip bet that bought for a demand curve that had not arrived, and the API tax where the overflow meant to catch the spike swallowed the month. The three challenges below work the model: the tokens a fleet carries, the whole rented cards that fill the shortfall, and the dollars the API meter bills on its share.
Test yourself
- AI Serving Infrastructure Interview Questions1 question on this term
- Quantization and Inference Cost Questions4 questions on this term
- Inference GPU Selection Questions4 questions on this term
- Cache Routing Interview Questions1 question on this term
- Cost Metering Interview Questions10 questions on this term