{
  "openapi": "3.1.0",
  "info": {
    "title": "ProofRun bounded pilot",
    "version": "0.1.0",
    "description": "Owner-authorized bounded independent HTTP acceptance checks. $0.01 native USDC on Base via x402. No certification or uptime guarantee."
  },
  "paths": {
    "/health": {
      "get": {
        "responses": {
          "200": {
            "description": "Current live service health"
          }
        }
      }
    },
    "/catalog": {
      "get": {
        "responses": {
          "200": {
            "description": "Live pilot offer and limits"
          }
        }
      }
    },
    "/v1/checks": {
      "post": {
        "description": "Unsigned discovery returns x402 402. Signed execution requires verified enrollment, private caller read token and idempotency key. Failed assertions are delivered results. No automatic wallet signing.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckPack"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-ProofRun-Enrollment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Delivered immutable report"
          },
          "402": {
            "description": "Payment required or refused; inspect payment headers"
          },
          "409": {
            "description": "Conflict or uncertain settlement; do not sign/pay again"
          },
          "429": {
            "description": "Pilot capacity"
          },
          "503": {
            "description": "Sales closed or execution unavailable"
          }
        }
      }
    },
    "/v1/enrollments": {
      "post": {
        "description": "Begin origin-control proof with owner_authorized:true and read_only_paths:true, origin and up to 5 exact paths. Authorization Bearer private read token required.",
        "responses": {
          "201": {
            "description": "Proof URL, expected JSON file and enrollment ID"
          },
          "400": {
            "description": "Invalid authorization attestation/origin/path/token"
          },
          "429": {
            "description": "Pilot capacity"
          }
        }
      }
    },
    "/v1/enrollments/{id}/verify": {
      "post": {
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "Verify proof file using original private read token.",
        "responses": {
          "200": {
            "description": "Verified enrollment"
          },
          "400": {
            "description": "Proof unavailable/refused"
          },
          "429": {
            "description": "Pilot capacity"
          }
        }
      }
    },
    "/v1/reports/{id}": {
      "get": {
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "Original paid report or settlement state, private read token required. Never a new charge.",
        "responses": {
          "200": {
            "description": "Receipt state; report only when paid"
          },
          "404": {
            "description": "Missing/expired or wrong owner"
          },
          "409": {
            "description": "Recovery pending"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CheckPack": {
        "type": "object",
        "required": [
          "checks"
        ],
        "properties": {
          "checks": {
            "type": "array",
            "minItems": 1,
            "maxItems": 5,
            "items": {
              "type": "object",
              "required": [
                "id",
                "url",
                "status"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "status": {
                  "type": "integer",
                  "minimum": 200,
                  "maximum": 599
                },
                "text": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512
                },
                "json": {
                  "type": "array",
                  "maxItems": 8,
                  "items": {
                    "type": "object",
                    "required": [
                      "path",
                      "equals"
                    ],
                    "properties": {
                      "path": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 8,
                        "items": {
                          "type": "string"
                        }
                      },
                      "equals": {
                        "type": [
                          "string",
                          "number",
                          "boolean",
                          "null"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}