{
  "openapi": "3.1.0",
  "info": {
    "title": "paid-md",
    "version": "1.0.0",
    "description": "Read any public web page as clean, LLM-ready Markdown. URL to markdown web scraper: fetches the page, strips navigation, ads, scripts, cookie banners and boilerplate, keeps the main content with headings, lists, links and tables. Use it to read, quote or summarise an article, docs page, blog post, product page or GitHub issue from a URL. Typically 90-99% fewer tokens than raw HTML; token counts returned in headers."
  },
  "servers": [
    {
      "url": "https://paid-md.hihat.workers.dev"
    }
  ],
  "paths": {
    "/md": {
      "get": {
        "summary": "HTML -> clean markdown",
        "description": "One page as LLM-ready markdown. Token counts in x-tokens-in / x-tokens-out / x-saved-pct.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-payment-info": {
          "scheme": "exact",
          "network": "eip155:8453",
          "amount": "2000",
          "maxAmountRequired": "2000",
          "resource": "https://paid-md.hihat.workers.dev/md",
          "description": "Read any public web page as clean, LLM-ready Markdown. URL to markdown web scraper: fetches the page, strips navigation, ads, scripts, cookie banners and boilerplate, keeps the main content with headings, lists, links and tables. Use it to read, quote or summarise an article, docs page, blog post, product page or GitHub issue from a URL. Typically 90-99% fewer tokens than raw HTML; token counts returned in headers.",
          "mimeType": "text/markdown",
          "payTo": "0xF00679CD8B440C8bd541fB2AAB1382E6fFd65A51",
          "maxTimeoutSeconds": 300,
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "extra": {
            "name": "USD Coin",
            "version": "2"
          }
        },
        "responses": {
          "200": {
            "description": "ok"
          },
          "400": {
            "description": "bad request"
          },
          "402": {
            "description": "payment required"
          }
        }
      }
    },
    "/extract": {
      "post": {
        "summary": "page or text -> structured JSON",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "page to read"
                  },
                  "text": {
                    "type": "string",
                    "description": "raw text instead of url"
                  },
                  "schema": {
                    "type": "object",
                    "description": "shape of the JSON you want back"
                  },
                  "instructions": {
                    "type": "string"
                  }
                },
                "required": [
                  "schema"
                ]
              }
            }
          }
        },
        "x-payment-info": {
          "scheme": "exact",
          "network": "eip155:8453",
          "amount": "5000",
          "maxAmountRequired": "5000",
          "resource": "https://paid-md.hihat.workers.dev/extract",
          "description": "Extract structured JSON from a URL or raw text.",
          "mimeType": "application/json",
          "payTo": "0xF00679CD8B440C8bd541fB2AAB1382E6fFd65A51",
          "maxTimeoutSeconds": 300,
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "extra": {
            "name": "USD Coin",
            "version": "2"
          }
        },
        "responses": {
          "200": {
            "description": "ok"
          },
          "400": {
            "description": "bad request"
          },
          "402": {
            "description": "payment required"
          }
        }
      }
    },
    "/research": {
      "post": {
        "summary": "up to 8 pages -> one structured brief",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "seed url; links are followed"
                  },
                  "urls": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "explicit list instead of a seed; no crawl, fetched in parallel"
                  },
                  "depth": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 8,
                    "default": 5
                  },
                  "schema": {
                    "type": "object"
                  },
                  "instructions": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "x-payment-info": {
          "scheme": "exact",
          "network": "eip155:8453",
          "amount": "20000",
          "maxAmountRequired": "20000",
          "resource": "https://paid-md.hihat.workers.dev/research",
          "description": "Multi-page structured research brief.",
          "mimeType": "application/json",
          "payTo": "0xF00679CD8B440C8bd541fB2AAB1382E6fFd65A51",
          "maxTimeoutSeconds": 300,
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "extra": {
            "name": "USD Coin",
            "version": "2"
          }
        },
        "responses": {
          "200": {
            "description": "ok"
          },
          "400": {
            "description": "bad request"
          },
          "402": {
            "description": "payment required"
          }
        }
      }
    }
  }
}