In this video, you replayed one real run of the batch script you built for Leaf & Kettle Tea’s inbox, and looked back at the module behind every call it made.
What You Can Do Now
You can now call a language model from a Node script with fetch(), through a small module that works with OpenAI or Anthropic. You keep the key secret, read the token usage and cost of every call, and handle rate limits, timeouts and cut-off answers.
The Whole Inbox for About a Cent
One real run of node --env-file=.env draft-inbox.js drafted a reply to each of the twelve emails and printed each draft with its token usage and its cost in cents. Yours will differ in wording, tokens and cost. The run ended with these two lines:
Saved 12 drafts. Held back: 0. Not drafted: 0.
Cost of reported usage: 1.017 cents