{"openapi":"3.1.0","info":{"title":"DiffiCat Agent API","version":"3.22.6","description":"Website migration checks for AI agents: page discovery, screenshot capture, and full comparison jobs with reports. Paid per call over HTTP 402 using the Machine Payments Protocol; the rails on offer (USDC on Base, also for x402 clients; cards via Shared Payment Tokens and USDC on Tempo where enabled) are enumerated by the 402 challenge. No account needed. The same features are exposed as MCP tools at the /mcp endpoint of this host."},"servers":[{"url":"https://app.difficat.com/api/v1"}],"x-service-info":{"categories":["web","testing","monitoring"],"docs":{"homepage":"https://difficat.com","llms":"https://difficat.com/llms.txt","apiReference":"https://app.difficat.com/api/v1/openapi.json"}},"paths":{"/discover":{"post":{"operationId":"discoverPages","summary":"Discover the pages of a site (0.05 USD per call)","security":[{"payment":[]}],"x-payment-info":{"amount":"5","currency":"USD","intent":"charge","description":"0.05 USD per call"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscoverRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscoverResponse"}}}},"400":{"description":"Invalid input or blocked URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment required. The WWW-Authenticate header carries the Machine Payments Protocol challenge; pay and retry the identical request with the credential in the Authorization header."},"502":{"description":"Discovery failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Discovery timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/screenshots":{"post":{"operationId":"captureScreenshot","summary":"Capture a full-page screenshot (0.02 USD per call)","security":[{"payment":[]}],"x-payment-info":{"amount":"2","currency":"USD","intent":"charge","description":"0.02 USD per call"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScreenshotRequest"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScreenshotResponse"}}}},"400":{"description":"Invalid input or blocked URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment required. The WWW-Authenticate header carries the Machine Payments Protocol challenge; pay and retry the identical request with the credential in the Authorization header."}}}},"/jobs":{"post":{"operationId":"startComparison","summary":"Start a comparison job (0.02 USD per reserved page). Compares Site A against Site B on page existence, content and visual regression; charged upfront for maxPages with no refund for unused pages, so call POST /discover first and set maxPages to the page count. Poll GET /jobs/{id} until the status is terminal, then read /jobs/{id}/report.","security":[{"payment":[]}],"x-payment-info":{"amount":null,"currency":"USD","intent":"charge","description":"0.02 USD per reserved page; total is maxPages × 0.02, charged upfront"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartJobRequest"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartJobResponse"}}}},"400":{"description":"Invalid input or blocked URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment required. The WWW-Authenticate header carries the Machine Payments Protocol challenge; pay and retry the identical request with the credential in the Authorization header."},"429":{"description":"A job is already running for this caller"}}}},"/jobs/{id}":{"get":{"operationId":"getComparison","summary":"Job status and progress","security":[{"jobToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobStatus"}}}},"401":{"description":"Missing job token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown job or wrong token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/jobs/{id}/report":{"get":{"operationId":"getReport","summary":"The finished report as JSON plus plain text","security":[{"jobToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"401":{"description":"Missing job token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown job or wrong token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Job still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobStatus"}}}}}}},"/jobs/{id}/files/{filename}":{"get":{"operationId":"getScreenshot","summary":"A screenshot PNG named in the report","security":[{"jobToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"filename","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"image/png":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid filename","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing job token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown job or wrong token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/jobs/{id}/cancel":{"post":{"operationId":"cancelComparison","summary":"Cancel a running job (no refund)","security":[{"jobToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Cancelled"},"401":{"description":"Missing job token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown job or wrong token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}},"BasicAuth":{"type":"object","required":["username","password"],"properties":{"username":{"type":"string"},"password":{"type":"string"}}},"Payment":{"type":"object","description":"What this call was charged. The amount is a decimal USD string (\"0.10\"); by contrast, the x-payment-info.amount advertised on each paid operation is USD cents as an integer string (\"10\").","required":["amount","currency"],"properties":{"amount":{"type":"string","example":"0.50"},"currency":{"type":"string"}}},"DiscoverRequest":{"type":"object","required":["sourceUrl"],"properties":{"sourceUrl":{"type":"string","format":"uri","maxLength":2048},"targetUrl":{"type":"string","format":"uri","maxLength":2048},"sitemapUrl":{"type":"string","format":"uri","maxLength":2048},"maxPages":{"type":"integer","minimum":1,"maximum":500}}},"DiscoverResponse":{"type":"object","required":["pages","payment"],"properties":{"pages":{"type":"array","items":{"type":"object","required":["sourceUrl","path"],"properties":{"sourceUrl":{"type":"string","format":"uri","maxLength":2048},"targetUrl":{"type":"string","format":"uri","maxLength":2048},"path":{"type":"string"}}}},"strategy":{"type":"string"},"payment":{"$ref":"#/components/schemas/Payment"}}},"ScreenshotRequest":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","maxLength":2048},"auth":{"$ref":"#/components/schemas/BasicAuth"},"viewportWidth":{"type":"integer","minimum":320,"maximum":2560}}},"ScreenshotResponse":{"type":"object","required":["jobId","jobToken","filename","url","dimensions","links","payment"],"properties":{"jobId":{"type":"string"},"jobToken":{"type":"string","description":"Bearer token for the file link. Shown once."},"filename":{"type":"string"},"url":{"type":"string","format":"uri","maxLength":2048},"dimensions":{"type":"object","properties":{"width":{"type":"integer"},"height":{"type":"integer"}}},"links":{"type":"object","properties":{"file":{"type":"string"}}},"payment":{"$ref":"#/components/schemas/Payment"}}},"StartJobRequest":{"type":"object","required":["sourceUrl","maxPages"],"properties":{"sourceUrl":{"type":"string","format":"uri","maxLength":2048},"targetUrl":{"type":"string","format":"uri","maxLength":2048},"sourceAuth":{"$ref":"#/components/schemas/BasicAuth"},"targetAuth":{"$ref":"#/components/schemas/BasicAuth"},"urls":{"type":"array","maxItems":500,"items":{"type":"object","required":["source","target"],"properties":{"source":{"type":"string","format":"uri","maxLength":2048},"target":{"type":"string","format":"uri","maxLength":2048}}}},"maxPages":{"type":"integer","minimum":1,"maximum":500,"description":"Pages reserved and paid for. The job compares at most this many."},"threshold":{"type":"number","minimum":0,"maximum":1},"sitemapUrl":{"type":"string","format":"uri","maxLength":2048},"viewportWidth":{"type":"integer","minimum":320,"maximum":2560}}},"StartJobResponse":{"type":"object","required":["jobId","jobToken","status","maxPages","payment","links"],"properties":{"jobId":{"type":"string"},"jobToken":{"type":"string","description":"Bearer token for every later call on this job. Shown once."},"status":{"type":"string","enum":["running"]},"maxPages":{"type":"integer"},"payment":{"$ref":"#/components/schemas/Payment"},"links":{"type":"object","properties":{"self":{"type":"string"},"report":{"type":"string"},"cancel":{"type":"string"}}}}},"JobStatus":{"type":"object","required":["jobId","status","progress"],"properties":{"jobId":{"type":"string"},"status":{"type":"string","enum":["running","completed","failed","cancelled"]},"progress":{"type":"object","properties":{"discovered":{"type":"integer"},"compared":{"type":"integer"},"issues":{"type":"integer"}}},"error":{"type":"string"},"createdAt":{"type":"integer","description":"Epoch ms."},"updatedAt":{"type":"integer","description":"Epoch ms."}}},"Report":{"type":"object","required":["jobId","status"],"properties":{"jobId":{"type":"string"},"status":{"type":"string"},"cancelled":{"type":"boolean"},"summary":{"type":"object","description":"Totals and per-check pass/fail counts."},"results":{"type":"array","description":"One entry per compared page with existence, content and visual checks.","items":{"type":"object"}},"text":{"type":"string","description":"The plain-text report (report.txt)."},"error":{"type":"string"}}}},"securitySchemes":{"payment":{"type":"http","scheme":"Payment","description":"Machine Payments Protocol (mpp.dev). A first request without a credential is answered with 402 and a WWW-Authenticate: Payment challenge; the paid retry carries Authorization: Payment <credential>. Successful responses carry a Payment-Receipt header. x402 clients are accepted on the same routes for USDC on Base."},"jobToken":{"type":"http","scheme":"bearer","description":"The jobToken returned when the job or screenshot was created."}}}}