Module 9 · Lesson 1 of 6

What one request costs

Two meters on every request

Each request pays one price for the tokens it sends and a higher one for the tokens the model writes.

Scene 1 of 4 · Two prices

At example prices, input costs $3 per million tokens and output costs $15: 5 times more.

One request, at example prices
  • 2,000 tokens sent$0.006
  • 300 tokens written$0.0045
One request
not shown yet
1,000,000 requests
not shown yet
  1. Two prices. At example prices, input costs $3 per million tokens and output costs $15: 5 times more.
  2. Count the input. The 2,000 prompt tokens cost $0.006.
  3. Count the output. The 300 answer tokens cost $0.0045: close to the input, from far fewer tokens.
  4. Add them up. One request costs $0.0105; 1,000,000 requests a month cost about $10,500.
  5. Now you try. Change the prompt size; the answer stays at 300 tokens. For example: $0.0285 a request, 84% of it for the prompt; 1,000,000 requests cost about $28,500. Output costs more per token, but a long enough prompt still makes input the bigger part.

Scene 1 of 4: Two prices. At example prices, input costs $3 per million tokens and output costs $15: 5 times more.

Key points

  1. Input and output tokens have separate prices.
  2. Output often costs several times more per token.
  3. A long prompt can still cost more than the answer.
  4. Tiny sums per request add up across a month of traffic.

Model providers charge by the : one price for the tokens you send, and another, usually higher, for the tokens the model writes.

So one request costs its tokens times the input price, plus its answer tokens times the output price.

Example. At example prices of $3 per million input tokens and $15 per million output tokens, 2,000 tokens in and 300 out cost $0.006 + $0.0045 = $0.0105.

In system design: Long prompts, such as many retrieved , raise the cost of every request, so send only the context the answer needs.

Check yourself

At $3 per million input tokens and $15 per million output tokens, which costs more?