{"openapi":"3.1.0","info":{"title":"First Ruble Agent — SVG Preflight API","version":"0.1.3","description":"Automated heuristic inspection of SVG printing files: detect raster image elements, live text, transparency, RGB/HEX candidates, gradients, effects, and potentially open paths. Not a certified prepress check."},"servers":[{"url":"https://first-ruble-agent.tohaa28.workers.dev"}],"tags":[{"name":"SVG print preflight","description":"Print-oriented SVG inspection"}],"paths":{"/api/preflight":{"post":{"operationId":"inspectSvgForPrint","summary":"Inspect an SVG file before printing","description":"Paid x402 endpoint. Send a standalone SVG string as JSON. Returns a heuristic report; it does not alter or store the SVG.","tags":["SVG print preflight"],"x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.02"},"network":"eip155:8453","asset":"USDC","facilitator":"https://facilitator.payai.network"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["svg"],"properties":{"svg":{"type":"string","description":"Self-contained UTF-8 SVG up to 128 KiB, no DTD","maxLength":131072}},"additionalProperties":false},"example":{"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"10mm\" height=\"10mm\" viewBox=\"0 0 10 10\"><rect width=\"10\" height=\"10\" fill=\"#ff0000\"/></svg>"}}}},"responses":{"200":{"description":"Inspection report after successful x402 payment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"402":{"description":"x402 v2 payment required; see base64-encoded PAYMENT-REQUIRED header","headers":{"PAYMENT-REQUIRED":{"description":"base64 JSON payment requirements: Base Mainnet, 0.02 USDC","schema":{"type":"string"}}}},"413":{"description":"SVG payload too large"},"422":{"description":"Invalid SVG or unsupported payload"},"503":{"description":"Payment facilitator unavailable"}}}},"/demo":{"post":{"operationId":"tryFreeSample","summary":"Free fixed SVG inspection example","description":"Returns a static sample report; ignores the submitted body and does not analyze a user SVG.","responses":{"200":{"description":"Example report"}}}},"/api/payment-health":{"get":{"operationId":"paymentCapabilities","summary":"Payment facilitator capabilities","responses":{"200":{"description":"Supported mainnet payment scheme"},"503":{"description":"Facilitator unavailable"}}}},"/service":{"get":{"summary":"Public product description for human buyers","responses":{"200":{"description":"HTML landing page"}}}},"/api/printcheck":{"post":{"summary":"Paid print fine-detail analysis","description":"x402 exact $0.05 USDC Base. Unpaid calls yield 402. Submit binary ink rows in final print dimensions.","operationId":"inspectPrintFineGeometry","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["rows","widthMm","heightMm","method"],"properties":{"rows":{"type":"array","items":{"type":"string"},"maxItems":192},"widthMm":{"type":"number","minimum":0.1,"maximum":500},"heightMm":{"type":"number","minimum":0.1,"maximum":500},"method":{"type":"string"},"conditions":{"type":"object"}}},"example":{"rows":["................","................","...##########...","...##########...","...##########...","................","................","................"],"widthMm":8,"heightMm":4,"method":"B1","conditions":{"underbase":false}}}}},"responses":{"200":{"description":"Structured geometry findings"},"402":{"description":"x402 Payment required"},"413":{"description":"Request too large"},"422":{"description":"Invalid mask or print method"},"503":{"description":"Facilitator unavailable"}}}},"/api/curve-clearance":{"post":{"operationId":"measureBezierClearance","summary":"Paid Relief Forge Bézier minimum clearance in millimeters","description":"Returns closest gap, witness points, conservative lower bound and completeness. Supports line, quadratic and cubic segments.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.03"},"network":"eip155:8453","asset":"USDC"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["a","b","thresholdMm"],"properties":{"a":{"type":"array","description":"2-4 pairs of millimeter coordinates"},"b":{"type":"array","description":"2-4 pairs of millimeter coordinates"},"thresholdMm":{"type":"number","exclusiveMinimum":0,"maximum":1000}}},"example":{"a":[[0,0],[10,0]],"b":[[0,0.2],[10,0.2]],"thresholdMm":0.3}}}},"responses":{"200":{"description":"Geometry measurement"},"402":{"description":"x402 payment required"},"422":{"description":"Invalid input"},"503":{"description":"Facilitator unavailable"}}}}},"components":{"schemas":{"Report":{"type":"object","required":["status","issues","counts"],"properties":{"status":{"type":"string","enum":["no_obvious_issues","warnings","review_required"]},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"severity":{"type":"string"},"message":{"type":"string"},"count":{"type":"integer"}}}},"counts":{"type":"object"},"dimensions":{"type":"object"},"disclaimer":{"type":"string"}}}}}}