{
  "openapi": "3.1.0",
  "info": {
    "title": "LLM Guard API",
    "description": "API to run LLM Guard scanners.",
    "version": "0.0.10"
  },
  "paths": {
    "/": {
      "get": {
        "tags": [
          "Main"
        ],
        "summary": "Read Root",
        "operationId": "read_root__get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/healthz": {
      "get": {
        "tags": [
          "Health"
        ],
        "summary": "Read Healthcheck",
        "operationId": "read_healthcheck_healthz_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/readyz": {
      "get": {
        "tags": [
          "Health"
        ],
        "summary": "Read Liveliness",
        "operationId": "read_liveliness_readyz_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/analyze/output": {
      "post": {
        "tags": [
          "Analyze"
        ],
        "summary": "Submit Analyze Output",
        "description": "Analyze an output and return the sanitized output and the results of the scanners",
        "operationId": "submit_analyze_output_analyze_output_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyzeOutputRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyzeOutputResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/scan/output": {
      "post": {
        "tags": [
          "Analyze"
        ],
        "summary": "Submit Scan Output",
        "description": "Scans an output running scanners in parallel without sanitizing the prompt",
        "operationId": "submit_scan_output_scan_output_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanOutputRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanOutputResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/analyze/prompt": {
      "post": {
        "tags": [
          "Analyze"
        ],
        "summary": "Submit Analyze Prompt",
        "description": "Analyze a prompt and return the sanitized prompt and the results of the scanners",
        "operationId": "submit_analyze_prompt_analyze_prompt_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyzePromptRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyzePromptResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/scan/prompt": {
      "post": {
        "tags": [
          "Analyze"
        ],
        "summary": "Submit Scan Prompt",
        "description": "Scans a prompt running scanners in parallel without sanitizing the prompt",
        "operationId": "submit_scan_prompt_scan_prompt_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanPromptRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanPromptResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/metrics": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Read Metrics",
        "operationId": "read_metrics_metrics_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AnalyzeOutputRequest": {
        "properties": {
          "prompt": {
            "type": "string",
            "title": "Prompt"
          },
          "output": {
            "type": "string",
            "title": "Model output"
          },
          "scanners_suppress": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Scanners to suppress",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "prompt",
          "output"
        ],
        "title": "AnalyzeOutputRequest"
      },
      "AnalyzeOutputResponse": {
        "properties": {
          "is_valid": {
            "type": "boolean",
            "title": "Whether the output is safe"
          },
          "scanners": {
            "additionalProperties": {
              "type": "number"
            },
            "type": "object",
            "title": "Risk scores of individual scanners"
          },
          "sanitized_output": {
            "type": "string",
            "title": "Sanitized output"
          }
        },
        "type": "object",
        "required": [
          "is_valid",
          "scanners",
          "sanitized_output"
        ],
        "title": "AnalyzeOutputResponse"
      },
      "AnalyzePromptRequest": {
        "properties": {
          "prompt": {
            "type": "string",
            "title": "Prompt"
          },
          "scanners_suppress": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Scanners to suppress",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "prompt"
        ],
        "title": "AnalyzePromptRequest"
      },
      "AnalyzePromptResponse": {
        "properties": {
          "is_valid": {
            "type": "boolean",
            "title": "Whether the prompt is safe"
          },
          "scanners": {
            "additionalProperties": {
              "type": "number"
            },
            "type": "object",
            "title": "Risk scores of individual scanners"
          },
          "sanitized_prompt": {
            "type": "string",
            "title": "Sanitized prompt"
          }
        },
        "type": "object",
        "required": [
          "is_valid",
          "scanners",
          "sanitized_prompt"
        ],
        "title": "AnalyzePromptResponse"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ScanOutputRequest": {
        "properties": {
          "prompt": {
            "type": "string",
            "title": "Prompt"
          },
          "output": {
            "type": "string",
            "title": "Model output"
          },
          "scanners_suppress": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Scanners to suppress",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "prompt",
          "output"
        ],
        "title": "ScanOutputRequest"
      },
      "ScanOutputResponse": {
        "properties": {
          "is_valid": {
            "type": "boolean",
            "title": "Whether the output is safe"
          },
          "scanners": {
            "additionalProperties": {
              "type": "number"
            },
            "type": "object",
            "title": "Risk scores of individual scanners"
          }
        },
        "type": "object",
        "required": [
          "is_valid",
          "scanners"
        ],
        "title": "ScanOutputResponse"
      },
      "ScanPromptRequest": {
        "properties": {
          "prompt": {
            "type": "string",
            "title": "Prompt"
          },
          "scanners_suppress": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Scanners to suppress",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "prompt"
        ],
        "title": "ScanPromptRequest"
      },
      "ScanPromptResponse": {
        "properties": {
          "is_valid": {
            "type": "boolean",
            "title": "Whether the prompt is safe"
          },
          "scanners": {
            "additionalProperties": {
              "type": "number"
            },
            "type": "object",
            "title": "Risk scores of individual scanners"
          }
        },
        "type": "object",
        "required": [
          "is_valid",
          "scanners"
        ],
        "title": "ScanPromptResponse"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}