Ship a Safe Agent

Join the course waitlist

Founding price $149 (regular $199) for the first 50 buyers or through Nov 8. The waitlist gets first access when checkout opens.

No spam, only course updates. Unsubscribe anytime.

Module 6 of 8 · Full course

Cost and model choice

The cheapest model that fits, a reason for every route, spend caps that pause instead of fail.

What you will build

By the end you will have a router that prices every call before it is made, picks the cheapest model with the right skill and enough context, logs why, and a spend cap that pauses remaining work for a human instead of crashing the run.

Why it matters

Agents loop, retry and fan out, so a small per-call cost becomes a surprise bill. Using the biggest model for everything is the most common reason. A cost cap that throws an error is not much better: it loses the work and the context. Price first, route cheap, pause at the cap.

Inside this module

  1. 1.Price every call
    Estimate the dollar cost of a call before you make it.
  2. 2.Route to the cheapest fit
    Pick the cheapest model with the needed skill and enough context, and record why.
  3. 3.A cap that pauses
    When the next call would cross the cap, pause the rest of the work instead of failing.

Every step comes with the exact code diff, a run command, the expected output, a common mistake, a production note and a checkpoint. Then 2 graded exercises (resume, fanoutShares) checked by npm test, a solution branch, and a 3-question quiz. TypeScript, scripted model, no API key.

Locked

This lesson unlocks with the full course

The full course is delivered as private GitHub repos with the lessons, exercises and solutions. After you buy, you get a read-access invite, so you need a GitHub username.

Checkout opens soon. The waitlist gets first access at the $149 founding price (regular $199), for the first 50 buyers or through Nov 8. No spam, only course updates.

Join the course waitlistStart Module 1 free