How it works
Six things happen between your call and the answer.
Five of them are ours. The one in the middle is a model call you were already making, and the point of the other five is to make that one cheaper without making it worse.
01
Your call arrives
The OpenAI or Anthropic wire format, whichever your client already speaks, authenticated with an API key. The only addition to the shape is an optional context string holding whatever your app retrieved.
Node runtime. No SDK to install.
02
Triage reads the request
One typed decision call, run against the pool of models this request was offered, answers three things at once: what kind of task this is, which pool member can handle it, and how much verification the answer will deserve. It returns a confidence alongside those answers, and that confidence is load-bearing later.
Roughly 100ms. Jev when configured, a built-in heuristic otherwise, and the receipt always says which.
03
The model triage picked answers
Routed through Vercel AI Gateway when it is configured and OpenRouter otherwise. Tokens are resold at the provider's list price with no markup, which is deliberate: if we profited on the spread we would have an incentive to route you upward, and every savings figure we showed you would deserve suspicion.
Cost comes back as the exact figure the provider charged, not a reconstruction.
04
The checks it earned run, cheapest first
Schema and reference checks always run and cost nothing. Groundedness runs when you supplied context. Cross-model and resampling are held back for requests that earned them. This ordering matters: a free check that fails means the expensive ones never need to run.
Play with the rules below.
05
A failure escalates once
The most expensive model left in the pool answers instead, gets re-checked, and stops there. There is no second escalation, because a loop is worse for you than an honest answer carrying a flag. The receipt records which check failed and why.
Exactly one retry, by design.
06
You get the answer and the arithmetic
The response your code expected, plus a receipt: every model tried, every check and its verdict, what each leg cost including the triage call itself, and what always using the most expensive model in the pool would have cost for the same tokens. Anything that could not be computed comes back null rather than zero.
Headers too, so you can log it without parsing the body.
Step four, in detail
The switches below drive the same function the billing path calls. Whatever combination you land on here is what a request with those properties would actually get.
The request
Short, self-contained, no source material. The common case, and the cheap one.
Criticality
Your policy sets the floor. Triage can raise it, never lower it.
Triage confidence
0.820.3 to 0.7 is the uncertain band.
The ladder
1 of 4 checks running
- 00
Schema and rules
Free, and about a millisecond
Valid JSON when JSON was asked for. URLs that parse. Numbers in the answer that appear in the input. Length and format honoured.
Always runs. Deterministic, free, and never wrong about what it checked.
- 01
Groundedness
Fractions of a cent
Every factual claim in the answer checked against the context you supplied. Anything the context does not support gets flagged.
Skipped: no context was supplied, so there is nothing to check the answer against.
- 02
Cross-model disagreement
One extra completion
A different model family answers the same question independently. Two unrelated models rarely invent the same false detail.
Skipped: this request is not marked critical, so a second full completion is not worth its cost.
- 03
Self-consistency
Three extra completions
The same model is resampled at temperature and the spread is scored. An answer that changes between runs was never settled.
Skipped: reserved for critical requests.
Verification spend on this request
under 1% of the ceiling
The ceiling is all four rungs on every call, which is what a verification product that checks everything would cost you. Most traffic sits at the bottom of that bar, which is the entire point.
What the receipt actually contains
Three cost buckets that never overlap (answering, checking, and the triage decision itself), a comparison priced on the tokens you actually used against the pool’s most expensive member, and a null anywhere a number could not be honestly produced.
One line is deliberately empty. Routing away from the model you were caching against loses that cache hit, which is a real cost and one that has sunk at least one well-documented routing project. We do not collect provider cache telemetry yet, so we report it as unmeasured rather than leaving it silently out of the savings figure.
_llm11
{
"verdict": "escalated",
"modelUsed": "anthropic/claude-opus-5",
"baselineModel": "anthropic/claude-opus-5",
"candidatePool": ["openai/gpt-5.6-luna", "google/gemini-3.8-flash", "anthropic/claude-opus-5"],
"poolSource": "project",
"taskType": "reasoning",
"criticality": "high",
"triageBackend": "heuristic",
"triageConfidence": 0.45,
"rungsRun": [
{ "rung": "schema", "passed": true, "confidence": null },
{ "rung": "groundedness", "passed": false, "confidence": 0.21 },
{ "rung": "schema", "passed": true, "confidence": null }
],
"escalated": true,
"escalationReason": "unsupported by provided context",
"costCents": 0.41,
"verificationCostCents": 0.02,
"triageCostCents": 0,
"totalCostCents": 0.43,
"baselineCostCents": 0.38,
"savingsCents": -0.05,
"cacheLossCents": null,
"latencyMs": 2140
}That example costs more than the pool’s most expensive member, and says so with a negative number: it escalated to that same model, so a request that escalates has paid for two completions on top of it. Pretending otherwise would make every other figure in the product harder to believe.
Run it on your own traffic.
$2.00 of credit, free, no card. The quickstart takes about a minute.