{"openapi":"3.1.0","info":{"title":"DELTA Witness — Trust Layer for Autonomous Actions","version":"0.6.1","description":"Capture public source observations and run deterministic preflight checks. DELTA proves observation and change, not truth.","contact":{"name":"DELTA Witness","email":"ruphussten@163.com","url":"https://delta-witness-api.ruphussten.workers.dev/docs"},"x-guidance":"Call GET /v1/quote before budgeting. Capture preserves a public observation; Guard compares one with deterministic expectations. Runtime HTTP 402 payment requirements are authoritative."},"servers":[{"url":"https://delta-witness-api.ruphussten.workers.dev"}],"paths":{"/health":{"get":{"operationId":"health","security":[],"responses":{"200":{"description":"Healthy"}}}},"/v1/quote":{"get":{"operationId":"quote","security":[],"parameters":[{"name":"product","in":"query","schema":{"enum":["capture","preflight"]}}],"responses":{"200":{"description":"Current floor-aware quote"}}}},"/v1/capture":{"post":{"operationId":"capturePublicSource","summary":"Preserve what a public page says now","description":"x402 v2 upfront settlement. Current calculated price: $0.03.","security":[],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.03"},"protocols":[{"x402":{}}],"network":"eip155:8453"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"url":{"type":"string","pattern":"^https?://","description":"Public HTTP(S) webpage to observe."}},"required":["url"]}}}},"responses":{"200":{"description":"Paid observation delivered","content":{"application/json":{"schema":{"type":"object","required":["ok","product","proof_id","manifest_url","public_proof_url","bundle_root","observed_at"],"properties":{"ok":{"const":true},"product":{"enum":["capture","preflight"]},"proof_id":{"type":"string","pattern":"^[0-9a-fA-F-]{36}$"},"manifest_url":{"type":"string","pattern":"^https?://"},"public_proof_url":{"type":"string","pattern":"^https?://"},"bundle_root":{"type":"string"},"observed_at":{"type":"string"},"safe":{"type":["boolean","null"]},"changed":{"type":["boolean","null"]},"reason":{"type":"string"},"diff":{"type":"object"},"idempotent_replay":{"type":"boolean"}}}}}},"202":{"description":"An identical settled fulfillment is already in progress"},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"402":{"description":"x402 v2 payment required or settlement failed"},"409":{"description":"Payment replay attempted with a different request"},"413":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"502":{"description":"Settled observation failed; identical retry remains idempotent"}}}},"/v1/preflight":{"post":{"operationId":"guardAutonomousAction","summary":"Observe a public source and compare it with a deterministic baseline","description":"Returns safe/changed/reason/diff plus a proof reference. Current calculated price: $0.03.","security":[],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.03"},"protocols":[{"x402":{}}],"network":"eip155:8453"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"url":{"type":"string","pattern":"^https?://","description":"Public HTTP(S) source to observe before an action."},"prior_proof_id":{"type":"string","pattern":"^[0-9a-fA-F-]{36}$","description":"Optional DELTA proof to use as the hash baseline."},"expected":{"type":"object","additionalProperties":false,"properties":{"html_sha256":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"markdown_sha256":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"contains":{"type":"array","maxItems":10,"items":{"type":"string","maxLength":200}},"excludes":{"type":"array","maxItems":10,"items":{"type":"string","maxLength":200}}}},"freshness_seconds":{"type":"integer","minimum":0,"maximum":2592000}},"required":["url"]}}}},"responses":{"200":{"description":"Paid observation delivered","content":{"application/json":{"schema":{"type":"object","required":["ok","product","proof_id","manifest_url","public_proof_url","bundle_root","observed_at"],"properties":{"ok":{"const":true},"product":{"enum":["capture","preflight"]},"proof_id":{"type":"string","pattern":"^[0-9a-fA-F-]{36}$"},"manifest_url":{"type":"string","pattern":"^https?://"},"public_proof_url":{"type":"string","pattern":"^https?://"},"bundle_root":{"type":"string"},"observed_at":{"type":"string"},"safe":{"type":["boolean","null"]},"changed":{"type":["boolean","null"]},"reason":{"type":"string"},"diff":{"type":"object"},"idempotent_replay":{"type":"boolean"}}}}}},"202":{"description":"An identical settled fulfillment is already in progress"},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"402":{"description":"x402 v2 payment required or settlement failed"},"409":{"description":"Payment replay attempted with a different request"},"413":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"502":{"description":"Settled observation failed; identical retry remains idempotent"}}}},"/v1/proofs/{proof_id}":{"get":{"operationId":"verifyProof","summary":"Read public proof metadata and hashes (raw artifacts remain private)","security":[],"parameters":[{"name":"proof_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Verifier metadata"},"404":{"description":"Not found"}}}},"/v1/demo":{"get":{"operationId":"getDemoProof","security":[],"responses":{"200":{"description":"Known free proof example"}}}}}}