{
  "openapi": "3.1.0",
  "info": {
    "title": "VeriAI — AI Output Integrity Layer",
    "version": "1.0.0",
    "description": "Score, hash, and permanently anchor any AI-generated output in one API call. Returns a trust score (0–100), SHA-256 proof hash, and permanent shareable proof URL. No auth required.",
    "x-logo": { "url": "https://veriai.site/favicon.svg" }
  },
  "servers": [{ "url": "https://veriai.site", "description": "Production" }],
  "paths": {
    "/api/verifications": {
      "post": {
        "operationId": "createVerification",
        "summary": "Verify an AI output",
        "description": "Anchor an AI-generated output to the VeriAI public ledger. Returns a trust score (0–100), SHA-256 proof hash, and permanent shareable proof URL. No API key required. Free: 5/day. Pro ($29 one-time): unlimited.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["provider", "model", "prompt", "output"],
                "properties": {
                  "sessionId": { "type": "string", "description": "Optional UUID to track your verifications across calls. Omit to auto-generate." },
                  "provider": { "type": "string", "enum": ["OpenAI", "Anthropic", "Google", "xAI", "Meta", "Mistral", "Cohere", "Ollama", "Other"], "example": "OpenAI" },
                  "model": { "type": "string", "example": "gpt-4o" },
                  "prompt": { "type": "string", "description": "The original prompt sent to the AI" },
                  "output": { "type": "string", "description": "The AI-generated text to verify" }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Verification created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": { "type": "string", "format": "uuid" },
                    "trustScore": { "type": "integer", "minimum": 0, "maximum": 100, "description": "Trust score 0–100. Above 70 = verified, below 70 = flagged." },
                    "status": { "type": "string", "enum": ["verified", "flagged"] },
                    "proofHash": { "type": "string", "description": "SHA-256 hash of the verification" },
                    "shareableLink": { "type": "string", "format": "uri", "description": "Permanent public proof URL" },
                    "badgeHtml": { "type": "string", "description": "Embeddable HTML trust badge" },
                    "checks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": { "type": "string" },
                          "passed": { "type": "boolean" },
                          "score": { "type": "integer" },
                          "detail": { "type": "string" }
                        }
                      }
                    },
                    "createdAt": { "type": "string", "format": "date-time" }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listVerifications",
        "summary": "List verifications",
        "parameters": [
          { "name": "sessionId", "in": "query", "schema": { "type": "string" } },
          { "name": "limit", "in": "query", "schema": { "type": "integer", "default": 20 } },
          { "name": "offset", "in": "query", "schema": { "type": "integer", "default": 0 } }
        ],
        "responses": { "200": { "description": "Array of verifications" } }
      }
    },
    "/api/verifications/{id}": {
      "get": {
        "operationId": "getVerification",
        "summary": "Get a verification by ID",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Verification record" }, "404": { "description": "Not found" } }
      }
    },
    "/api/ledger/stats": {
      "get": {
        "operationId": "getLedgerStats",
        "summary": "Get global platform stats",
        "responses": {
          "200": {
            "description": "Global stats",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "totalVerifications": { "type": "integer" },
                    "verifiedToday": { "type": "integer" },
                    "avgTrustScore": { "type": "number" },
                    "totalProviders": { "type": "integer" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/mcp": {
      "get": { "operationId": "getMcpInfo", "summary": "MCP server info", "responses": { "200": { "description": "MCP config" } } },
      "post": { "operationId": "mcpJsonRpc", "summary": "MCP JSON-RPC (Streamable HTTP)", "requestBody": { "content": { "application/json": { "schema": { "type": "object" } } } }, "responses": { "200": { "description": "JSON-RPC response" } } }
    }
  }
}
