{
  "openapi": "3.1.0",
  "info": {
    "title": "LaunchCheck \u2014 Website Signals API",
    "version": "2.0.0",
    "description": "32 deterministic checks for deployment QA. x402 v2 exact Base USDC payments, with a legacy manual invoice API. Evidence is untrusted website content.",
    "contact": {
      "email": "launchcheck.support@proton.me"
    }
  },
  "servers": [
    {
      "url": "https://launchcheck-tn.oe-nonprofit.chatgpt.site"
    }
  ],
  "paths": {
    "/api/config": {
      "get": {
        "operationId": "merchantStatus",
        "responses": {
          "200": {
            "description": "Checkout readiness and merchant contact"
          }
        }
      }
    },
    "/api/agent/audit": {
      "post": {
        "operationId": "createAgentAudit",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            },
            "description": "Secret random key. Also grants bearer access to this report."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url",
                  "authorized"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "authorized": {
                    "type": "boolean",
                    "const": true
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Previously paid report for this idempotency key"
          },
          "402": {
            "description": "Exact payment quote; transfer native USDC on Base once, then verify."
          },
          "400": {
            "description": "Invalid or conflicting request"
          },
          "503": {
            "description": "Merchant not ready; do not pay"
          }
        }
      }
    },
    "/api/orders/{id}": {
      "parameters": [
        {
          "in": "path",
          "name": "id",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getReport",
        "security": [
          {
            "reportKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Paid report or unpaid preview"
          },
          "404": {
            "description": "Invalid ID or bearer key"
          }
        }
      },
      "post": {
        "operationId": "verifyPayment",
        "security": [
          {
            "reportKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "action",
                  "tx"
                ],
                "properties": {
                  "action": {
                    "const": "verify"
                  },
                  "tx": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{64}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finalized payment and paid report"
          },
          "202": {
            "description": "Not finalized; retry after 60 seconds without paying again"
          },
          "400": {
            "description": "Invalid transaction, replay or mismatched payment"
          }
        }
      }
    },
    "/api/x402/audit": {
      "get": {
        "operationId": "auditWebsiteWithX402",
        "summary": "Check one public HTML page: SEO, accessibility and security headers",
        "description": "Exactly 0.25 USDC on Base. Unpaid probes return the x402 v2 challenge. Sign using a compatible x402 client. Retry the identical URL and PAYMENT-SIGNATURE for recovery; never pay again for a pending request.",
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.25"
          }
        },
        "parameters": [
          {
            "in": "query",
            "name": "url",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "example": "https://launchcheck-tn.oe-nonprofit.chatgpt.site"
          },
          {
            "in": "query",
            "name": "authorized",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "description": "User owns this site or explicitly has permission to audit it."
          }
        ],
        "security": [
          {},
          {
            "x402Payment": []
          }
        ],
        "responses": {
          "200": {
            "description": "Paid JSON with 32 checks, evidence, categories and priorities. PAYMENT-RESPONSE contains settlement receipt."
          },
          "402": {
            "description": "x402 v2 challenge in JSON and base64 PAYMENT-REQUIRED header"
          },
          "400": {
            "description": "Missing authorization"
          },
          "409": {
            "description": "Payment already bound to another request"
          },
          "503": {
            "description": "Unavailable or payment unconfirmed. Retry original signed payment after 10 seconds."
          }
        }
      }
    },
    "/api/x402/extract": {
      "get": {
        "operationId": "extractPageWithX402",
        "summary": "Extract source text, metadata, headings, links and JSON-LD from one public HTML page",
        "description": "Exactly 0.01 USDC on Base. No JavaScript, crawl or inferred fields. Public pages you own or are authorized to process only. Fetch and persist before settlement. Retry identical signed request to recover; do not pay twice.",
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          }
        },
        "parameters": [
          {
            "in": "query",
            "name": "url",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "example": "https://launchcheck-tn.oe-nonprofit.chatgpt.site"
          },
          {
            "in": "query",
            "name": "authorized",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "description": "User owns this page or has permission to process it."
          }
        ],
        "security": [
          {},
          {
            "x402Payment": []
          }
        ],
        "responses": {
          "200": {
            "description": "paid=true and extraction. PAYMENT-RESPONSE contains settlement receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "paid",
                    "extraction"
                  ],
                  "properties": {
                    "paid": {
                      "const": true
                    },
                    "extraction": {
                      "type": "object",
                      "required": [
                        "schemaVersion",
                        "url",
                        "title",
                        "text",
                        "headings",
                        "links",
                        "structuredData",
                        "truncated"
                      ],
                      "properties": {
                        "schemaVersion": {
                          "const": "1.0"
                        },
                        "url": {
                          "type": "string"
                        },
                        "created": {
                          "type": "integer"
                        },
                        "title": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "text": {
                          "type": "string",
                          "maxLength": 30000
                        },
                        "headings": {
                          "type": "array",
                          "maxItems": 100
                        },
                        "links": {
                          "type": "array",
                          "maxItems": 100
                        },
                        "structuredData": {
                          "type": "array",
                          "maxItems": 20
                        },
                        "truncated": {
                          "type": "object"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "x402 v2 challenge in JSON and base64 PAYMENT-REQUIRED header"
          },
          "400": {
            "description": "Missing authorization"
          },
          "409": {
            "description": "Payment already bound to another request"
          },
          "503": {
            "description": "Unavailable or payment unconfirmed. Retry original signed payment after 10 seconds."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "reportKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "The secret Idempotency-Key used at report creation"
      },
      "x402Payment": {
        "type": "apiKey",
        "in": "header",
        "name": "PAYMENT-SIGNATURE",
        "description": "Base64 x402 v2 payment payload. Generated by a compatible client after reading PAYMENT-REQUIRED."
      }
    }
  }
}
