{"openapi":"3.1.0","info":{"title":"DeviceCheck","version":"0.2.0","description":"Physical-iPhone Safari flow evidence. One origin, up to 12 steps; $5 for completed evidence only. Bounded beta.","x-guidance":"Check /health for admission capacity. POST /v1/jobs with a private random Idempotency-Key and a plan containing a public HTTPS URL, CSS selector actions and at least one assertion. Save job_id and access_token. Poll /v1/jobs/{job_id} with X-Job-Token every 20 seconds. When ready, GET its /result with the same token and handle the 5.00 USDC.e MPP Challenge. All artifact downloads use X-Job-Token and are included after payment. Never pay for pending or inconclusive jobs. Only authorized public synthetic staging flows; no secrets, purchases, messages or destructive actions. Files expire 48 hours after submission.","contact":{"name":"Dave Kiss","url":"https://devicecheck-mpp.dave-baa.workers.dev/provider"}},"components":{"securitySchemes":{"jobToken":{"type":"apiKey","in":"header","name":"X-Job-Token","description":"Private access_token returned by job submission; no signup required."}}},"servers":[{"url":"https://devicecheck-mpp.dave-baa.workers.dev"}],"paths":{"/health":{"get":{"operationId":"getCapacity","security":[],"responses":{"200":{"description":"Admission capacity and supported device; provider availability is checked when processing a job","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/jobs":{"post":{"operationId":"submitFlow","security":[],"summary":"Submit a bounded Safari flow; no payment yet","parameters":[{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{32,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["plan","authorized","synthetic_data_only"],"properties":{"plan":{"type":"object","additionalProperties":false,"required":["version","url","goal","steps"],"properties":{"version":{"const":1},"url":{"type":"string","format":"uri","maxLength":2048},"goal":{"type":"string","minLength":1,"maxLength":500},"steps":{"type":"array","minItems":1,"maxItems":12,"items":{"oneOf":[{"type":"object","additionalProperties":false,"required":["action","selector"],"properties":{"action":{"const":"tap"},"selector":{"type":"string","minLength":1,"maxLength":256}}},{"type":"object","additionalProperties":false,"required":["action","selector","text"],"properties":{"action":{"const":"fill"},"selector":{"type":"string","minLength":1,"maxLength":256},"text":{"type":"string","minLength":1,"maxLength":500}}},{"type":"object","additionalProperties":false,"required":["action","selector"],"properties":{"action":{"const":"assert_visible"},"selector":{"type":"string","minLength":1,"maxLength":256}}},{"type":"object","additionalProperties":false,"required":["action","selector","text"],"properties":{"action":{"const":"assert_text"},"selector":{"type":"string","minLength":1,"maxLength":256},"text":{"type":"string","minLength":1,"maxLength":500}}},{"type":"object","additionalProperties":false,"required":["action","pixels"],"properties":{"action":{"const":"scroll"},"pixels":{"type":"integer","minimum":-1500,"maximum":1500}}},{"type":"object","additionalProperties":false,"required":["action","seconds"],"properties":{"action":{"const":"wait"},"seconds":{"type":"integer","minimum":1,"maximum":5}}}]}}}},"authorized":{"const":true},"synthetic_data_only":{"const":true}}},"example":{"authorized":true,"synthetic_data_only":true,"plan":{"version":1,"url":"https://example.com/","goal":"Verify that the Example Domain heading is visible in Safari on a physical iPhone.","steps":[{"action":"assert_visible","selector":"h1"},{"action":"assert_text","selector":"h1","text":"Example Domain"}]}}}}},"responses":{"200":{"description":"Identical submission retry","content":{"application/json":{"schema":{"type":"object"}}}},"202":{"description":"Accepted: save job_id and access_token","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object"}}}},"409":{"description":"Key reused for different plan","content":{"application/json":{"schema":{"type":"object"}}}},"503":{"description":"Admission unavailable","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/jobs/{job_id}":{"get":{"operationId":"getFlowStatus","security":[{"jobToken":[]}],"parameters":[{"in":"path","name":"job_id","required":true,"schema":{"type":"string","format":"uuid"}},{"in":"header","name":"X-Job-Token","required":true,"schema":{"type":"string"},"description":"Private access_token from submission; keep this header on payment retries."}],"responses":{"200":{"description":"Poll every 20 seconds until ready or inconclusive","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Unknown job or invalid token","content":{"application/json":{"schema":{"type":"object"}}}},"410":{"description":"Expired","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/jobs/{job_id}/result":{"get":{"operationId":"buyFlowEvidence","security":[{"jobToken":[]}],"summary":"Pay 5.00 USDC.e for completed evidence; subsequent downloads included","parameters":[{"in":"path","name":"job_id","required":true,"schema":{"type":"string","format":"uuid"}},{"in":"header","name":"X-Job-Token","required":true,"schema":{"type":"string"},"description":"Private access_token from submission; keep this header on payment retries."}],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"5.00"},"protocols":[{"mpp":{"method":"tempo","intent":"charge","currency":"0x20c000000000000000000000b9537d11c60e8b50"}}],"offers":[{"method":"tempo","intent":"charge","amount":"5000000","currency":"0x20c000000000000000000000b9537d11c60e8b50","decimals":6,"chainId":4217}]},"responses":{"200":{"description":"Paid report, assertions, device identity, artifact URLs and SHA-256 hashes","content":{"application/json":{"schema":{"type":"object"}}}},"202":{"description":"Not ready; no payment due","content":{"application/json":{"schema":{"type":"object"}}}},"402":{"description":"MPP payment Challenge","content":{"application/json":{"schema":{"type":"object"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"410":{"description":"Expired or payment window closed","content":{"application/json":{"schema":{"type":"object"}}}},"422":{"description":"Inconclusive; no payment due","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/jobs/{job_id}/artifacts/{filename}":{"get":{"operationId":"downloadEvidence","security":[{"jobToken":[]}],"parameters":[{"in":"path","name":"job_id","required":true,"schema":{"type":"string","format":"uuid"}},{"in":"header","name":"X-Job-Token","required":true,"schema":{"type":"string"},"description":"Private access_token from submission; keep this header on payment retries."},{"in":"path","name":"filename","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Included after report purchase","content":{"image/png":{"schema":{"type":"string","format":"binary"}},"video/mp4":{"schema":{"type":"string","format":"binary"}}}},"403":{"description":"Buy the report first","content":{"application/json":{"schema":{"type":"object"}}}}}}}}}