Added#
profile_usage on the MCP server: an agent can read the bill. The fourth
tool, and the surface's first with exact figures — they are the provider's own
billed counts, not ±10% estimates. The log is passed as text, never a path, so
the no-paths security design holds; the TTL-unsettled cache verdict, the levers
with the prompt ceiling named as a ceiling, all three truncation states and the
gaps carry over from the CLI; and a test feeds a customer-named session key
through three turns to assert no fragment of it comes back out.
"Your bill" in the web app: the profile report, read where it was pasted. Drop or paste a usage log and the whole report renders — parsed entirely in the browser against the bundled catalogue. Nothing is uploaded: there is no fetch in the component, a source test fails if one appears, and the one analytics event carries two booleans. Verified live by driving the built page in a browser and counting network requests during analysis: zero.
Fixed#
The web lever line glued the slice's spend to the saving's share. "up to
$0.4669 (72%)" against a by-label table calling the same slice 100% of the bill
— shareOfBill describes the combined saving, and the render passed spentUsd
beside it. Caught on a screenshot, not by any source assertion; it now carries
combinedUsd as the CLI always has, and a test pins which field feeds which
line. The same screenshot surfaced "1 calls are not in these totals": every
counted web message now takes its count as a number and conjugates the singular
in both locales, pinned by a test that walks all seven counted messages in both
catalogues.
Added#
The cache loop, closed: labels in the config maps a usage-log label to its
prompt file, and profile reads the file and says why a failing cache fails.
The report could say "caching loses money on support-rag" and nothing more —
the log carries counts, not content. With the map it names the reason: a stable
prefix under the model's cache minimum (writes that can never become reads),
stable tokens stranded behind the first placeholder (--reorder moves them), or
a healthy file whose problem is byte-identity between calls. A mapped file that
does not exist is said out loud rather than skipped.
Every sentence carries "as it is today — the log may predate it": the file is whatever the repository holds now, which may not be what produced the log, and a fresh file presented as the history's explanation would be a figure attributed to something it does not describe.
Added#
profile prices the answers that were cut off. With stop_reason
(Anthropic) or finish_reason (OpenAI) in the log — the API returns both beside
usage — the report names the one category of a bill that is waste without a
counterpart: answers that hit the max_tokens ceiling were paid in full, are
frequently retried and billed again, and the truncated attempt bought nothing.
Three states, kept apart: waste found, none found on a log that measured, and a
log that never recorded a stop reason — which gets the missing-field message,
because silence there reads as a clean bill of health on a question the log
never asked.
profile --against <previous.jsonl> — the bill as a watched metric. Nobody
adds five thousand a month in one day; bills grow four percent a week while
every snapshot looks reasonable. The comparison prints the delta with the diff
convention — positive means the bill grew — and ranks the drivers by their
contribution to the change, not by bill size, because the second-biggest
workload can be the whole story of the growth. Appeared and vanished workloads
are named. No period is assumed: the call counts print beside the money so the
reader judges comparability first.
profile --markdown-out <file> writes the report as GitHub-flavoured
markdown for a job summary or a PR comment, rendered from the same message
catalogue as the terminal — two renderings of one finding drift the moment they
are worded twice, and the sign conventions here have each already produced a bug
when restated by hand.
Fixed#
Cache billing noise was reported as conversation growth. Found by adversarial review, against a fix made the same day: the growth baseline was the cheapest turn's billed cost, and per-turn cost varies with the cache multiplier even when the input never grows — an identical 10,000-token turn costs 12.5x more as a cache write than as a cache read. An ordinary 5-minute-TTL agent whose conversation stayed completely flat reported 77.5% of its bill as "conversation growth" and was told to trim history that was not there, while the report's own min/max token figures proved the claim false on the same screen. Growth is measured in tokens now — exact, order-independent, immune to billing rates — and the dollars are that token share of what the session actually spent.
A numeric session id was dropped and then denied. session: 12345 — an
auto-incremented conversation id, which is what half the databases in existence
produce — was silently ignored by the string-only reader, and the report printed
"No call in this log carried a session": a false claim about a log that carried
one on every line. Finite numbers are identifiers now, for label and session
both; booleans and objects stay out, because session: true names nothing.
route --label with a misspelt label asserted a verdict about calls it never
selected. The fall-through answer was "no route on this log clears 1% of the
bill: these calls are already on the cheapest model of their family" — two
falsehoods at once when the log had a 60% route under a different name. A label
nothing carries now gets the typo answer: the labels that exist.
Fixed#
A workload literally named unlabelled merged into the missing-label bucket.
The sentinel was the string 'unlabelled', so 200 calls somebody had given that
name and 200 calls with no label at all reported as one row of 400 — a figure
attributed to something it does not describe — and the "none of these calls
carried a label" logic could fire over a log where half of them had. The sentinel
is the empty string now, the one value a parsed label can never be; the terminal
shows the missing bucket as (no label) so the two cannot read identically
either.
A label containing a newline corrupted the structured keys. Labels are half of
keys that split on \n — byLabelAndModel, the conversation tracker, the
output-shape tracker — so label: "rag\nclaude-haiku-4-5" truncated the label to
rag and mangled the model half. Whitespace inside a label is normalised to a
single space at the parse boundary, protecting every consumer at once.
Fixed#
The conversation measurement depended on the order of the log. Growth was anchored on the first record seen per session — a fact about the log's ordering, not about the conversation. The identical workload exported newest-first, an ordinary shape for a warehouse export, computed a negative growth and the whole section silently vanished: the largest line on an agent bill, gone because somebody's log was sorted the other way.
The anchor is the cheapest turn now, which is order-independent, equals the opening turn on any genuinely growing conversation, and keeps the figure an exact ceiling — no truncation strategy can pay less than the cheapest turn per turn. A test runs the same workload forward, reversed and re-sorted and requires identical results up to floating-point associativity.
The wording followed: smallest turn and largest turn, never opening and
closing, because the report must not claim an order it cannot know. For the same
reason a shrinking conversation and its growing mirror — literally
indistinguishable once order is unknown — now produce the same report, which
replaces a test that demanded the impossible. ConversationGrowth renames
firstTurnTokens/lastTurnTokens to minTurnTokens/maxTurnTokens (unreleased
API).
Fixed#
profile --json omitted the levers. The flagship section — "What would
actually move this bill", the reason the command exists — was terminal-only, so
any pipeline, dashboard or CI step reading the JSON never saw it. A finding the
machine-readable output omits is a finding the reader's tooling will never
surface. The JSON now carries levers beside the cache verdict, the
conversations and the output shapes, and a test asserts every section the
terminal renders has a machine-readable counterpart.
Added#
trazum profile now says where the output spend concentrates — the actionable
half of "output dominates", which was the biggest line on the measured bill (87%)
and the one the report could only state as a total.
Two bills with identical output spend want opposite responses, and only the shape tells them apart:
chat on Claude Opus 5: 5.9% of calls hold 71.5% of the output spend — the
ones answering with more than 8,000 tokens, out of $33.01 of output on
this slice.
That is a tail, and a tail has a cause: a path through the prompt that
invites an essay, a call with no max_tokens, a retrieval that returned a
book. Finding it is a morning; it is not "make everything shorter".against:
summaries on Claude Opus 5: the output spend sits where the calls are —
100.0% of them hold 100.0% of $45.00. There is no tail to hunt.The figure is the smallest group of calls holding at least half the output spend — a median over money rather than a threshold somebody picked, found by walking the distribution down from the longest answers. "At least half" is meant literally: the walk stops on a bucket boundary, and claiming exactly half would be a precision the histogram does not have. The threshold named is always a bucket edge, so "calls answering with more than N tokens" is exact.
Counted in fixed buckets in the pass profileUsage already makes — 64-token
resolution where answers actually land, coarser in the tail — so memory is bounded
by slices × touched buckets, not by the log. Per label and model, because a
distribution mixed across two prices describes neither. outputShapes and
createOutputShapeTracker are exported from @trazum/core.
Fixed#
1 calls, and 1 llamadas in Spanish. Reachable on ordinary input — a
one-call log, a label covering one call, a slice of one — on the totals line, the
breakdown rows and the levers.
Two messages in the English catalogue already did the agreement by hand while a
dozen did not, so the fault was never that somebody forgot: getting it right was a
choice made per message. Both catalogues have a plural helper now and the count
arrives already agreeing with its noun, so the next message written gets it for
free and neither language can get it right while the other does not.
The guard runs over both catalogues rather than over a list of strings, and checks
the plural as well as the singular — a fix that hard-coded 1 call would have
passed every assertion about one and been wrong on every real log.
Following this tool's own recording recipe produced a report that asked for two
more fields. The onboarding message described a log with a model and a usage
object; the headline README snippet carried label marked "optional" and no
session at all. A reader who copied either was told on their first run that no
call carried a session, and — since #128 — that no call carried a label, so the two
largest findings the command makes could not be made.
There is one recipe now and it is complete. label says which workload and
session says which conversation; both are one line, neither can contain prompt
text, and the session key is grouped by and never printed. A test records the
documented snippet and fails if the report complains about anything, so the docs
and the tool cannot drift apart again.
A log with no labels was reported as though unlabelled were a workload. A
2,000-call classifier and a 400-call RAG pipeline with no label between them merge
into one slice, and the levers section then offered a single route for both —
two workloads that need different answers, priced as one.
Worse in trazum route, which measures exactly one prompt: it named
unlabelled on Claude Opus 5 → Claude Sonnet 5, worth $14.88 and would have
attributed that verdict to a figure covering 2,400 calls the measurement never
touched. A number describing something other than what was measured, which is the
fault this repository keeps finding in itself.
Both say so now. The conversation-growth section already told the reader to add its field when it was missing; labels got the same treatment, because the fix is one line in their logger and it is what makes every figure below attributable.
Three product faults, found by running the tool as a new user would rather than by reading it.
optimize never said where the money was. It is the first command anybody
runs, and it reports the smallest line item on the bill — measured, about 1%. On
the bundled example it prints -0.4% and no rule found anything to trim, and
then stopped. Everything that moves 40% to 80% lives in profile, which needs a
usage log a new reader does not have and has no reason to go looking for. A tool
that learned that and only said it in the command you reach last has not said it.
Every optimize run now closes with the four levers named and the command that
prices them.
A named scenario was answered with a hint to name it. Inside Claude Code the
report switches to tokens-only, and --calls 50000 was met with "pass --cost if
this prompt is bound for a metered API" — telling somebody to do the thing they had
plainly just tried to do. It now says the scenario went unpriced and why.
The first attempt at this made --calls imply --cost, which was wrong and the
existing tests were right to fail it: --calls is a scenario parameter with a
default that several commands take purely to size a finding, so making it price
things would hand dollar figures to anybody who had put it in an alias precisely
because they had configured the tool not to show them. --cost stays the one way
to ask.
A line that said nothing twice. A 225-token prompt against a million-token
window reported Context window: 0.0% → 0.0% — the one line whose job is to say
what a saved token buys. It now distinguishes three cases, and the first attempt at
that was itself wrong: equal shares can mean "nothing against a million tokens" or
"10% of a Haiku window that one token did not move", and using the negligible
wording for both told a reader holding a tenth of the window they were under a
tenth of a percent. Caught by its own test.
Added#
trazum profile now measures what re-sending the conversation costs.
A chat or agent workload sends the whole conversation back on every turn: turn one is a system prompt and a question, turn twenty is a system prompt, nineteen previous exchanges and a question. On an agent bill that growth is routinely the largest single line, and nothing in this package could see it — a prompt file shows the system prompt and not the history, and a total shows the sum and not the shape.
What re-sending the conversation costs
agent on Claude Opus 5: input goes from 600 tokens on the opening turn to
5,000 on the closing one, over conversations of up to 12 turns.
If every turn had cost what its own first turn cost, that input would have
been $7.20 instead of $33.60 — so at most $26.40 of this bill is
conversation growth (57.9%).Reported as a ceiling: what the workload would have cost if every turn had cost what its own first turn cost. That subtraction is exact; the split between re-sent history and the user's own new messages is not knowable from counts, and inventing one would be the flattering direction. Saying nothing because the split is unknowable would be worse.
It needs one field — session, or conversation_id, whichever the log already has
— and Trazum never prints it. In a real log a session key is often an account id,
a ticket number or an email address, so it is used to group calls and count turns,
every figure comes out per label, and tests assert the value appears nowhere in the
report or in --json. A log with no session field says so rather than staying
quiet: "nothing recorded" and "nothing to report" are answers a reader would act on
differently.
Measured in the pass profileUsage already makes, so a megabyte log is never held
in memory: what the tracker keeps is bounded by the number of conversations.
conversationGrowth and createConversationTracker are exported from
@trazum/core.
trazum route — the loop the levers section could only point at.
profile prices a route exactly: the same tokens at a cheaper model's published
rate. It can say nothing whatever about whether that model still does the job, so
it printed a figure and a homework assignment — and homework does not get done.
trazum route usage.jsonl --prompt-file prompts/support.txt --cases cases.txt --yes support-rag on Claude Opus 5 → Claude Sonnet 5, worth $12.60 of this bill (60.0%).
The cheaper model agrees with the original 94% of the time. The original
agrees with itself 91% of the time — that is the yardstick, not 100%.
✓ HOLDS — the difference is inside the original model's own noise.It finds the slice worth the most on its own, so the reader does not have to know which workload to point it at. The yardstick is the expensive model's own run-to-run variance, measured on the same cases in the same run: a route is safe when the cheaper model agrees with the original more closely than the original agrees with itself, and any other bar would be a number somebody chose.
Three provider calls per case — two on the original, one on the candidate — and it
prints the count and stops unless --yes is given, exactly as prune does. It
reports INCONCLUSIVE rather than inventing a verdict, and says agreement is not
correctness on every verdict including the good one.
evaluate gains candidateProvider, which is the whole routing axis and needed no
new yardstick — the baseline still runs twice on the original model. EvalReport
gains candidateModel, because a report naming one model could not say what it had
compared.
Fixed#
The levers section named a command that cannot test a route. It printed
trazum eval <prompt> --cases <cases> --model <candidate>, and eval runs against
whatever TRAZUM_LLM_MODEL says — --model only prices the report. The
instruction sent the reader to a measurement that never touched the candidate
model. It names trazum route now, which does.
trazum profile now prices what would actually move the bill — the answer to
the fairest complaint this product has had.
"if it only saves €200 to a company spending €20k, it's rubbish"
The €200 is right. The rules recover about 1%: three tokens out of three hundred and six, measured on an ordinary support prompt. The conclusion is not that the number is wrong but that shortening the prompt was never where the money was.
| lever | what it moves |
|---|---|
| which model the call goes to | Opus 5 → Sonnet 5 is 40% off; → Haiku 4.5 is 80% |
| the Batch API | 50% flat, on input and output |
| prompt caching | 3–4× the rules |
| shortening the prompt | ~1% |
So the report prices the other rows, from the log the reader already has:
What would actually move this bill
→ support-rag on Claude Opus 5 — up to $16.80 of this bill (52.2%)
400 calls, $21.00 spent
· route it to Claude Sonnet 5, $12.60
· send it through the Batch API, $10.50
Whether that holds is an evaluation question, not an arithmetic one, and
nothing here has seen a single answer. Measure it: trazum eval <prompt>
--cases <cases> --model claude-sonnet-5
For comparison: shortening the prompt text can touch $18.00 at the very
most — 85.7% of this bill, and only if you deleted every input token.On that estate the levers come to 80% of the bill. Every figure is arithmetic on tokens that were billed: the same counts at another model's published rate, the same tokens at the provider's batch multiplier. Nothing modelled, nothing extrapolated.
Four refusals, each of them a bug caught while building it:
- The options are combined, never summed. Batching a routed call discounts the cheaper model, so the pair is $16.80 — not the $23.10 an addition gives, which is more than the $21.00 that slice had ever cost.
- A route is never called safe. That is a quality question arithmetic cannot
answer, and this has seen no prompt and no answer. It prints the
evalcommand instead of a recommendation, and steps down one capability rung rather than to the cheapest model on the shelf — frontier to small is a bigger number and a different product. - No figure is "per month". A log covers whatever period somebody recorded.
- Nothing crosses a vendor. A cheaper model at another provider is a migration.
The ceiling on prompt shortening prints underneath, on purpose: a 1% win reported without saying 1% of what is not information. It counts retrieved context and conversation history too, so it is generous — the real figure is far below it.
profileUsage gains byLabelAndModel, because a route is decided per model and a
label spanning two of them has no single answer. billLevers is exported from
@trazum/core.
Fixed#
Four faults in the cache verdict, found by an adversarial review of the code that had just been written. Sixteen agents across four lenses, every finding handed to an independent verifier told to refute it. Ten survived, and they reduce to four.
The verdict was computed from a total the code itself calls a floor. A log
carrying only the flat cache_creation_input_tokens cannot say which TTL a write
used, so the cheaper 5-minute rate is assumed — and that assumption moves the
verdict, not only the total. Reported delta is 0.25w - 0.9r; at the 1-hour
rate the truth is w - 0.9r, so the sign disagrees for any workload reading
back between 0.28 and 1.11 tokens per token written. Measured on a million written
against three hundred thousand read back: Caching took $0.1000 off this bill,
where the truth at 2x was a $3.65 loss. A $3.75 swing across the sign, taken
in the flattering direction, printed as a fact.
The economics now carry worstCaseDeltaUsd and worstCaseVerdict, priced per
model because the ratio between the two rates is 1.6 on Anthropic and 1.0 where a
write costs what input costs. When the two verdicts disagree, neither is reported
— and the confident sentence does not print at all, which is the second half of
the fix: the first attempt added a caveat and left the assertion above it.
Losing labels were named by bill size and truncated at three in silence, while the money beside them was summed over every loser. Four bleeding labels printed three names and a figure charging them with a fourth's loss, and the worst cache in an estate — usually on a small workload — was the one dropped. Ranked by loss now, with the remainder counted.
"Caching pays off overall" printed under a total the line above had just called level. The sentence no longer restates a verdict it is not in a position to make.
A pricing overlay could not declare multipliers, so a model added through
--pricing inherited Anthropic's 1.25x/2x writes. Trazum computed a premium that
provider never charged, reported an impossible caching loss, and told the reader
to turn caching off — while three documents claimed that could not happen to a
provider whose writes cost what input costs. Overlays carry multipliers now,
validated like every other key: an unknown rate name is an error with a
suggestion, a zero multiplier is refused along with the negatives, and batch: null stays distinct from leaving it out.
Added#
trazum profile now says whether the caching actually paid for itself — the
one finding in this repository that can contradict the advice the rest of it
gives.
Trazum tells people to cache. On Anthropic a cache write costs 1.25x plain input, and 2x at the one-hour TTL, so a prefix that changes faster than it is reused pays that premium and gets nothing back: those calls are cheaper with caching switched off. Nothing else on the report could say so. The cache hit rate cannot — it reads 97.8% on the log used to test this, while one of the two workloads on it is burning money.
Cache hit rate 97.8% of billable input.
Caching took $0.2675 off this bill, against the same tokens uncached.
! Caching pays off overall, but it costs $0.1250 on: rag. The total hides that.Computed per label as well as over the whole log, because that is the case worth having it for: a profitable cache on one workload and a bleeding one on another net out to a comfortable total, and an aggregate is exactly where a loss like that hides. Both sides are priced per model, so a provider whose writes cost the same as plain input — OpenAI, Gemini — is never accused of a loss it cannot have and could not switch off if it did.
This is the only counterfactual in profile, and it is not an exception to the
module's no-savings rule so much as the line that rule draws. A saving means
imagining a prompt nobody wrote. This means imagining the same tokens at a
different rate, which is arithmetic: caching changes the multiplier on a token,
never the token.
--json carries the verdict as cache and cacheByLabel rather than leaving a
consumer to re-derive it — positive deltaUsd means worse, the opposite of
every other figure Trazum emits, and two implementations of that convention would
eventually disagree. cacheEconomics is exported from @trazum/core.
Fixed#
profile claimed caching had never been used on a bill made of cache writes.
The message was keyed off a null cache hit rate, and the rate is undefined — zero
reads over zero attempts — on a log whose calls are entirely cache writes with no
plain input. So "Caching was never used on these calls" printed above a bill that
was 96% cache writes. It is keyed off whether caching was used now, which is a
different question and the one the sentence asks.
Three faults in profile, found by an adversarial review of the code that had
just been written, and all three understated the bill. Twenty-four agents across
four lenses — money honesty, the parser, the report's claims, security — each
finding then handed to an independent verifier told to refute it. Everything that
survived was in the flattering direction, which is the one direction this tool
exists not to take.
A 1-hour cache write was priced at the 5-minute rate. Anthropic charges 1.25x
input for a 5-minute entry and 2x for a 1-hour one. cacheWrite1h was computed
in pricing.ts and never used by anything. Ten million tokens of 1-hour writes on
Opus 5 reported $62.50 against a real $100.00 — 37.5% under, on the largest
line of that bill, silently.
Worse, the information needed was in the log and was being thrown away: the API
returns a cache_creation object splitting the two, and the parser read only the
flat total. It reads the split now. When a log carries only the flat count the
cheaper rate is used and the report says so — the total is a floor for those
calls, and it uses the word.
A count that was present but unreadable became a silent zero. The guard was
if (input < 0 && output < 0) — an AND — so a record survived when only one of the
two failed to parse. A stringified "200000" out of jq, or a null out of a
Postgres JSON round-trip, produced a clean zero indistinguishable from a real one,
and the line never reached skippedLines, so nothing on screen said a number had
been dropped.
Measured: $0.0150 against a true $2.015, and the headline flipped to "output is 100% of this bill, so shortening prompts has a low ceiling" on a workload that was almost entirely prompt. The one piece of advice the command exists to give, exactly inverted.
Absent and corrupt are different things now. An absent field is a zero somebody may
legitimately mean — a log recording only what its author cared about is not
corrupt. A field that is there and unusable rejects the line, which puts it in
skippedLines where the report names it.
A wholly unpriced log printed a report of zero rather than no report. The empty
guard required both the priced and unpriced counts to be zero, so a log whose every
model was unknown fell through and printed a full report built from a zeroed total:
0 calls · $0, four zero rows, a meaningless "Input is 0.0% of this bill", and — on
a log holding a hundred thousand cache-read tokens — the flatly false "Caching was
never used on these calls." Two affirmatively wrong claims, and the only correct
line on screen was the quietest one.
Added#
trazum profile <log.jsonl> — the command on top of the usage reader. Reads a
usage log and prints where the money went: the bill, the split across input, cache
reads, cache writes and output with each one's share, the cache hit rate that
actually happened, and a breakdown by label and by model.
It leads with the part of the bill worth arguing with. When output is over half it
says so and names the two controls that move it — shorter answers and
max_tokens — because at that point shortening prompts has a low ceiling and the
rest of this tool is about shortening prompts.
Money is never suppressed here, unlike every other report. The rest of the CLI hides dollar figures on a subscription host, because a saving quoted to somebody on a flat plan is money that does not exist. This log records metered API calls somebody was already billed for: the bill exists wherever Trazum happens to be running, so the host has no bearing on it. A test pins that, since the general rule is the opposite.
Every part prints, including the zero rows. A row missing because it was zero reads as a row somebody forgot, and "your cache writes are zero" is a finding — it is how you see at a glance that caching is off.
Fixed#
The headline claim printed twice. When output was both the largest part and over half, the report said "Output is 61.8% of this bill" and then "Output is 61.8% of this bill, so shortening prompts has a low ceiling here" on the next line. The same fact in adjacent lines reads as a bug because it was one; only the sentence that says more prints now.
The command-count guard could not tell a live claim from a record. It covers
RELEASES.md, which was right — the count drifted there once and went unnoticed
for two merges — but it read the whole file, so "Twelve commands now, up from four"
in the 1.8.0 notes failed against a thirteenth command. That sentence is true
about 1.8.0.
Below the first version heading RELEASES.md is a record, and rewriting it to
match the present is falsifying history to satisfy a test. The standing header is
still checked, which is where the drift it was written for actually lived — proven
by reintroducing that drift and watching it fail.
The second guard in this release to need that distinction, after the one on the published error band. Worth noticing as a pattern: a file that mixes current claims with dated ones needs a guard that knows which half it is reading.
Added#
profileUsage — reading what the provider actually charged, rather than
estimating what a file would cost. The first piece of the answer to the thing
this release measured and could not fix: on an ordinary support prompt the
deterministic rules recover about 1% of the monthly figure, while output
tokens alone were 87% of it. A tool that reads prompts/*.txt cannot see
retrieved context, conversation history, tool results or answers, and on a RAG or
agent workload those are nearly the whole invoice.
It takes a JSON Lines usage log and says where the money went — by label, by model, split across input, cache reads, cache writes and output — plus the cache hit rate that actually happened.
It reads a file, and that is the design. Not a proxy, not an SDK wrapper. Trazum's security position is that prompts do not leave the machine they are on, asserted by tests rather than promised, and sitting in the request path trades that away for convenience.
The format is the one the API already returns. model plus the usage object
from any Anthropic response, flattened or nested. OpenAI's shape is accepted too,
with the one real difference handled: OpenAI counts cached tokens inside
prompt_tokens while Anthropic reports them beside input_tokens, so treating
them alike bills the cached half at the full rate as well as the cached rate.
There is nowhere to put prompt text. The record shape has no content field, so a usage log handed to Trazum cannot contain a prompt even by accident — a stronger promise than "we do not look at it".
And it reports no saving, deliberately. Attributing "you could have saved X" to a call that already happened means guessing what the call should have been, which is exactly what this exists to stop doing.
Fixed#
A model the catalogue does not know was making the total too low. Found in the
first smoke run of the module above, and it is the same fault as the three
advisories fixed earlier in this release: counts were accumulated before the
price lookup could fail, so an unpriced call contributed its tokens to the totals
and its dollars to nothing. total.inputTokens included it, total.inputUsd did
not, and a cost-per-token taken from that report was wrong by however much of the
log was unpriced — silently, and in the flattering direction.
A production log will contain models this catalogue has never heard of: a fine-tune, a preview, a competitor. They are now kept entirely separate, so every token in the priced total is a token the dollars describe, and the size of what could not be priced is visible rather than folded into a number that looks complete.
Fixed#
A high-severity advisory in nanoid, reachable only from the web app's build.
GHSA-2v37-7h3g-55p8 — a custom generator can loop indefinitely when size is zero.
It arrives transitively: @tailwindcss/postcss → postcss → nanoid, in
apps/web, which is private: true and deployed rather than published.
No published package is affected, and that is asserted rather than assumed.
@trazum/core carries zero dependencies and the CLI and MCP server carry only each
other, which security.test.js enforces from the root workspaces globs. The
exposure was a build-time tool in a private app.
Fixed in the lockfile, 3.3.17 → 3.3.18, and verified transitively rather than by
reading npm audit once. That distinction is in SECURITY.md for a reason: the last
time this repository cleared an advisory, Dependabot raised the direct dependency to
next@16 and left the vulnerable postcss and sharp pinned in the lockfile, so
the advisories survived the upgrade meant to fix them. Reinstalled from the lockfile
and re-audited: 0 vulnerabilities.
Changed#
The README's action pin advanced to the 1.10.0 commit. It can only move after
the merge it names exists — security.test.js asks git what version the pinned
commit declares in its own manifest, so a pin cannot be advanced inside the commit
it points at and cannot carry a label its target does not have.