Receipts
Three kinds of signed and shareable artifacts share the word "receipt." The first two are demonstrated live on the Waste demo; the third on the session demo — not just described here.
1. Signed cache-hit / API-call receipt (the cryptographic one)
Every cache HIT — and every receipted third-party API call made through the
pipe — can carry a detached, signed proof of what happened: a compact JWS
(EdDSA/Ed25519) in the X-Ohm-Receipt response header (X-Metrecept-Receipt
is dual-emitted with the identical JWS), stating the
exact-replay identity (request_sha256), the upstream tokens that were
not re-bought (tokens_replayed), and what the call was billed
(pipe_usd). It is minted per call, so it works even on the demo's shared
public key — it proves one call, not an aggregate.
On the Waste demo, run Prove miss → HIT: the panel
that appears under call 2 decodes that receipt's fields in place and has a
Verify signature in this browser button that checks the Ed25519 signature
against the live /.well-known/http-message-signatures-directory with
nothing but WebCrypto — no Metrecept code runs the check.
Verify the same receipt cold, from a terminal, with no Metrecept code either:
# 1. Capture a receipt (identical request twice; second one is the HIT)
curl -si https://api.withohm.dev/v1/chat/completions \
-H "Authorization: Bearer $OHM_API_KEY" -H "Content-Type: application/json" \
-d '{"model":"mock","messages":[{"role":"user","content":"receipt demo"}]}' \
| grep -i x-ohm-receipt
# 2. Verify it against the public key directory
python scripts/verify_receipt.py "<X-Ohm-Receipt value>" --base https://api.withohm.dev
Full field reference and the "why" behind it: Trust — verify it yourself.
2. Signed session receipt (the black box)
One aggregated, signed receipt for an entire agent session — every cache hit, miss, fetch, and API call tagged with the same session id, rolled into a single verifiable record: total events, total pipe spend, and the first/last timestamps the session spanned. This is the artifact The black box is named after: a flight recorder for unattended agent runs, so "what did that agent actually do, and what did it cost" has a cryptographic answer instead of an asserted one.
Run it end to end on the session demo: three turns (a plan,
a byte-identical re-check that HITs, and a draft) close into one signed
receipt, decoded and verified in the browser the same way as a cache-hit
receipt above — same signature scheme, same public-key directory, different
kind of claim.
3. Public savings receipt (the shareable one)
A separate, opt-in aggregate snapshot of a tenant's cache savings — an
immutable page at /r/{token} plus a README badge, minted via
POST /v1/savings/receipt (or the ohm_receipt MCP tool). It is
estimate_only, not signed, and exists to be shared publicly (e.g. "My
monthly savings simply from choosing Metrecept").
On the demo, this is the Mint public receipt button — gated to your own key, because minting it on the shared demo key would blend every visitor's runs into one receipt, which would not be honest to publish.
What you see on the demo
- First identical call → MISS — routes BYOK (or mock); pipe rent
ohm_cache_miss. - Second identical call → HIT — Ephemeral Redis replay; labs silent; pipe rent
ohm_cache_hit; carries the signed receipt above. - Dual ledger — estimated provider spend avoided vs Metrecept pipe rent (
/v1/savings).
Next
- The black box — what a receipt proves, and what it deliberately doesn't
- Waste demo — run the cache-hit receipt yourself
- Session demo — run the session receipt yourself
- Create Account — Intermediate email + password
- Attach in Cursor
- Architecture