{
  "openapi": "3.1.0",
  "info": {
    "title": "Web Capture API",
    "version": "0.2.1",
    "description": "Real-money API pilot: 0.10 USDC on Base; capped at 100 capture attempts. Capture public HTTPS pages with exact-host loading, signed artifact hashes and 30-day download access. No independent timestamp or legal admissibility guarantee.",
    "x-guidance": "Read /api/capture-payment before paying: the approved pilot uses real USDC on Base (chain 8453), with 100 total capture attempts. If runtime payment status reports disabled, do not pay. POST /v1/captures with a fresh UUID request_id and public HTTPS URL. An unsigned request returns the exact x402 quote. Check the quoted network, token, amount and recipient before signing. Save the exact original body and authorization for recovery; never automatically make a fresh payment after uncertainty. Resubmitting an already recorded attempt retrieves its state without resettling. If the original never reached the server, resubmission can execute the original purchase. A successful capture returns files, a signed manifest and a secret download credential valid for up to 30 days. Hash verification proves integrity, not an independent timestamp or legal admissibility. Exact-host capture excludes third-party assets and cross-host redirects.",
    "x-reviewed-at": "2026-10-08"
  },
  "servers": [
    {
      "url": "https://web-capture.j0wn0.chatgpt.site"
    }
  ],
  "paths": {
    "/api/capture-payment": {
      "get": {
        "summary": "Read current network, receiver, price and activation status",
        "responses": {
          "200": {
            "description": "Current runtime payment metadata"
          }
        }
      }
    },
    "/v1/captures": {
      "post": {
        "summary": "Capture one public HTTPS page with x402 exact payment",
        "parameters": [
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "x402 v2 signed authorization matching the returned quote. Preserve the original body and signature for recovery."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "request_id",
                  "url"
                ],
                "additionalProperties": false,
                "properties": {
                  "request_id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$"
                  },
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "HTTPS hostname, no credentials, IP literal, fragment or nonstandard port."
                  }
                }
              },
              "example": {
                "request_id": "12345678-1234-4234-8234-123456789abc",
                "url": "https://example.com/"
              }
            }
          },
          "description": "Exactly request_id and url. JSON body limit 4096 bytes; request_id must be a lowercase UUID. Preserve the original request and authorization for recovery."
        },
        "responses": {
          "200": {
            "description": "Stored files and confirmed facilitator settlement; download_authorization.token is a secret bearer credential.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "status",
                    "testnet_only",
                    "settlement_status",
                    "verification_url",
                    "expires_at",
                    "receipt",
                    "download_authorization",
                    "downloads",
                    "independent_timestamp",
                    "automatic_retry"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "ready"
                      ]
                    },
                    "testnet_only": {
                      "type": "boolean"
                    },
                    "settlement_status": {
                      "type": "string",
                      "enum": [
                        "confirmed"
                      ]
                    },
                    "verification_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "receipt": {
                      "type": "object",
                      "required": [
                        "manifest",
                        "signature"
                      ],
                      "properties": {
                        "manifest": {
                          "type": "string"
                        },
                        "signature": {
                          "type": "string"
                        }
                      }
                    },
                    "download_authorization": {
                      "type": "object",
                      "required": [
                        "scheme",
                        "token"
                      ],
                      "properties": {
                        "scheme": {
                          "type": "string",
                          "enum": [
                            "Bearer"
                          ]
                        },
                        "token": {
                          "type": "string",
                          "description": "Secret credential for this capture only; do not publish it."
                        }
                      }
                    },
                    "downloads": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "format": "uri"
                      }
                    },
                    "independent_timestamp": {
                      "type": "boolean",
                      "const": false
                    },
                    "automatic_retry": {
                      "type": "boolean",
                      "const": false
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "x402 v2 quote via PAYMENT-REQUIRED header, or rejected signed payment. Price 0.10 USDC; use the quoted network/token/receiver."
          },
          "400": {
            "description": "Invalid request, unsupported target or payment mismatch."
          },
          "409": {
            "description": "Duplicate/in-progress request, failed earlier attempt or original request required."
          },
          "503": {
            "description": "Payments disabled, configuration/provider failure, recovery unavailable or settlement uncertainty. settlement_uncertain wraps the capture (including downloads and download_authorization) in result; it is not a confirmed payment. Inspect the wallet. Recovery with an already recorded original body and signature does not resubmit settlement; if the original never reached the server, resubmission can execute the original purchase. Never automatically make a fresh payment."
          },
          "413": {
            "description": "JSON request body exceeds 4096 bytes."
          },
          "415": {
            "description": "Content-Type application/json required."
          }
        },
        "operationId": "createWebCapture",
        "tags": [
          "Web Capture"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.10"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        }
      },
      "get": {
        "operationId": "discoverWebCapture",
        "summary": "Read-only x402 v2 discovery quote; does not execute a capture",
        "responses": {
          "402": {
            "description": "PAYMENT-REQUIRED header and JSON quote with the POST input schema; no signature, storage, capture or settlement."
          },
          "503": {
            "description": "Payments disabled or unavailable."
          }
        }
      }
    },
    "/api/captures/{id}/{file}": {
      "get": {
        "summary": "Download one original artifact",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "file",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "screenshot.png",
                "page.html",
                "capture.json",
                "report.pdf",
                "receipt.json"
              ]
            }
          }
        ],
        "security": [
          {
            "captureDownload": []
          }
        ],
        "responses": {
          "200": {
            "description": "Artifact bytes"
          },
          "403": {
            "description": "Download bearer required"
          },
          "410": {
            "description": "Capture expired"
          },
          "404": {
            "description": "Unknown capture ID or filename."
          },
          "409": {
            "description": "Capture not ready."
          },
          "503": {
            "description": "Artifact or storage unavailable."
          }
        }
      }
    },
    "/api/captures/{id}": {
      "get": {
        "summary": "Read a signed verification record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Receipt, public signing-key fingerprint and expiry"
          }
        }
      }
    },
    "/api/capture-key": {
      "get": {
        "summary": "Read trusted signing key",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Historical key fingerprint; omit for current key."
          }
        ],
        "responses": {
          "200": {
            "description": "SPKI-base64 ECDSA P-256 public key"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "captureDownload": {
        "type": "http",
        "scheme": "bearer",
        "description": "Per-capture token returned after fulfillment. Not a wallet key."
      }
    }
  }
}
