Is Treasury production-ready at 1.0.0?
Yes. 60 tests pass under Vitest 4 across 11 suites with 97.7% statement coverage; TypeScript 6 maximum
strict mode is clean; Biome 2.5 lint is clean; publint and @arethetypeswrong/cli
are clean across all subpaths. The suite and the distribution smoke test are run on the Node 20, 22, and 24
matrix. Every published release carries SLSA provenance produced by GitHub Actions.
Is the forecast accurate?
The forecast is exact arithmetic over the token estimates you supply, with no tokenizer and no network, so
given those estimates the cost is exact to the micro-USD. It does not count tokens for you; you provide the
usage estimate, and Treasury prices it and brackets the total with a confidence band. If your estimates are
good, the forecast is good.
Where do the prices come from?
They are reference data as of 2026-07-01, bundled with the package and never fetched over the network, so
the engine stays deterministic and offline. Override any of them via withPrices to match your
negotiated rates, a new model, or a provider Treasury does not ship a profile for. Sixteen provider price
profiles are included out of the box.
Does Treasury call any model or network itself?
No. Treasury decides whether spend is allowed; it never makes the model call. The core is node-free and
network-free: the forecast is local arithmetic and the prices are bundled data. Your code makes the provider
call after authorize approves it, so provider keys and traffic never touch Treasury.
Does this work in Cloudflare Workers, Vercel Edge, Bun, or Deno?
Yes. The core is node-free and network-free. Import @takk/treasury or
@takk/treasury/edge on any of those runtimes and the browser. Only
@takk/treasury/node, the JSON file loaders, requires the Node standard library.
How does Treasury handle my data?
Treasury holds the budget you configure, the step estimates you pass to a forecast, and the prices it
ships or you override, nothing else. It makes no outbound network calls at all; there are no model calls to
make. With the file loaders, only the plan or price files you point it at are read from disk, and no provider
credentials are ever held by Treasury.
What exactly does authorize decide?
Given a forecast total in micro-USD, authorize checks it against your per-request, per-task,
and per-day ceilings and returns whether the spend is allowed and how much budget remains. It is a pre-flight
gate: it runs before the call, so a spend that would breach a ceiling comes back allowed: false and never
happens. Depletion events fire as a budget drains toward the line.
How is this different from Sakana Fugu?
Fugu is a closed orchestrator: it prices at the pool ceiling, its cost is unpredictable, which is its
first criticism, it is a black box, cannot be self-hosted, and is blocked in the EU. Treasury is the
opposite on every axis: cost is forecast and predictable, capped by a hard budget, transparent per step,
self-hosted on your infrastructure, and EU-friendly.
Which providers and models does it price?
It ships 16 provider price profiles covering the major families from OpenAI, Anthropic, and Google, among
others. Any model it does not ship a profile for you add with withPrices. Because pricing is
just data, extending it to a new provider or a negotiated rate is a one-line override.
Where does the state live?
In-process memory by default: the budget windows and their spend, plus the prices in effect. For
disk-backed input, load a plan or a price table from JSON with @takk/treasury/node. For an edge
runtime, keep the running spend in your own KV store between invocations and rehydrate the budget from it.
How does it keep the prefix cache profitable?
The prefix-cache planner weighs the one-time write cost against the savings from reuse, across 16 price
profiles and with 9 explicit cache-kill rules. It is guaranteed never to recommend a cache write that would
not pay for itself, so you cache when it saves money and skip when it does not, instead of guessing at every
write.
How do I verify a published version's provenance?
Every release is published with npm publish --provenance. Check the attestations with
npm view @takk/treasury@<version> --json | jq .dist.attestations. The attestation
links the tarball you installed to the GitHub Actions workflow that built it from a specific source commit.
What is the policy on breaking changes?
Strict SemVer 2.0.0, starting from 1.0.0. The binding stability surface is documented in SPEC.md section
5. Major bumps require a deprecation cycle; security fixes follow the disclosure flow in SECURITY.md.