{
  "openapi": "3.1.0",
  "info": {
    "title": "nod402 API",
    "version": "0.1.0",
    "description": "Risk data for x402 machine payments. Scoring for endpoints and wallets, plus a verdict before a payment is signed. Data is collected by reading blocks in full, so it includes facilitators that appear in no public registry."
  },
  "servers": [
    {
      "url": "https://nod402.com"
    }
  ],
  "paths": {
    "/v1/prepay": {
      "post": {
        "summary": "Verdict on a live 402 envelope, before the payment is signed",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "envelope"
                ],
                "properties": {
                  "envelope": {
                    "type": "object",
                    "description": "Decoded PAYMENT-REQUIRED (x402 v2)"
                  },
                  "url": {
                    "type": "string"
                  },
                  "maxPrice": {
                    "type": "string",
                    "description": "Client limit, in USD"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "verdict: allow | warn | block, with reasons"
          }
        }
      }
    },
    "/v1/probe": {
      "get": {
        "summary": "Live check: a real request to the endpoint right now",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "verdict and the decoded envelope"
          },
          "429": {
            "description": "rate limited"
          }
        }
      }
    },
    "/v1/endpoint": {
      "get": {
        "summary": "Endpoint grade and flags",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ok"
          },
          "404": {
            "description": "not found"
          }
        }
      }
    },
    "/v1/wallet": {
      "get": {
        "summary": "Wallet grade and agent likelihood",
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "chain",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "base",
                "solana"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/v1/search": {
      "get": {
        "summary": "Endpoint search",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/v1/market/stats": {
      "get": {
        "summary": "Market aggregates",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    }
  }
}