In this video, you priced a draft reply from the token counts in its usage, then ran the draft script over the first three emails in the tea importer’s inbox and estimated what a month of drafts would cost.
Key Points
- Usage holds two counts. One real run for Hannah’s late parcel reported
{ inputTokens: 103, outputTokens: 60 }. For a short request like this one, with no cached input, those two numbers and the model’s prices are all you need to price the call. - A token isn’t a word. Split by one model family’s tokenizer, common words such as “still” and “arrived” are one token each, while “Okafor” takes three, the order number 4417 is cut in two, and “Darjeeling” takes three. Spaces, punctuation and line breaks are tokens too, and other models split text their own way. Names, IDs and numbers can take several tokens, so a word count runs low: take your counts from usage.
- The instructions are input on every call. Hannah’s email and the instructions together are 65 words, and usage counted 103 input tokens, a few of them added by the request itself. You pay for those too.
- Input and output have separate prices, per million tokens. When the video was recorded, the drafting model this course uses cost $2 per million input tokens and $10 per million output tokens. For Hannah’s draft, 103 × 2 + 60 × 10 = 806. Divided by 1,000,000, that’s 0.000806 dollars, and times 100 for cents, about 0.08 cents. The output tokens were 600 of the 806, about three quarters of the cost.
- Output can include reasoning. A model can generate reasoning before its reply. Hannah’s draft had none, but one of the three drafts below did. Reasoning never shows up in the reply’s text, but it’s billed as output, so price a call from its output count, not from the reply’s length.
- Estimate a month from a few real calls. Three drafts cost 0.119, 0.115 and 0.093 cents. In the REPL,
((0.119 + 0.115 + 0.093) / 3).toFixed(3)gives'0.109', an average of 0.109 cents a draft. At a guessed 40 emails a day, 0.109 × 40 × 30 = 130.8 cents, about $1.31 a month. Your counts will differ a little on every run, so rerun the estimate whenever the counts or the prices change.
The rule:
- One call, in cents: (input tokens × input price + output tokens × output price) ÷ 1,000,000 × 100, with prices in dollars per million tokens. This holds for short requests like these, with no cached input: the next section says how your provider bills cached input.
- One month: the average cost of a few real calls × the calls you expect.