{"openapi":"3.1.0","info":{"title":"AegisAI Verification API","version":"0.6.0","description":"Machine-native pre-execution risk verification for autonomous AI agents. Workers AI is enabled on the public deployment. POST /v1/verify uses x402 v2 exact payment on Base Sepolia: 0.01 USDC per request. Testnet payments have no cash value and are not refundable. Raw content is not stored by AegisAI; minimal operational metadata is retained for up to 30 days."},"jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","servers":[{"url":"https://aegis-api.kadopi.workers.dev","description":"Public Cloudflare Workers deployment."}],"tags":[{"name":"system","description":"Service health and machine-readable metadata."},{"name":"verification","description":"Pre-execution risk checks."}],"paths":{"/health":{"get":{"operationId":"getHealth","summary":"Check service health","tags":["system"],"responses":{"200":{"description":"The service is healthy.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/v1/capabilities":{"get":{"operationId":"getCapabilities","summary":"Get service capabilities","tags":["system"],"responses":{"200":{"description":"The capabilities and service limits.","content":{"application/json":{"schema":{"$ref":"./capabilities.schema.json"}}}}}}},"/v1/verify":{"post":{"operationId":"verifyContent","summary":"Verify content before an agent executes an action","description":"Runs the requested risk checks with Workers AI enabled after x402 v2 exact payment verification and settlement. The service accepts exactly 0.01 USDC (10,000 atomic units) on Base Sepolia (CAIP-2: eip155:84532); testnet payments have no cash value and are not refundable. A missing, invalid, replayed, or already-settled payment is rejected before verification runs. Source URLs are validated but not fetched.","tags":["verification"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/PaymentSignature"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerificationRequest"}}}},"responses":{"200":{"description":"Verification completed. The result is suitable for machine branching, but does not guarantee factual accuracy.","headers":{"PAYMENT-RESPONSE":{"description":"Base64-encoded x402 v2 SettlementResponse. Never log or persist this header value.","schema":{"type":"string","minLength":1}}},"content":{"application/json":{"schema":{"$ref":"./verification-result.schema.json"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"description":"Payment is required or the supplied payment could not be verified/settled. The caller may retry only with a newly-created x402 v2 PAYMENT-SIGNATURE; do not retry a rejected signature indefinitely.","headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded x402 v2 PaymentRequired object. It advertises the exact 0.01 USDC requirement on Base Sepolia. Never log or persist this header value.","schema":{"type":"string","minLength":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402PaymentRequired"}}}},"409":{"description":"The payment signature or Idempotency-Key was already claimed. The server does not settle or rerun verification a second time.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Request body or content exceeds the advertised limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"The request is not JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected service failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The facilitator or settlement service was unavailable. No verification is run. When retrying, create both a new PAYMENT-SIGNATURE and a new Idempotency-Key; reusing the old key returns 409 payment_replayed. Do not retry the same rejected payment signature indefinitely.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"description":"Recommended for every paid request. The same key cannot double-settle; a replay is rejected with 409 payment_replayed. After a retryable 503, use a new PAYMENT-SIGNATURE and a new Idempotency-Key; the old key cannot be reused. A key cannot be reused for a different request. The key is never treated as proof of payment.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"}},"PaymentSignature":{"name":"PAYMENT-SIGNATURE","in":"header","required":false,"description":"Base64-encoded x402 v2 PaymentPayload created from PAYMENT-REQUIRED. The server verifies it with the facilitator before settlement; the header alone never authorizes access. Raw values must not be logged or persisted.","schema":{"type":"string","minLength":1}}},"responses":{"BadRequest":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"HealthResponse":{"type":"object","additionalProperties":false,"required":["status","version","timestamp"],"properties":{"status":{"type":"string","const":"ok"},"version":{"type":"string"},"timestamp":{"type":"string","format":"date-time"}}},"VerificationRequest":{"type":"object","additionalProperties":false,"required":["content"],"properties":{"content":{"type":"string","minLength":1,"maxLength":12000,"description":"Text, data, or a proposed action to inspect. Content is not retained."},"context":{"type":"object","additionalProperties":false,"properties":{"intendedAction":{"type":"string","minLength":1,"maxLength":128},"riskTolerance":{"type":"string","enum":["low","medium","high"]}}},"sources":{"type":"array","maxItems":20,"items":{"$ref":"#/components/schemas/Source"}},"requestedChecks":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","enum":["prompt_injection","contradiction","unsupported_claims","source_availability"]}}}},"Source":{"type":"object","additionalProperties":false,"required":["type","value"],"properties":{"type":{"type":"string","const":"url"},"value":{"type":"string","format":"uri","maxLength":2048}}},"ErrorResponse":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string","minLength":1},"message":{"type":"string","minLength":1},"requestId":{"type":"string","minLength":1}}},"X402PaymentRequired":{"type":"object","additionalProperties":false,"required":["x402Version","resource","accepts"],"properties":{"x402Version":{"type":"integer","const":2},"error":{"type":"string"},"resource":{"$ref":"#/components/schemas/X402ResourceInfo"},"accepts":{"type":"array","minItems":1,"maxItems":1,"items":{"$ref":"#/components/schemas/X402PaymentRequirement"}},"extensions":{"type":"object","required":["bazaar"],"properties":{"bazaar":{"type":"object","required":["info","schema"],"properties":{"info":{"type":"object","required":["input","output"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"type":{"const":"http"},"method":{"const":"POST"},"bodyType":{"const":"json"},"body":{"type":"object"}}},"output":{"type":"object"}}},"schema":{"type":"object"}}}},"additionalProperties":true}}},"X402ResourceInfo":{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","format":"uri"},"description":{"type":"string"},"mimeType":{"type":"string"},"serviceName":{"type":"string","const":"AegisAI"},"tags":{"type":"array","items":{"type":"string"}}}},"X402PaymentRequirement":{"type":"object","additionalProperties":false,"required":["scheme","network","amount","asset","payTo","maxTimeoutSeconds"],"properties":{"scheme":{"type":"string","const":"exact"},"network":{"type":"string","const":"eip155:84532"},"amount":{"type":"string","const":"10000","description":"Exactly 10,000 atomic USDC units (0.01 USDC; USDC has 6 decimals)."},"asset":{"type":"string","const":"0x036CbD53842c5426634e7929541eC2318f3dCF7e","description":"USDC on Base Sepolia."},"payTo":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The AegisAI settlement recipient, supplied by deployment configuration."},"maxTimeoutSeconds":{"type":"integer","minimum":1},"extra":{"type":"object","additionalProperties":true}}}}}}