{"openapi":"3.1.0","info":{"title":"Datoka API","version":"0.3.2"},"servers":[{"url":"https://datoka-api.bhazarstudio.workers.dev"}],"paths":{"/health":{"get":{"responses":{"200":{"description":"Service metadata"},"503":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/version":{"get":{"responses":{"200":{"description":"Service metadata"},"503":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/catalog":{"get":{"responses":{"200":{"description":"Service metadata"},"503":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/pricing":{"get":{"responses":{"200":{"description":"Service metadata"},"503":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/openapi.json":{"get":{"responses":{"200":{"description":"Service metadata"},"503":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/metrics":{"get":{"security":[{"bearer":[]}],"responses":{"200":{"description":"Process-local metrics; separate metrics credential required"},"401":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/mcp":{"post":{"security":[],"description":"MCP Streamable HTTP. Public paid tools use params._meta[x402/payment] and return result._meta[x402/payment-response].","responses":{"200":{"description":"JSON-RPC response; payment-required tool results contain x402 v2 requirements"},"202":{"description":"Notification accepted"},"400":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/operations/prepare_api_exchange":{"post":{"operationId":"prepare_api_exchange","description":"Validate a client-declared HTTP exchange and compute its commitment; no receipt is persisted.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"event":{"type":"object","properties":{"version":{"type":"string","const":"datoka.api.exchange.v1"},"attestation":{"type":"string","const":"client_declared"},"apiId":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"exchangeId":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"method":{"type":"string","enum":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"]},"status":{"type":"integer","minimum":200,"maximum":599},"startedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"},"completedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"},"targetHash":{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},"requestBodyHash":{"anyOf":[{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},{"type":"null"}]},"responseBodyHash":{"anyOf":[{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},{"type":"null"}]},"requestHeadersHash":{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},"responseHeadersHash":{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},"bodyEncoding":{"type":"string","const":"application_bytes"},"headerEncoding":{"type":"string","const":"jcs-selected-headers-v1"}},"required":["version","attestation","apiId","exchangeId","method","status","startedAt","completedAt","targetHash","requestBodyHash","responseBodyHash","requestHeadersHash","responseHeadersHash","bodyEncoding","headerEncoding"],"additionalProperties":false}},"required":["event"],"additionalProperties":false}}}},"responses":{"200":{"description":"Validated result; paid requests also include PAYMENT-RESPONSE","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"event":{"type":"object","properties":{"version":{"type":"string","const":"datoka.api.exchange.v1"},"attestation":{"type":"string","const":"client_declared"},"apiId":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"exchangeId":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"method":{"type":"string","enum":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"]},"status":{"type":"integer","minimum":200,"maximum":599},"startedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"},"completedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"},"targetHash":{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},"requestBodyHash":{"anyOf":[{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},{"type":"null"}]},"responseBodyHash":{"anyOf":[{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},{"type":"null"}]},"requestHeadersHash":{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},"responseHeadersHash":{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},"bodyEncoding":{"type":"string","const":"application_bytes"},"headerEncoding":{"type":"string","const":"jcs-selected-headers-v1"}},"required":["version","attestation","apiId","exchangeId","method","status","startedAt","completedAt","targetHash","requestBodyHash","responseBodyHash","requestHeadersHash","responseHeadersHash","bodyEncoding","headerEncoding"],"additionalProperties":false},"commitment":{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"encoding":{"type":"string","const":"jcs"},"digest":{"type":"string"}},"required":["algorithm","encoding","digest"],"additionalProperties":false},"chain":{"type":"string"}},"required":["event","commitment","chain"],"additionalProperties":false}}}},"400":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"x402 v2 offer in PAYMENT-REQUIRED header and JSON body. Preserve original authorization on retries."},"403":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/operations/issue_api_receipt":{"post":{"operationId":"issue_api_receipt","description":"Persist a signed commitment to a client-declared HTTP exchange. Public price: 0.002 USDC via x402 when enabled; otherwise requires pilot issuance permission. Preserve the event, idempotency key and original payment authorization on retries. This does not prove independent observation or the truth of the response.","security":[{"paymentSignature":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"event":{"type":"object","properties":{"version":{"type":"string","const":"datoka.api.exchange.v1"},"attestation":{"type":"string","const":"client_declared"},"apiId":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"exchangeId":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"method":{"type":"string","enum":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"]},"status":{"type":"integer","minimum":200,"maximum":599},"startedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"},"completedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"},"targetHash":{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},"requestBodyHash":{"anyOf":[{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},{"type":"null"}]},"responseBodyHash":{"anyOf":[{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},{"type":"null"}]},"requestHeadersHash":{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},"responseHeadersHash":{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},"bodyEncoding":{"type":"string","const":"application_bytes"},"headerEncoding":{"type":"string","const":"jcs-selected-headers-v1"}},"required":["version","attestation","apiId","exchangeId","method","status","startedAt","completedAt","targetHash","requestBodyHash","responseBodyHash","requestHeadersHash","responseHeadersHash","bodyEncoding","headerEncoding"],"additionalProperties":false},"idempotencyKey":{"type":"string","pattern":"^[\\x21-\\x7e]{16,200}$"}},"required":["event","idempotencyKey"],"additionalProperties":false}}}},"responses":{"200":{"description":"Validated result; paid requests also include PAYMENT-RESPONSE","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"event":{"type":"object","properties":{"version":{"type":"string","const":"datoka.api.exchange.v1"},"attestation":{"type":"string","const":"client_declared"},"apiId":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"exchangeId":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"method":{"type":"string","enum":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"]},"status":{"type":"integer","minimum":200,"maximum":599},"startedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"},"completedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"},"targetHash":{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},"requestBodyHash":{"anyOf":[{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},{"type":"null"}]},"responseBodyHash":{"anyOf":[{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},{"type":"null"}]},"requestHeadersHash":{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},"responseHeadersHash":{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},"bodyEncoding":{"type":"string","const":"application_bytes"},"headerEncoding":{"type":"string","const":"jcs-selected-headers-v1"}},"required":["version","attestation","apiId","exchangeId","method","status","startedAt","completedAt","targetHash","requestBodyHash","responseBodyHash","requestHeadersHash","responseHeadersHash","bodyEncoding","headerEncoding"],"additionalProperties":false},"receipt":{"type":"object","properties":{"body":{"type":"object","properties":{"version":{"type":"string","const":"datoka.receipt.v1"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"issuer":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"keyId":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"issuedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"},"request":{"type":"object","properties":{"scope":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"chain":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"eventType":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"subject":{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"encoding":{"type":"string","enum":["jcs","bytes"]},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","encoding","digest"],"additionalProperties":false}},"required":["scope","chain","eventType","subject"],"additionalProperties":false},"sequence":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"previous":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]}},"required":["version","id","issuer","keyId","issuedAt","request","sequence","previous"],"additionalProperties":false},"algorithm":{"type":"string","const":"Ed25519"},"signature":{"type":"string","pattern":"^[A-Za-z0-9_-]{86}$"}},"required":["body","algorithm","signature"],"additionalProperties":false}},"required":["event","receipt"],"additionalProperties":false}}}},"400":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"x402 v2 offer in PAYMENT-REQUIRED header and JSON body. Preserve original authorization on retries."},"403":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/operations/verify_api_receipt":{"post":{"operationId":"verify_api_receipt","description":"Verify signature, trusted issuer, tenant, event commitment and API protocol semantics.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"event":{"type":"object","properties":{"version":{"type":"string","const":"datoka.api.exchange.v1"},"attestation":{"type":"string","const":"client_declared"},"apiId":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"exchangeId":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"method":{"type":"string","enum":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"]},"status":{"type":"integer","minimum":200,"maximum":599},"startedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"},"completedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"},"targetHash":{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},"requestBodyHash":{"anyOf":[{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},{"type":"null"}]},"responseBodyHash":{"anyOf":[{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},{"type":"null"}]},"requestHeadersHash":{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},"responseHeadersHash":{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","digest"],"additionalProperties":false},"bodyEncoding":{"type":"string","const":"application_bytes"},"headerEncoding":{"type":"string","const":"jcs-selected-headers-v1"}},"required":["version","attestation","apiId","exchangeId","method","status","startedAt","completedAt","targetHash","requestBodyHash","responseBodyHash","requestHeadersHash","responseHeadersHash","bodyEncoding","headerEncoding"],"additionalProperties":false},"receipt":{"type":"object","properties":{"body":{"type":"object","properties":{"version":{"type":"string","const":"datoka.receipt.v1"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"issuer":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"keyId":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"issuedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"},"request":{"type":"object","properties":{"scope":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"chain":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"eventType":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"subject":{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"encoding":{"type":"string","enum":["jcs","bytes"]},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["algorithm","encoding","digest"],"additionalProperties":false}},"required":["scope","chain","eventType","subject"],"additionalProperties":false},"sequence":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"previous":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]}},"required":["version","id","issuer","keyId","issuedAt","request","sequence","previous"],"additionalProperties":false},"algorithm":{"type":"string","const":"Ed25519"},"signature":{"type":"string","pattern":"^[A-Za-z0-9_-]{86}$"}},"required":["body","algorithm","signature"],"additionalProperties":false}},"required":["event","receipt"],"additionalProperties":false}}}},"responses":{"200":{"description":"Validated result; paid requests also include PAYMENT-RESPONSE","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"valid":{"type":"boolean","const":true},"receiptId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"scope":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"apiId":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"exchangeId":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"attestation":{"type":"string","const":"client_declared"}},"required":["valid","receiptId","scope","apiId","exchangeId","attestation"],"additionalProperties":false}}}},"400":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"x402 v2 offer in PAYMENT-REQUIRED header and JSON body. Preserve original authorization on retries."},"403":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/operations/get_api_public_keys":{"post":{"operationId":"get_api_public_keys","description":"Return issuer public keys. Establish issuer trust independently before offline verification.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{},"additionalProperties":false}}}},"responses":{"200":{"description":"Validated result; paid requests also include PAYMENT-RESPONSE","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"issuer":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"keys":{"type":"array","items":{"type":"object","properties":{"keyId":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"jwk":{"type":"object","properties":{"kty":{"type":"string","const":"OKP"},"crv":{"type":"string","const":"Ed25519"},"x":{"type":"string"},"key_ops":{"type":"array","items":{"type":"string"}},"ext":{"type":"boolean"}},"required":["kty","crv","x"],"additionalProperties":false}},"required":["keyId","jwk"],"additionalProperties":false}}},"required":["issuer","keys"],"additionalProperties":false}}}},"400":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"x402 v2 offer in PAYMENT-REQUIRED header and JSON body. Preserve original authorization on retries."},"403":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Structured Datoka error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"},"paymentSignature":{"type":"apiKey","in":"header","name":"PAYMENT-SIGNATURE","description":"Base64 x402 v2 PaymentPayload with EIP-3009 EOA signature"}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"}}}}}}}}