{
  "receiptPubKey": "02b08e8821ff3e45d02a782bd07f4c4688aea49a836d5b3ca31e17d8f44fd03c1f",
  "schema": "bsvkey.usage-receipt/2",
  "envelope": "compact-bsm-secp256k1",
  "meter": "bsvkey-meter/1",
  "verify": "https://inference.bsvkey.com/usage-receipts.md",
  "note": "v2 receipt. Signed body: v, channelId, seq, model, meter, pricebookId, inputTokens, outputTokens, inputDigest, outputDigest, rateInPer1k, rateOutPer1k, webSearchSats, discountPct, minChargeSats, sats, cumTokens, cumSats, fundedSats, timestamp. claimId = 0x + sha256(canonical body); signature recovers to this key. Meter: tokens = bsvkey-meter/1 over the exact bytes (recompute from your system/prompt/completion). Charge: sats = max(minChargeSats, ceil((inputTokens*rateInPer1k + outputTokens*rateOutPer1k)/1000 + webSearchSats) * (100-discountPct)/100). A call with provider-billed tokens the meter cannot see (thinking models, injected search results) is receipted as bsvkey.usage-receipt/3: v2 plus hiddenInputTokens, hiddenOutputTokens, hiddenSource, maxOutputTokens; hidden tokens are added to input/output at the same rates, and hiddenOutputTokens <= maxOutputTokens - outputTokens. Non-custodial channels are charged in millisatoshis and receipted as bsvkey.usage-receipt/4: v2 (plus v3 fields when present) plus k (1000), microSats, cumMicro, minChargeMicro; microSats = max(minChargeMicro, ceil(ceil(inTokens*rateInPer1k + outTokens*rateOutPer1k + webSearchSats*1000) * (100-discountPct)/100)), cumSats = floor(cumMicro/k), close settles cumMicro/k rounded half up (Q*). Verify v2/v3 with @bsvkey/x402-bsv-client >= 0.6.0.",
  "schemas": [
    "bsvkey.usage-receipt/2",
    "bsvkey.usage-receipt/3",
    "bsvkey.usage-receipt/4"
  ],
  "x402Receipt": {
    "schema": "bsvkey.x402-receipt/1",
    "envelope": "compact-bsm-secp256k1",
    "note": "Per-call delivered receipt (no channel). Signed body: v, rail, network, settlementRef, payTo, asset, amountAtomic, priceUsd, model, meter, inputTokens, outputTokens, inputDigest, outputDigest, timestamp. claimId = 0x + sha256(canonical body); signature recovers to receiptPubKey. Verify delivery: outputDigest == sha256(completion) under bsvkey-meter/1, and join settlementRef to the chain."
  }
}