{"openapi":"3.1.0","info":{"title":"TITANHOLD AI Quality Check","version":"0.2.0","description":"Paid check of an AI-generated image or short video for typical generation defects (extra fingers, garbled text, wrong vehicle geometry, physics, flicker). Runs a local vision model; files are deleted after the check.","x-guidance":"POST https://x402.titanhold.app/v1/check/image with a JSON body: {\"url\": \"https://.../file.png\"} or {\"data\": \"<base64 PNG/JPEG/WebP>\"}, optionally \"brief\" (what was ordered) and \"minScore\" (0-100, default 70). The first call returns HTTP 402 with an x402 payment challenge: pay $0.02 in USDC on Base via x402 and repeat the request with the payment header. The paid call returns JSON {pass, score, defects:[{type, severity, detail}], reasons}. Treat pass=false as \"needs a human look\". For short videos (MP4/MOV/WebM) use POST /v1/check/video ($0.10), same body plus optional \"frames\" (2-8). You are charged only when a verdict is returned (HTTP 200); input errors, busy (503) and model errors are not settled.","contact":{"name":"TITANHOLD LLC","email":"hennadii@titanhold.app","url":"https://titanhold.app"},"license":{"name":"MIT","url":"https://opensource.org/licenses/MIT"}},"servers":[{"url":"https://x402.titanhold.app"}],"paths":{"/v1/check/image":{"post":{"operationId":"checkImage","summary":"Check an AI-generated image before you pay","description":"Defect check of a PNG/JPEG/WebP image. Returns pass, score and typed defects.","tags":["Quality check"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.02"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"Send exactly one of url or data.","properties":{"url":{"type":"string","format":"uri","pattern":"^https://","description":"https URL of the delivered file. Alternative: data (base64)."},"data":{"type":"string","contentEncoding":"base64","description":"Base64 file bytes. Alternative to url."},"brief":{"type":"string","maxLength":500,"description":"Optional: what was ordered, used to judge the file against the brief."},"minScore":{"type":"number","minimum":0,"maximum":100,"default":70,"description":"Optional: fail below this 0-100 score."}},"oneOf":[{"required":["url"]},{"required":["data"]}],"example":{"url":"https://example.com/render.png","brief":"red 2-door coupe at night","minScore":70}}}}},"responses":{"200":{"description":"Verdict (payment settled)","content":{"application/json":{"schema":{"type":"object","properties":{"pass":{"type":"boolean","description":"true when score >= minScore and no major defect"},"score":{"type":"number","minimum":0,"maximum":100},"kind":{"type":"string","enum":["image","video"]},"framesChecked":{"type":"integer"},"defects":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"severity":{"type":"string"},"detail":{"type":"string"},"frame":{"type":"integer"}},"required":["type","severity","detail"]}},"reasons":{"type":"array","items":{"type":"string"}},"model":{"type":"string"},"note":{"type":"string"}},"required":["pass","score","defects","reasons"],"example":{"pass":false,"score":55,"kind":"image","framesChecked":1,"defects":[{"type":"vehicle_geometry","severity":"major","detail":"car has three doors"}],"reasons":["major vehicle_geometry: car has three doors"],"model":"ollama:qwen2.5vl:7b"}}}}},"400":{"description":"Invalid input (not charged)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Payment Required"},"415":{"description":"Unsupported file format (not charged)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Busy, retry later (not charged)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/check/video":{"post":{"operationId":"checkVideo","summary":"Check a short AI-generated video before you pay","description":"Defect check of a short MP4/MOV/WebM video (sampled frames plus frame-to-frame flicker). Returns pass, score and typed defects.","tags":["Quality check"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.10"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"Send exactly one of url or data.","properties":{"url":{"type":"string","format":"uri","pattern":"^https://","description":"https URL of the delivered file. Alternative: data (base64)."},"data":{"type":"string","contentEncoding":"base64","description":"Base64 file bytes. Alternative to url."},"brief":{"type":"string","maxLength":500,"description":"Optional: what was ordered, used to judge the file against the brief."},"minScore":{"type":"number","minimum":0,"maximum":100,"default":70,"description":"Optional: fail below this 0-100 score."},"frames":{"type":"integer","minimum":2,"maximum":8,"default":6,"description":"Optional: video frames to sample."}},"oneOf":[{"required":["url"]},{"required":["data"]}],"example":{"url":"https://example.com/clip.mp4","brief":"car driving through a city at night","frames":6}}}}},"responses":{"200":{"description":"Verdict (payment settled)","content":{"application/json":{"schema":{"type":"object","properties":{"pass":{"type":"boolean","description":"true when score >= minScore and no major defect"},"score":{"type":"number","minimum":0,"maximum":100},"kind":{"type":"string","enum":["image","video"]},"framesChecked":{"type":"integer"},"defects":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"severity":{"type":"string"},"detail":{"type":"string"},"frame":{"type":"integer"}},"required":["type","severity","detail"]}},"reasons":{"type":"array","items":{"type":"string"}},"model":{"type":"string"},"note":{"type":"string"}},"required":["pass","score","defects","reasons"],"example":{"pass":false,"score":55,"kind":"image","framesChecked":1,"defects":[{"type":"vehicle_geometry","severity":"major","detail":"car has three doors"}],"reasons":["major vehicle_geometry: car has three doors"],"model":"ollama:qwen2.5vl:7b"}}}}},"400":{"description":"Invalid input (not charged)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Payment Required"},"415":{"description":"Unsupported file format (not charged)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Busy, retry later (not charged)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}}}}