Every model call leaves a receipt

A model result without identity, cost, failure history, and input integrity is a story—not an audit trail.

“We used GLM-5.3” is not enough. A serious research operation should be able to say which role called it, which model was requested, which model the router returned, what the attempt cost, whether an earlier response failed validation, and whether the inputs changed between runs.

That is why our OpenRouter client writes openrouter-call-ledger.json after every attempt—not only after a clean final answer. The ledger is public-safe by design: it exposes operational receipts without republishing credentials, unpublished evidence, or raw model output.

THE RECEIPT RULE

A successful final answer does not erase the attempts that failed, consumed tokens, or changed the evidence path.

Five layers in one call record

01

Identity

Configured model, router-returned model, role, response ID, and finish reason.

02

Time

Transport-side start time, completion time, attempt number, and measured latency.

03

Usage

Provider-returned prompt tokens, completion tokens, total tokens, and billed cost when supplied.

04

Integrity

SHA-256 receipts for the system prompt, evidence bundle, output schema, and raw response.

05

Disposition

Accepted or rejected status, plus failure type and HTTP status when a call does not validate.

Configured and returned model IDs are separate fields. That distinction matters because model identity written inside a model's own response is not authoritative. Our transport code overwrites role, model, and timestamp fields after schema validation, then records the router's response metadata alongside them.

Four hashes, four different questions

The system-prompt hash answers “did the role contract change?” The evidence hash answers “did this reviewer receive the same bundle?” The schema hash answers “did the allowed output shape change?” The response hash answers “is this the exact raw answer that produced the accepted artifact?”

Those are integrity questions, not truth questions. SHA-256 can show that two byte sequences are the same or that one changed. It cannot tell us whether a regression leaked future data, whether a citation supports a claim, or whether a fluent review missed a bug. Statistical tests, specialist criticism, visual QA, and human judgment still have separate jobs.

Failed attempts belong in the bill

A malformed response can still consume tokens and incur cost. Our client therefore flushes the ledger immediately after an accepted, schema-rejected, or transport-failed attempt. A rejected response records its failure type, status code when available, provider usage, response ID, model ID, timing, and response hash. The malformed text itself stays out of the public ledger.

The current client permits one retry and caps each response at 3,000 output tokens with a 75-second transport timeout. Those are operating limits, not claims about model intelligence. When they change, the code and subsequent receipts change with them.

What we deliberately do not publish

The ledger excludes the OpenRouter key, request headers, prompt text, evidence text, and raw response text. Public role prompts and JSON schemas are versioned separately. A prepublication evidence bundle can contain an article candidate, detailed source inventory, or analysis not yet cleared for release; publishing it merely to prove a call occurred would collapse the boundary between auditing and disclosure.

A hash preserves a verifiable identity for that private payload. If the underlying bundle is later published as part of an accepted run, anyone can recompute the hash and verify that it is the same material. Until then, the receipt proves that our system committed to one byte sequence—not what those bytes said.

Who is authoritative for what

FieldAuthorityWhat it does not prove
Model identityConfigured locally; returned identity reported by OpenRouterConfirms what was requested and what the router says answered—not underlying weights.
Usage and costReported by OpenRouterUseful for reconciliation; not an independent invoice or bank record.
TimingMeasured by our transport codeCaptures wall-clock latency from our runner, including network conditions.
HashesComputed locallyProve byte-for-byte identity when the original material is available; do not prove the material is true.
Review decisionSchema-validated model outputA structured judgment that still requires mechanical checks and publication gating.

The missing receipt stays missing

Our first gate-passing GLM-5.3 run occurred before this ledger existed. Its role artifacts record the configured model, but exact tokens, latency, response IDs, and cost were not preserved. We disclose the gap instead of reconstructing a plausible bill and presenting it as fact.

That run was later withheld for an unrelated visual-QA failure. The combination is useful: model receipts would not have caught stale words rendered inside a PNG, and visual QA cannot reconstruct a missing router bill. Transparent systems need multiple controls because no single artifact can carry every kind of trust.

Inspect the contract

AI-006

The method is part of the product.

All process notes →