{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pipavia-com/json-schema/pipavia-com-receipt-record-schema.json",
  "title": "ReceiptRecord",
  "description": "One audit-chain receipt record — the object returned by GET /v1/receipts/{id} (its \"receipt\" field). Verification recomputes the record hash and checks the stored chain entry at seq; a receipt id alone is not verifiable and is refused with 400 bad_verify_payload.",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/router-pipavia-openapi.json#/components/schemas/ReceiptRecord",
  "type": "object",
  "required": [
    "seq",
    "ts",
    "key_id",
    "config_hash",
    "prev_hash",
    "hash"
  ],
  "properties": {
    "seq": {
      "type": "integer"
    },
    "ts": {
      "type": "string"
    },
    "key_id": {
      "type": "string"
    },
    "config_hash": {
      "type": "string"
    },
    "provider": {
      "type": [
        "string",
        "null"
      ]
    },
    "model_requested": {
      "type": [
        "string",
        "null"
      ]
    },
    "model_served": {
      "type": [
        "string",
        "null"
      ]
    },
    "fallback_declared": {
      "type": "boolean"
    },
    "task_profile": {
      "type": [
        "string",
        "null"
      ]
    },
    "tokens": {
      "type": "object",
      "properties": {
        "prompt_tokens": {
          "type": "number"
        },
        "completion_tokens": {
          "type": "number"
        }
      }
    },
    "cost_usd": {
      "type": "number"
    },
    "router_charge_usd": {
      "type": "number"
    },
    "latency_ms": {
      "type": "number"
    },
    "outcome": {
      "type": "string"
    },
    "prev_hash": {
      "type": "string"
    },
    "hash": {
      "type": "string"
    }
  }
}