{
  "openapi": "3.1.0",
  "info": {
    "title": "ToolMint NPI Provider",
    "version": "0.1.0",
    "description": "US healthcare provider verification for agents. Pay per call with USDC on Base via x402. Provider data from the CMS NPPES NPI Registry (public). Exclusion data from the HHS-OIG LEIE (public, refreshed monthly; leieAsOf says which build answered). An NPI match on the LEIE is strong; a name match is only POSSIBLE until confirmed on OIG's exclusion search with date of birth or SSN, which this tool never holds. Not a credentialing or legal determination. ToolMint is not affiliated with CMS or HHS-OIG.",
    "x-guidance": "GET /npi?npi=NNNNNNNNNN verifies one provider: check digit (bad digit = 400, no charge), NPPES record, and an OIG LEIE screen by NPI (strong) and by name+state (possible). GET /search finds NPIs by name/organization/taxonomy/location, each screened by NPI. GET /exclusions screens a name or business directly. Unpaid calls get 402 (USDC on Base).",
    "contact": {
      "email": "toolmint.dev@gmail.com",
      "name": "ToolMint"
    }
  },
  "paths": {
    "/health": {
      "get": {
        "operationId": "health",
        "summary": "Liveness",
        "security": [],
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/npi": {
      "get": {
        "operationId": "npi_verify",
        "summary": "Verify one NPI + exclusion screen",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ],
          "network": "eip155:8453",
          "payTo": "0xfbF7413bcB3a604936775C96FDbe0b0C9c9E37F5",
          "asset": "USDC",
          "scheme": "exact",
          "amountAtomic": "5000"
        },
        "parameters": [
          {
            "name": "npi",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[12]\\d{9}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Verdict JSON"
          },
          "400": {
            "description": "Bad input (no charge; rejected before payment)"
          },
          "402": {
            "description": "Payment Required"
          },
          "500": {
            "description": "Data error (not charged)"
          },
          "502": {
            "description": "NPPES unavailable (not charged)"
          }
        }
      }
    },
    "/search": {
      "get": {
        "operationId": "npi_search",
        "summary": "Search NPPES (+ LEIE by NPI)",
        "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": "last_name",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "first_name",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "organization",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "taxonomy",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 60
            }
          },
          {
            "name": "city",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z]{2}$"
            }
          },
          {
            "name": "postal_code",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "individual",
                "organization"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          },
          {
            "name": "skip",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Results JSON"
          },
          "400": {
            "description": "Bad input (no charge; rejected before payment)"
          },
          "402": {
            "description": "Payment Required"
          },
          "500": {
            "description": "Data error (not charged)"
          },
          "502": {
            "description": "NPPES unavailable (not charged)"
          }
        }
      }
    },
    "/exclusions": {
      "get": {
        "operationId": "oig_exclusion_screen",
        "summary": "Screen against the HHS-OIG LEIE",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ],
          "network": "eip155:8453",
          "payTo": "0xfbF7413bcB3a604936775C96FDbe0b0C9c9E37F5",
          "asset": "USDC",
          "scheme": "exact",
          "amountAtomic": "5000"
        },
        "parameters": [
          {
            "name": "npi",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "last_name",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "first_name",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "business",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matches JSON"
          },
          "400": {
            "description": "Bad input (no charge; rejected before payment)"
          },
          "402": {
            "description": "Payment Required"
          },
          "500": {
            "description": "Data error (not charged)"
          },
          "502": {
            "description": "NPPES unavailable (not charged)"
          }
        }
      }
    }
  }
}