{
  "openapi": "3.1.0",
  "info": {
    "title": "ToolMint Distress Signal Score JSON",
    "version": "0.1.0",
    "description": "Transparent 0-100 property distress score from signals the caller supplies. Pay per property with USDC on Base via x402. Research and prioritization only; fair-housing safe; no outreach.",
    "x-guidance": "GET /score with 2+ of the signals in GET /model as query params (booleans true/false, integers in range). Unpaid calls receive HTTP 402 with x402 payment requirements. Refused, unknown or invalid fields return 400 and are not charged. Free: /, /health, /model, /openapi.json, /.well-known/x402.",
    "contact": {
      "email": "toolmint.dev@gmail.com",
      "name": "ToolMint"
    }
  },
  "paths": {
    "/health": {
      "get": {
        "operationId": "health",
        "summary": "Liveness",
        "security": [],
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/model": {
      "get": {
        "operationId": "model",
        "summary": "Signals, weights and policy",
        "security": [],
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/score": {
      "get": {
        "operationId": "distress_signal_score",
        "summary": "Score one property's distress signals",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.010000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ],
          "network": "eip155:8453",
          "payTo": "0xfbF7413bcB3a604936775C96FDbe0b0C9c9E37F5",
          "asset": "USDC",
          "scheme": "exact",
          "amountAtomic": "10000"
        },
        "parameters": [
          {
            "name": "ref",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "Your own opaque id, echoed back (1-64 chars, no PII)"
            }
          },
          {
            "name": "taxDelinquentYears",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 30,
              "description": "Years of delinquent property tax"
            }
          },
          {
            "name": "taxSaleScheduled",
            "in": "query",
            "schema": {
              "type": "boolean",
              "description": "Tax sale scheduled"
            }
          },
          {
            "name": "preForeclosureNotice",
            "in": "query",
            "schema": {
              "type": "boolean",
              "description": "Pre-foreclosure notice (NOD / sheriff sale set)"
            }
          },
          {
            "name": "lisPendens",
            "in": "query",
            "schema": {
              "type": "boolean",
              "description": "Lis pendens recorded"
            }
          },
          {
            "name": "probateOpen",
            "in": "query",
            "schema": {
              "type": "boolean",
              "description": "Open probate / succession on title"
            }
          },
          {
            "name": "codeViolationsOpen",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 500,
              "description": "Open code-enforcement cases"
            }
          },
          {
            "name": "codeViolations24mo",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000,
              "description": "Code cases in last 24 months (any status)"
            }
          },
          {
            "name": "vacant",
            "in": "query",
            "schema": {
              "type": "boolean",
              "description": "Vacant (caller's own determination)"
            }
          },
          {
            "name": "absenteeOwner",
            "in": "query",
            "schema": {
              "type": "boolean",
              "description": "Owner mailing address differs from property"
            }
          },
          {
            "name": "ownerOutOfState",
            "in": "query",
            "schema": {
              "type": "boolean",
              "description": "Owner mailing address out of state"
            }
          },
          {
            "name": "yearsOwned",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 150,
              "description": "Years since last transfer"
            }
          },
          {
            "name": "equityPct",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": -100,
              "maximum": 100,
              "description": "Estimated equity, percent of value"
            }
          },
          {
            "name": "floodZoneSFHA",
            "in": "query",
            "schema": {
              "type": "boolean",
              "description": "In FEMA Special Flood Hazard Area"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Score, tier, confidence, reasons, compliance notes"
          },
          "400": {
            "description": "Refused, unknown or invalid fields (not charged)"
          },
          "402": {
            "description": "Payment Required"
          }
        }
      }
    }
  }
}