{
 "openapi": "3.1.0",
 "info": {
  "title": "CORDON by BlvkWare",
  "version": "1.0.0",
  "description": "Content firewall for AI agents. Reads a URL or scans content you hold, removes what a human could not see, flags prompt-injection patterns, returns clean markdown with a verdict."
 },
 "servers": [
  {
   "url": "https://cordon.blvkware.dev"
  }
 ],
 "paths": {
  "/v1/read": {
   "get": {
    "operationId": "cordonRead",
    "summary": "Read a web page safely",
    "parameters": [
     {
      "name": "url",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "max_chars",
      "in": "query",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "links",
      "in": "query",
      "schema": {
       "type": "boolean"
      }
     },
     {
      "name": "full",
      "in": "query",
      "schema": {
       "type": "boolean"
      }
     },
     {
      "name": "mode",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "flag",
        "redact"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Verdict and cleaned content",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "verdict": {
           "type": "string",
           "enum": [
            "clean",
            "suspicious",
            "hostile"
           ]
          },
          "risk": {
           "type": "integer",
           "minimum": 0,
           "maximum": 100
          },
          "safeToIngest": {
           "type": "boolean"
          },
          "findings": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "rule": {
              "type": "string"
             },
             "category": {
              "type": "string"
             },
             "channel": {
              "type": "string"
             },
             "count": {
              "type": "integer"
             },
             "severity": {
              "type": "string"
             },
             "excerpt": {
              "type": "string"
             }
            }
           }
          },
          "removed": {
           "type": "object"
          },
          "markdown": {
           "type": "string"
          },
          "sanitized": {
           "type": "string"
          },
          "tokensEstimate": {
           "type": "integer"
          },
          "receipt": {
           "type": "object"
          },
          "billing": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "402": {
      "description": "Payment required. Body lists payment options; PAYMENT-REQUIRED header present when x402 is enabled."
     }
    }
   }
  },
  "/v1/scan": {
   "post": {
    "operationId": "cordonScan",
    "summary": "Scan content before ingesting it",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "content"
        ],
        "properties": {
         "content": {
          "type": "string"
         },
         "format": {
          "type": "string",
          "enum": [
           "auto",
           "html",
           "text"
          ]
         },
         "mode": {
          "type": "string",
          "enum": [
           "flag",
           "redact"
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Verdict and cleaned content",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "verdict": {
           "type": "string",
           "enum": [
            "clean",
            "suspicious",
            "hostile"
           ]
          },
          "risk": {
           "type": "integer",
           "minimum": 0,
           "maximum": 100
          },
          "safeToIngest": {
           "type": "boolean"
          },
          "findings": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "rule": {
              "type": "string"
             },
             "category": {
              "type": "string"
             },
             "channel": {
              "type": "string"
             },
             "count": {
              "type": "integer"
             },
             "severity": {
              "type": "string"
             },
             "excerpt": {
              "type": "string"
             }
            }
           }
          },
          "removed": {
           "type": "object"
          },
          "markdown": {
           "type": "string"
          },
          "sanitized": {
           "type": "string"
          },
          "tokensEstimate": {
           "type": "integer"
          },
          "receipt": {
           "type": "object"
          },
          "billing": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "402": {
      "description": "Payment required. Body lists payment options; PAYMENT-REQUIRED header present when x402 is enabled."
     }
    }
   }
  },
  "/v1/rules": {
   "get": {
    "operationId": "cordonRules",
    "summary": "Published rule set",
    "responses": {
     "200": {
      "description": "Rules"
     }
    }
   }
  },
  "/v1/pricing": {
   "get": {
    "operationId": "cordonPricing",
    "summary": "Prices and payment methods",
    "responses": {
     "200": {
      "description": "Pricing"
     }
    }
   }
  }
 },
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer",
    "description": "BlvkWare key (bk_live_...). Optional: the free tier needs no key."
   }
  }
 }
}