{
  "openapi": "3.1.0",
  "info": {
    "title": "USAgentic Markdown Extraction",
    "version": "1.0.0",
    "description": "x402 listing SKU: GET a URL, return markdown from static HTML. JavaScript is not executed. $0.001 USDC on Base. Unpaid calls return 402. No account."
  },
  "servers": [
    {
      "url": "https://us-agentic.com",
      "description": "USAgentic edge"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "summary": "Liveness",
        "responses": {
          "200": {
            "description": "Service is up",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": { "type": "boolean" },
                    "service": { "type": "string" },
                    "network": { "type": "string", "example": "base" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/x402": {
      "get": {
        "summary": "x402 discovery manifest",
        "responses": {
          "200": {
            "description": "Paid endpoints, network, price, and payTo"
          }
        }
      }
    },
    "/v1/markdown": {
      "get": {
        "summary": "Markdown extract (static HTML, x402)",
        "description": "Fetch a public http(s) URL and return markdown. Static HTML only; JavaScript is not executed. Unpaid: 402.",
        "operationId": "extractMarkdown",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": { "type": "string", "format": "uri" },
            "description": "Absolute http(s) URL of the page to extract.",
            "example": "https://example.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Extraction succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": { "type": "string" },
                    "final_url": { "type": "string" },
                    "title": { "type": "string", "nullable": true },
                    "markdown": { "type": "string" },
                    "word_count": { "type": "integer" },
                    "truncated": { "type": "boolean" },
                    "warnings": { "type": "array", "items": { "type": "string" } },
                    "fetched_at": { "type": "string", "format": "date-time" }
                  }
                }
              }
            }
          },
          "400": { "description": "Invalid or unroutable target URL" },
          "402": { "description": "Payment required — x402 challenge body (X-PAYMENT header)" },
          "413": { "description": "Document too large" },
          "415": { "description": "Target is not HTML" },
          "502": { "description": "Upstream fetch failed" }
        }
      }
    },
    "/v1/extract": {
      "get": {
        "summary": "Markdown extract alias",
        "description": "Same as GET /v1/markdown. Static HTML only. Unpaid: 402.",
        "operationId": "extractMarkdownAlias",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": { "type": "string", "format": "uri" },
            "description": "Absolute http(s) URL of the page to extract.",
            "example": "https://example.com"
          }
        ],
        "responses": {
          "200": { "description": "Extraction succeeded" },
          "400": { "description": "Invalid or unroutable target URL" },
          "402": { "description": "Payment required — x402 challenge body (X-PAYMENT header)" },
          "413": { "description": "Document too large" },
          "415": { "description": "Target is not HTML" },
          "502": { "description": "Upstream fetch failed" }
        }
      }
    }
  },
  "x-x402": {
    "network": "base",
    "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "price_atomic": "1000",
    "price_usd": "0.001000",
    "payTo": "0x7Ae0DfD6C42A2A45e55d1f1722a4Ef0B0B77107b",
    "scheme": "exact"
  }
}
