Skip to content
Trazum

Open source · Local analysis · No provider key needed to get started

Know what your AI agents cost, per project, without your prompts leaving the machine.

Start here: one command, no global install.

npx @trazum/cli bill
npx @trazum/cli bill examples/claude-projectsYour bill ────────────────────────────────────────────────────────────────  $12.70 across 126 priced call(s)  project               calls    USD  share  home-me-etl-pipeline     42  $9.05  ███████░░░  71.2%  home-me-webapp           84  $3.66  ███░░░░░░░  28.8%  model              calls      USD  share  claude-fable-5-1      28    $9.00  ███████░░░  70.9%  claude-opus-5-5       56    $2.95  ██░░░░░░░░  23.2%  claude-sonnet-5-5     28  $0.7077  █░░░░░░░░░   5.6%  claude-haiku-5-5      14  $0.0456  ░░░░░░░░░░   0.4%  This log covers 2026-09-01 → 2026-09-14 (13.3 days): stated, never  extrapolated. Scale it to a month yourself, now that you know what it  covers.  ! Agent sessions (Claude Code, Codex, Gemini CLI) are priced at catalogue    API rates. On a subscription you paid the plan, not this API-equivalent    estimate; missing telemetry and custom rates can change the result.  The receipt as data: --receipt, or -o receipt.json. The document for  whoever pays: --pdf-out bill.pdf.
npx @trazum/cli bill examples/claude-projectsYour bill ────────────────────────────────────────────────  $12.70 across 126 priced call(s)  project               calls    USD  share  home-me-etl-pipeline     42  $9.05  ███████░░░  71.2%  home-me-webapp           84  $3.66  ███░░░░░░░  28.8%  model              calls      USD  share  claude-fable-5-1      28    $9.00  ███████░░░  70.9%  claude-opus-5-5       56    $2.95  ██░░░░░░░░  23.2%  claude-sonnet-5-5     28  $0.7077  █░░░░░░░░░   5.6%  claude-haiku-5-5      14  $0.0456  ░░░░░░░░░░   0.4%  This log covers 2026-09-01 → 2026-09-14 (13.3 days):  stated, never extrapolated. Scale it to a month yourself,  now that you know what it covers.  ! Agent sessions (Claude Code, Codex, Gemini CLI) are    priced at catalogue API rates. On a subscription you    paid the plan, not this API-equivalent estimate; missing    telemetry and custom rates can change the result.  The receipt as data: --receipt, or -o receipt.json. The  document for whoever pays: --pdf-out bill.pdf.
npx @trazum/cli check examples/examples/, 3 prompts ─────────────────────────────────────────────────────  All 3 within budget.  OK      235 / 600   examples/sample-prompt.en.txt  OK      316 / 600   examples/sample-prompt.es.txt  OK      326 / 600   examples/support-prompt.txt  Against the baseline  unchanged at 877 tokens  Monthly cost $11.88 → $11.88 ($0)echo $?0
npx @trazum/cli check examples/examples/, 3 prompts ─────────────────────────────────────  All 3 within budget.  OK      235 / 600   examples/sample-prompt.en.txt  OK      316 / 600   examples/sample-prompt.es.txt  OK      326 / 600   examples/support-prompt.txt  Against the baseline  unchanged at 877 tokens  Monthly cost $11.88 → $11.88 ($0)echo $?0
cd examples/claude-projects/-home-me-webappecho '{"session_id":"demo","transcript_path":"demo-webapp.jsonl"}' |    npx @trazum/cli session-guard check \    --warn 1 --stop 5 --on-cannot-tell fail-open{"systemMessage":"Trazum: this session has reached $3.66 in API-equivalent cost. Your warning figure is $1.00 and it stops at $5.00. API-equivalent is what this usage would cost at the provider's list API prices, not what you were charged. This is said once per session."}echo $?0echo '{"session_id":"demo","transcript_path":"demo-webapp.jsonl"}' |    npx @trazum/cli session-guard check \    --warn 1 --stop 3 --on-cannot-tell fail-openTrazum: stopped. This session has reached $3.66 in API-equivalent cost, at or over your stop figure of $3.00. API-equivalent is what this usage would cost at the provider's list API prices, not what you were charged. To go on, raise the figure: trazum session-guard install --warn <usd> --stop <usd> --on-cannot-tell <fail-open|fail-closed>.echo $?2
cd examples/claude-projects/-home-me-webappecho '{"session_id":"demo","transcript_path":"demo-webapp.jsonl"}' |    npx @trazum/cli session-guard check \    --warn 1 --stop 5 --on-cannot-tell fail-open{"systemMessage":"Trazum: this session has reached $3.66 in API-equivalent cost. Your warning figure is $1.00 and it stops at $5.00. API-equivalent is what this usage would cost at the provider's list API prices, not what you were charged. This is said once per session."}echo $?0echo '{"session_id":"demo","transcript_path":"demo-webapp.jsonl"}' |    npx @trazum/cli session-guard check \    --warn 1 --stop 3 --on-cannot-tell fail-openTrazum: stopped. This session has reached $3.66 in API-equivalent cost, at or over your stop figure of $3.00. API-equivalent is what this usage would cost at the provider's list API prices, not what you were charged. To go on, raise the figure: trazum session-guard install --warn <usd> --stop <usd> --on-cannot-tell <fail-open|fail-closed>.echo $?2
npx @trazum/cli bill examples/claude-projects \    --agent claude-code --timezone Europe/Madrid --by weekYour bill ────────────────────────────────────────────────────────────────  $12.70 across 126 priced call(s)  project               calls    USD  share  home-me-etl-pipeline     42  $9.05  ███████░░░  71.2%  home-me-webapp           84  $3.66  ███░░░░░░░  28.8%  model              calls      USD  share  claude-fable-5-1      28    $9.00  ███████░░░  70.9%  claude-opus-5-5       56    $2.95  ██░░░░░░░░  23.2%  claude-sonnet-5-5     28  $0.7077  █░░░░░░░░░   5.6%  claude-haiku-5-5      14  $0.0456  ░░░░░░░░░░   0.4%  week      calls      USD  share  2026-W36     54    $5.43  ████░░░░░░  42.8%  2026-W37     63    $6.36  █████░░░░░  50.1%  2026-W38      9  $0.9107  █░░░░░░░░░   7.2%  One week on its own: --since 2026-09-14 --until 2026-09-20.  Add --timezone Europe/Madrid to bill it on the same days.  This log covers 2026-09-01 → 2026-09-14 (13.3 days): stated, never  extrapolated. Scale it to a month yourself, now that you know what it  covers.  Days are cut in Europe/Madrid, not UTC: a bare --since/--until day is a  day there, and so is every row above.  ! Agent sessions (Claude Code, Codex, Gemini CLI) are priced at catalogue    API rates. On a subscription you paid the plan, not this API-equivalent    estimate; missing telemetry and custom rates can change the result.  The receipt as data: --receipt, or -o receipt.json. The document for  whoever pays: --pdf-out bill.pdf.
npx @trazum/cli bill examples/claude-projects \    --agent claude-code --timezone Europe/Madrid --by weekYour bill ────────────────────────────────────────────────  $12.70 across 126 priced call(s)  project               calls    USD  share  home-me-etl-pipeline     42  $9.05  ███████░░░  71.2%  home-me-webapp           84  $3.66  ███░░░░░░░  28.8%  model              calls      USD  share  claude-fable-5-1      28    $9.00  ███████░░░  70.9%  claude-opus-5-5       56    $2.95  ██░░░░░░░░  23.2%  claude-sonnet-5-5     28  $0.7077  █░░░░░░░░░   5.6%  claude-haiku-5-5      14  $0.0456  ░░░░░░░░░░   0.4%  week      calls      USD  share  2026-W36     54    $5.43  ████░░░░░░  42.8%  2026-W37     63    $6.36  █████░░░░░  50.1%  2026-W38      9  $0.9107  █░░░░░░░░░   7.2%  One week on its own: --since 2026-09-14 --until  2026-09-20.  Add --timezone Europe/Madrid to bill it on the same days.  This log covers 2026-09-01 → 2026-09-14 (13.3 days):  stated, never extrapolated. Scale it to a month yourself,  now that you know what it covers.  Days are cut in Europe/Madrid, not UTC: a bare  --since/--until day is a day there, and so is every row  above.  ! Agent sessions (Claude Code, Codex, Gemini CLI) are    priced at catalogue API rates. On a subscription you    paid the plan, not this API-equivalent estimate; missing    telemetry and custom rates can change the result.  The receipt as data: --receipt, or -o receipt.json. The  document for whoever pays: --pdf-out bill.pdf.
npx @trazum/cli optimize examples/support-prompt.txtStart here ───────────────────────────────────────────────────────────────  "This task may not need Claude Opus 5", $8.34/month, 13× what the rules  saved.Input tokens  326 → 202   -38.0% (estimated, ±6%)Rules applied  [safe] Repeated paragraphs (1×, ~72 tokens)  [safe] Wordy phrasing (2×, ~6 tokens)  [safe] Politeness formulas (8×, ~34 tokens)  [safe] Filler and throat-clearing (2×, ~11 tokens)Cost with Claude Opus 5  1,000 calls/month · 300 output tokens per call  $9.13 → $8.51   saving $0.6200/month (6.8%)Beyond shortening the prompt  → $8.34  This task may not need Claude Opus 5           By length and vocabulary the prompt looks like "small" complexity.           On Claude Haiku 5.5 you would go from $8.51 to $0.1702 per month.           This is a keyword heuristic, not a judgement about answer quality.           Measure it before switching in production: `trazum route           <log.jsonl> --prompt-file <prompt> --cases <cases> --yes` sends the           same cases to both models and reports whether the cheaper one still           does the job.  → $4.25  If the work tolerates latency, use the Batch API           The Batch API applies a 50% discount on both input and output. Most           batches finish in under an hour, with a 24-hour maximum. It fits           bulk classification, data enrichment or evaluations: anything that           is not answering a user in real time.  ·        Below the cacheable minimum           Claude Opus 5 needs at least 512 prefix tokens to cache; here the           first variable placeholder ({{question}}) shows up at ~186 tokens           and only what precedes it can be cached. Setting cache_control will           not error, it simply will not cache.  ·        Your cost is in the output, not the prompt           Output accounts for $7.50 per month against $1.01 of input.           Shortening the prompt has a low ceiling here. The two controls that           move the needle are the effort parameter (lower it when the task is           not reasoning-heavy) and explicitly asking for concise answers.  Shortening a prompt is the smallest lever there is: measured on an  ordinary support prompt, the rules recover about 1% of a monthly bill. On  a metered API the things that move 60% to 80% are which model the call  goes to, the Batch API, prompt caching, and what re-sending the  conversation costs, and "trazum profile <usage.jsonl>" prices all four  from what the provider actually charged. Recording that log is a few lines  and it never contains prompt text.
npx @trazum/cli optimize examples/support-prompt.txtStart here ───────────────────────────────────────────────  "This task may not need Claude Opus 5", $8.34/month,  13× what the rules saved.Input tokens  326 → 202   -38.0% (estimated, ±6%)Rules applied  [safe] Repeated paragraphs (1×, ~72 tokens)  [safe] Wordy phrasing (2×, ~6 tokens)  [safe] Politeness formulas (8×, ~34 tokens)  [safe] Filler and throat-clearing (2×, ~11 tokens)Cost with Claude Opus 5  1,000 calls/month · 300 output tokens per call  $9.13 → $8.51   saving $0.6200/month (6.8%)Beyond shortening the prompt  → $8.34  This task may not need Claude Opus 5           By length and vocabulary the prompt looks like           "small" complexity. On Claude Haiku 5.5 you would           go from $8.51 to $0.1702 per month. This is a           keyword heuristic, not a judgement about answer           quality. Measure it before switching in           production: `trazum route <log.jsonl>           --prompt-file <prompt> --cases <cases> --yes`           sends the same cases to both models and reports           whether the cheaper one still does the job.  → $4.25  If the work tolerates latency, use the Batch API           The Batch API applies a 50% discount on both           input and output. Most batches finish in under an           hour, with a 24-hour maximum. It fits bulk           classification, data enrichment or evaluations:           anything that is not answering a user in real           time.  ·        Below the cacheable minimum           Claude Opus 5 needs at least 512 prefix tokens to           cache; here the first variable placeholder           ({{question}}) shows up at ~186 tokens and only           what precedes it can be cached. Setting           cache_control will not error, it simply will not           cache.  ·        Your cost is in the output, not the prompt           Output accounts for $7.50 per month against $1.01           of input. Shortening the prompt has a low ceiling           here. The two controls that move the needle are           the effort parameter (lower it when the task is           not reasoning-heavy) and explicitly asking for           concise answers.  Shortening a prompt is the smallest lever there is:  measured on an ordinary support prompt, the rules recover  about 1% of a monthly bill. On a metered API the things  that move 60% to 80% are which model the call goes to, the  Batch API, prompt caching, and what re-sending the  conversation costs, and "trazum profile <usage.jsonl>"  prices all four from what the provider actually charged.  Recording that log is a few lines and it never contains  prompt text.
npx @trazum/cli modelsModels and pricing  (USD per million tokens) ─────────────────────────────  Table reviewed on 2026-11-05 (11 days ago). Verify before budgeting.  Per provider: 2026-11-05 (11 days ago) moonshot, deepseek, xai, mistral · 2026-11-16 (today) anthropic, openai, google  model                               input       output     context  cache min.  claude-fable-5-1                       10           50      1,000K         512  claude-opus-5-5                         4           20      1,000K         512  claude-sonnet-5-5                       2           10      1,000K         512  claude-haiku-5-5                      0.1          0.5      1,000K         512  … 4 of 91 rows shown: the models the receipt priced.  Run with the clock set to 2026-11-16, the day the newest rates were read.
npx @trazum/cli modelsModels and pricing  (USD per million tokens) ─────────────  Table reviewed on 2026-11-05 (11 days ago). Verify before budgeting.  Per provider: 2026-11-05 (11 days ago) moonshot, deepseek, xai, mistral · 2026-11-16 (today) anthropic, openai, google  model                               input       output  claude-fable-5-1                       10           50  claude-opus-5-5                         4           20  claude-sonnet-5-5                       2           10  claude-haiku-5-5                      0.1          0.5  … 4 of 91 rows shown: the models the receipt priced.  Cut after output to fit 60 columns: context, cache min.  not shown.  Run with the clock set to 2026-11-16, the day the newest  rates were read.

Example file

npx @trazum/cli bill examples/unpriced-model.jsonlYour bill ────────────────────────────────────────────────────────────────  $0.0145 across 3 priced call(s)  workload  calls      USD  share  triage        3  $0.0145  ██████████  100.0%  model             calls      USD  share  claude-haiku-5-5      3  $0.0145  ██████████  100.0%  This log covers 2026-09-02 → 2026-09-02 (0.1 days): stated, never  extrapolated. Scale it to a month yourself, now that you know what it  covers.  ! Not in the total: 2 call(s) to llama-3.3-70b-instruct, which the    catalogue does not price. Named, never counted as $0.  The receipt as data: --receipt, or -o receipt.json. The document for  whoever pays: --pdf-out bill.pdf.
npx @trazum/cli bill examples/unpriced-model.jsonlYour bill ────────────────────────────────────────────────  $0.0145 across 3 priced call(s)  workload  calls      USD  share  triage        3  $0.0145  ██████████  100.0%  model             calls      USD  share  claude-haiku-5-5      3  $0.0145  ██████████  100.0%  This log covers 2026-09-02 → 2026-09-02 (0.1 days):  stated, never extrapolated. Scale it to a month yourself,  now that you know what it covers.  ! Not in the total: 2 call(s) to    llama-3.3-70b-instruct, which the catalogue does not    price. Named, never counted as $0.  The receipt as data: --receipt, or -o receipt.json. The  document for whoever pays: --pdf-out bill.pdf.

Never crosses the line

  • The prompt text
  • The model’s answer
  • File paths
  • Branch names
  • Credentials

Trazum

Receipt · examples/claude-projects

2026-09-01 → 2026-09-14 · 126 calls

  • claude-fable-5-1$9.0028 calls · rate read 2026-11-16platform.claude.com/docs/en/about-claude/pricingrate read 2026-11-16
  • claude-opus-5-5$2.9556 calls · rate read 2026-11-16platform.claude.com/docs/en/about-claude/pricingrate read 2026-11-16
  • claude-sonnet-5-5$0.707728 calls · rate read 2026-11-16platform.claude.com/docs/en/about-claude/pricingrate read 2026-11-16
  • claude-haiku-5-5$0.045614 calls · rate read 2026-11-16platform.claude.com/docs/en/about-claude/pricingrate read 2026-11-16

Total$12.70

On a subscription, this is API-equivalent cost, not what you paid. Unpriced models are reported as gaps.

Scroll, and each object takes its turn. Press one, and the screen shows what it does.

Every line on the screen is what the CLI printed, on the example files in this repository.

What your agents cost, by project and by model.

It reads the sessions your agents already keep on disk and prints the bill. Every figure on the bill carries the rate behind it and the date that rate was reviewed.

trazum bill

What it does not do

  • It uploads nothing: it reads files already on this machine.
  • It does not extrapolate: it says which days the log covers.
  • It is not what a subscription charged you: agent sessions are priced at API rates.

Illustrative data, not a customer result. Generated from the CLI output. examples/claude-projects

A gate in CI.

Does this prompt fit its token budget, and has the repository drifted past its recorded baseline? It exits 1 when either fails.

trazum check

What it does not do

  • It calls no model and needs no provider key.
  • It does not rewrite your prompts: it measures them.
CI recipes

A spend limit for a Claude Code session.

At the first figure it warns once; at the second it stops the session, with exit code 2.

trazum session-guard

What it does not do

  • It has no default figures: both are yours to set.
  • It never counts a cost it cannot tell as $0.
  • It cannot interrupt a model response already under way.

One agent, by week, on your calendar.

--agent keeps one coding agent’s records, and --timezone cuts the days and weeks in your zone instead of UTC.

trazum bill --agent --timezone

What it does not do

  • Without --timezone, every day and week is a UTC one.
  • It does not pass a narrower bill off as the whole one: it says how many records it left out.

Trim a prompt without calling a model.

Twelve deterministic rules: same input, same output, never touching code, URLs, email addresses or placeholders.

trazum optimize

What it does not do

  • It does not send your prompt anywhere.
  • It does not promise a smaller bill: trimming is the smallest lever there is.
Try it in the browser

Rates read, not remembered.

Every price comes from the provider’s own page, and each provider carries the date its page was read.

trazum models

What it does not do

  • It never derives or estimates a price.
  • A model with no published price is kept out of the total, never counted as $0.

Why the number holds up

Published rates, checked against the provider every week.

A scheduled job compares every Anthropic and OpenAI price here with the provider’s own pricing page and fails the build when one moves or a model is missing. Every figure on the bill carries the rate behind it and the date that rate was reviewed.

Billed the way the provider bills.

Cache reads, both cache-write lifetimes, long-prompt bands, fast mode, the Batch API, web searches and US-only inference each get their own published rate, call by call.

Nothing is guessed.

A model with no published price is named and kept out of the total, never counted as $0. A projected saving is never added to a measured one.

The screen runs bill on examples/unpriced-model.jsonl, an example log: 2 of its calls went to llama-3.3-70b-instruct, which the catalogue does not price. The bill names it and leaves it out of the total.

What never leaves the machine

Your files stay where they are. The analysis runs on your machine, on logs your tools already wrote. The CLI installs nothing from third parties: its one dependency is Trazum’s own core, which has none.

Local analysis does not upload your files. The Playground runs the CLI’s pure subset in the page, through the same @trazum/core functions the terminal runs, and nothing you paste leaves your browser.

No provider key needed to get started.

Requires Node.js 20 or newer. npx may download Trazum from npm. Or try sample data in your browser first.

What leaves A receipt, a report, a gate verdict.

npx @trazum/cli bill

What else it does

spend_guardA budget check for agents

The MCP server’s first tool asks one question before a call: may I spend this? Yes, no, or cannot-tell, against the ceilings in your trazum.config.json. Nothing is called and nothing is spent to answer.

Agent setup