{"openapi":"3.1.0","info":{"title":"Agent Reader API","version":"0.1.0","description":"Extract clean Markdown from public HTML. Each successful request costs $0.01 using x402 on eip155:8453.","x-guidance":"Use POST /v1/extract when an agent needs the readable content of a known public webpage without browser automation. Send a JSON body with a public http(s) URL. The response contains Markdown and source metadata; x402 payment is required per successful extraction."},"servers":[{"url":"https://agent-reader-prototype.kcdesplanches.workers.dev"}],"paths":{"/v1/extract":{"post":{"operationId":"extractUrlToMarkdown","summary":"Convert a public web page to Markdown","description":"Fetches a public HTML URL and returns its text, title, description and canonical URL. Payment is requested using x402 when the route is configured.","security":[{"x402Payment":[]}],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"protocols":[{"x402":{"version":2,"network":"eip155:8453"}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","maxLength":2048}},"additionalProperties":false}}}},"responses":{"200":{"description":"Page extracted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Extraction"}}}},"402":{"description":"x402 payment required. The PAYMENT-REQUIRED header contains the accepted token, network, amount and pay-to address.","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded x402 v2 payment requirements."}}},"413":{"description":"Input or source page exceeded the size limit"},"415":{"description":"Source is not HTML"},"422":{"description":"Source could not be fetched or parsed"}}}}},"components":{"securitySchemes":{"x402Payment":{"type":"apiKey","in":"header","name":"PAYMENT-SIGNATURE","description":"x402 v2 signed payment payload. First request receives HTTP 402 with payment terms."}},"schemas":{"Extraction":{"type":"object","required":["sourceUrl","finalUrl","title","markdown","truncated","fetchedAt"],"properties":{"sourceUrl":{"type":"string","format":"uri"},"finalUrl":{"type":"string","format":"uri"},"canonicalUrl":{"type":"string","format":"uri"},"title":{"type":"string"},"description":{"type":"string"},"markdown":{"type":"string"},"truncated":{"type":"boolean"},"fetchedAt":{"type":"string","format":"date-time"}}}}}}