{
  "openapi": "3.1.0",
  "info": {
    "title": "CitePulse AI v4.0",
    "version": "5.0.0",
    "description": "Autonomous GEO, /llms.txt & AI Citation Readiness Cloud Engine"
  },
  "servers": [
    {
      "url": "https://citepulse-ai.run402.com"
    }
  ],
  "paths": {
    "/api/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Check service health, runtime, and settlement wallets",
        "responses": {
          "200": {
            "description": "Service operational status and wallet metadata"
          }
        }
      }
    },
    "/api/audit": {
      "get": {
        "operationId": "runLiveAudit",
        "summary": "Run live server-side audit on any target URL",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Target HTTPS URL or domain to audit"
          }
        ],
        "responses": {
          "200": {
            "description": "Live server-side audit telemetry and preview deliverable"
          }
        }
      }
    },
    "/api/x402-audit": {
      "get": {
        "operationId": "runPaidX402AuditGet",
        "summary": "HTTP 402 (x402) Paid API endpoint ($0.01 USDC on Base)",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Target HTTPS URL or domain to audit"
          }
        ],
        "responses": {
          "200": {
            "description": "Full unredacted audit deliverable returned after valid x402 payment header"
          },
          "402": {
            "description": "Payment Required \u2014 returns x402 v1 body and PAYMENT-REQUIRED v2 header"
          }
        }
      },
      "post": {
        "operationId": "runPaidX402AuditPost",
        "summary": "HTTP 402 (x402) Paid API endpoint ($0.01 USDC on Base)",
        "responses": {
          "200": {
            "description": "Full unredacted audit deliverable returned after valid x402 payment header"
          },
          "402": {
            "description": "Payment Required \u2014 returns x402 v1 body and PAYMENT-REQUIRED v2 header"
          }
        }
      }
    },
    "/api/verify-tx": {
      "post": {
        "operationId": "verifyOnChainTransaction",
        "summary": "Verify on-chain Tonkeeper (TON) or Base (USDC/USDT) transaction & unlock full report",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tx_hash": {
                    "type": "string"
                  },
                  "network": {
                    "type": "string",
                    "enum": [
                      "ton",
                      "base"
                    ]
                  },
                  "url": {
                    "type": "string"
                  }
                },
                "required": [
                  "tx_hash"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transaction verified on-chain; returns license_key and unlocked deliverables"
          },
          "400": {
            "description": "Transaction not yet confirmed or invalid hash"
          }
        }
      }
    }
  }
}