{
  "openapi": "3.1.0",
  "info": { "title": "Sunward Proof Utilities API", "version": "1.2.0", "description": "Free public proof, change-detection, and respectful-communication endpoints. No wallet, account, or personal data required." },
  "servers": [{ "url": "https://sunward-proof-receipts.aadoc.chatgpt.site" }],
  "paths": {
    "/api/delivery-audit": {
      "post": {
        "operationId": "createDeliveryReadinessAudit",
        "summary": "Map requirements to evidence and return a gap-and-proof receipt",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeliveryAudit" } } } },
        "responses": { "200": { "description": "Delivery readiness audit", "content": { "application/json": { "schema": { "type": "object" } } } }, "400": { "description": "Invalid audit JSON" } }
      }
    },
    "/api/change-receipt": {
      "post": {
        "operationId": "createChangeReceipt",
        "summary": "Compare supplied before-and-after text and flag important changed terms",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChangeReceipt" } } } },
        "responses": { "200": { "description": "Change receipt", "content": { "application/json": { "schema": { "type": "object" } } } }, "400": { "description": "Invalid comparison JSON" } }
      }
    },
    "/api/respectful-message": {
      "post": {
        "operationId": "createRespectfulMessageReceipt",
        "summary": "Screen a supplied draft for manipulative or harmful patterns",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RespectfulMessage" } } } },
        "responses": { "200": { "description": "Respectful-message receipt", "content": { "application/json": { "schema": { "type": "object" } } } }, "400": { "description": "Invalid message JSON" } }
      }
    },
    "/api/receipt": {
      "post": {
        "operationId": "createProofReceipt",
        "summary": "Screen an agent task and return a proof receipt",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Task" } } } },
        "responses": { "200": { "description": "Proof receipt", "content": { "application/json": { "schema": { "type": "object" } } } }, "400": { "description": "Invalid task JSON" } }
      }
    }
  },
  "components": {
    "schemas": {
      "DeliveryAudit": {
        "type": "object",
        "required": ["title", "requirements", "evidence"],
        "properties": {
          "title": { "type": "string" },
          "requirements": { "type": "array", "items": { "type": "string" } },
          "evidence": { "type": "array", "items": { "type": "string" } },
          "constraints": { "type": "array", "items": { "type": "string" } }
        }
      },
      "Task": {
        "type": "object",
        "required": ["title", "description", "budget_amount", "budget_token", "acceptance_criteria"],
        "properties": {
          "title": { "type": "string" }, "description": { "type": "string" }, "budget_amount": { "type": ["string", "number"] }, "budget_token": { "type": "string" }, "acceptance_criteria": { "type": "array", "items": { "type": "string" } }
        }
      },
      "ChangeReceipt": {
        "type": "object", "required": ["before", "after"],
        "properties": { "title": { "type": "string" }, "before": { "type": "string" }, "after": { "type": "string" }, "watch_terms": { "type": "array", "items": { "type": "string" } } }
      },
      "RespectfulMessage": {
        "type": "object", "required": ["message"],
        "properties": { "message": { "type": "string" }, "context": { "type": "string" } }
      }
    }
  }
}
