{
  "openapi": "3.1.0",
  "info": {
    "title": "SecondCheck Multi-Model Verification API",
    "version": "1.0.0",
    "description": "Pay-per-call multi-model AI verification and consensus APIs gated via x402 v2 (Base Mainnet USDC). Cross-checks AI outputs, code diffs, and factual claims across independent frontier models.",
    "contact": {
      "email": "ops.secondcheck@gmail.com",
      "url": "https://secondcheck.dev"
    }
  },
  "servers": [
    {
      "url": "https://api.secondcheck.dev",
      "description": "Production Edge API"
    }
  ],
  "paths": {
    "/v1/tiers": {
      "get": {
        "operationId": "getTiers",
        "summary": "List available verification tiers, USDC pricing, and input schemas (Free)",
        "responses": {
          "200": {
            "description": "Operational status and tier metadata"
          }
        }
      }
    },
    "/v1/check/quick": {
      "post": {
        "operationId": "checkQuick",
        "summary": "Quick Check ($0.05 USDC via x402) — Dual-model fast pass/fail verification (up to 4,000 chars)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Consensus verdict, confidence score, risk flags, and per-model votes"
          },
          "402": {
            "description": "x402 v2 Payment Required challenge (PAYMENT-REQUIRED header)"
          }
        }
      }
    },
    "/v1/check/standard": {
      "post": {
        "operationId": "checkStandard",
        "summary": "Standard Consensus ($0.10 USDC via x402) — 3-model independent panel with risk flags (up to 8,000 chars)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "3-model consensus verdict and votes"
          },
          "402": {
            "description": "x402 v2 Payment Required challenge (PAYMENT-REQUIRED header)"
          }
        }
      }
    },
    "/v1/check/deep": {
      "post": {
        "operationId": "checkDeep",
        "summary": "Deep Audit ($0.50 USDC via x402) — Flagship 3-model reasoning audit with strict fail sensitivity (up to 12,000 chars)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deep audit consensus verdict and votes"
          },
          "402": {
            "description": "x402 v2 Payment Required challenge (PAYMENT-REQUIRED header)"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CheckRequest": {
        "type": "object",
        "required": [
          "claim_or_output"
        ],
        "properties": {
          "claim_or_output": {
            "type": "string",
            "description": "The AI-generated text, claim, or code diff to verify."
          },
          "context": {
            "type": "string",
            "description": "Optional ground-truth facts, compliance rules, or grading rubric."
          }
        }
      }
    }
  }
}