Most teams shipping an LLM feature don’t know what a user costs them. They estimate. Then the invoice arrives.

Sesión is a management SaaS for independent psychologists that I built in 5 days during the Kaszek × Anthropic 2026 hackathon. Its core feature is a clinical co-supervisor: after every session, it generates an automatic summary of the conversation. It costs $0.14 USD per patient per month. That number is not a projection — it came from instrumenting every model call before the feature shipped.

This article is how you get to that number, and which architectural decisions keep it there.

What “unit cost” means in an AI product

Unit cost is what you spend on inference per unit of value you charge for. Not per request, not per token: per the thing that bills.

In Sesión the unit is the patient-month, because that’s how the psychologist perceives the value and it’s the basis the price is set on. If your billing unit is the seat, the resolved ticket or the processed document, that’s your denominator. Picking the wrong denominator is the first mistake: measuring “cost per request” tells you nothing about whether the business closes.

Any AI feature must be able to answer one question before it reaches production: how much margin is left after inference? If you can’t answer it with a measured number, the feature isn’t ready.

The pattern: cheap by default, expensive when needed

The decision that defines Sesión’s cost isn’t prompt engineering. It’s routing.

Two models, two distinct roles:

ModelWhen it runsVolume
ExecutionClaude Sonnet 4.6Automatic summary after each sessionEvery session
AdvisoryClaude Opus 4.6Quarterly report for the family, or a clinically complex caseException

Sonnet always runs. Opus only runs when the task justifies the cost: a quarterly report the patient’s family will read, or a case whose clinical complexity demands more reasoning. The post-session summary — 100% of the volume — does not need the expensive model.

That’s the whole trick. There isn’t a bigger one. The difference between an agent that costs $0.14 per user and one that costs $4 is usually that the second one sends everything to the largest model just in case.

Why this isn’t obvious in practice

Because the expensive model always performs slightly better, and “slightly better” is easy to justify when you aren’t watching the accumulated cost. The only defense is having the number visible before you decide. Once you know that upgrading the post-session summary from Sonnet to Opus multiplies your cost per user, the conversation changes: it stops being “which is better?” and becomes “how much better, and is that worth it?”.

How to measure it, concretely

Three steps. None of them needs special tooling.

1. Instrument every call. Each model request is logged with: which model, input tokens, output tokens, which user, and which product action it belongs to. That last field is the one most people omit, and it’s the one that makes the measurement useful — without it you have a spend total but no idea which feature generates it.

2. Count real tokens, not estimates. Sesión’s session summary consumes ~1500 tokens per run. That number came from running it, not from the “4 characters per token” rule of thumb. System prompts, prior-session context and output formatting weigh more than you’d expect.

3. Multiply by real usage frequency. This is where most projections break. It isn’t “tokens × price”: it’s tokens × price × how many times a typical user does this per month. A psychologist with 4 weekly patients generates different volume than one with 20. The $0.14 is the cost of the average patient, derived from observed usage.

What the number lets you decide

Having measured unit cost changes concrete decisions that are otherwise made blind:

  • Pricing. You know your floor. A plan that charges less than the inference cost of expected usage isn’t aggressive pricing, it’s a loss with extra steps.
  • Plan limits. Limits stop being arbitrary. They come from the point where margin closes.
  • Which AI feature to build next. If a new idea costs 10× per user, you have that data before investing two weeks in it.
  • When to switch models. When a new model ships, “should we migrate?” has a numeric answer instead of an opinion.

What this number does not cover

Being honest about the limits of the measurement:

The $0.14 is inference cost, not the total cost of serving the feature. It excludes hosting, the database, the LiveKit server for calls, and my time. It’s the variable component that scales with usage — which is exactly the one that tends to surprise people.

It’s also not a permanently stable number. It changes if model pricing changes, if the prompt grows, or if users use the feature more than observed. That’s why the instrumentation stays in place: the number is a continuous measurement, not a constant.

The operational summary

If you take one thing away: pick the denominator that bills, instrument every call with the product action that triggered it, and route to the cheap model by default. The expensive model earns its place task by task, not by default.

An agent in production without a measured unit cost isn’t a product. It’s a bet with a deferred invoice.


Sesión’s code is on GitHub. The safety architecture of the same system — the crisis filter and the latency protocol — is covered in a separate article.