|
{ |
|
"openapi": "3.1.0", |
|
"info": { |
|
"title": "LLM Guard API", |
|
"description": "API to run LLM Guard scanners.", |
|
"version": "0.0.6" |
|
}, |
|
"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": "Healthcheck", |
|
"operationId": "healthcheck_healthz_get", |
|
"responses": { |
|
"200": { |
|
"description": "Successful Response", |
|
"content": { |
|
"application/json": { |
|
"schema": {} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/readyz": { |
|
"get": { |
|
"tags": [ |
|
"Health" |
|
], |
|
"summary": "Liveliness", |
|
"operationId": "liveliness_readyz_get", |
|
"responses": { |
|
"200": { |
|
"description": "Successful Response", |
|
"content": { |
|
"application/json": { |
|
"schema": {} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/analyze/output": { |
|
"post": { |
|
"tags": [ |
|
"Analyze" |
|
], |
|
"summary": "Analyze Output", |
|
"description": "Analyze an output and return the sanitized output and the results of the scanners", |
|
"operationId": "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": [] |
|
} |
|
] |
|
} |
|
}, |
|
"/analyze/prompt": { |
|
"post": { |
|
"tags": [ |
|
"Analyze" |
|
], |
|
"summary": "Analyze Prompt", |
|
"description": "Analyze a prompt and return the sanitized prompt and the results of the scanners", |
|
"operationId": "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": [] |
|
} |
|
] |
|
} |
|
}, |
|
"/metrics": { |
|
"get": { |
|
"tags": [ |
|
"Metrics" |
|
], |
|
"summary": "Metrics", |
|
"operationId": "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": "Output" |
|
} |
|
}, |
|
"type": "object", |
|
"required": [ |
|
"prompt", |
|
"output" |
|
], |
|
"title": "AnalyzeOutputRequest" |
|
}, |
|
"AnalyzeOutputResponse": { |
|
"properties": { |
|
"sanitized_output": { |
|
"type": "string", |
|
"title": "Sanitized Output" |
|
}, |
|
"is_valid": { |
|
"type": "boolean", |
|
"title": "Is Valid" |
|
}, |
|
"scanners": { |
|
"additionalProperties": { |
|
"type": "number" |
|
}, |
|
"type": "object", |
|
"title": "Scanners" |
|
} |
|
}, |
|
"type": "object", |
|
"required": [ |
|
"sanitized_output", |
|
"is_valid", |
|
"scanners" |
|
], |
|
"title": "AnalyzeOutputResponse" |
|
}, |
|
"AnalyzePromptRequest": { |
|
"properties": { |
|
"prompt": { |
|
"type": "string", |
|
"title": "Prompt" |
|
} |
|
}, |
|
"type": "object", |
|
"required": [ |
|
"prompt" |
|
], |
|
"title": "AnalyzePromptRequest" |
|
}, |
|
"AnalyzePromptResponse": { |
|
"properties": { |
|
"sanitized_prompt": { |
|
"type": "string", |
|
"title": "Sanitized Prompt" |
|
}, |
|
"is_valid": { |
|
"type": "boolean", |
|
"title": "Is Valid" |
|
}, |
|
"scanners": { |
|
"additionalProperties": { |
|
"type": "number" |
|
}, |
|
"type": "object", |
|
"title": "Scanners" |
|
} |
|
}, |
|
"type": "object", |
|
"required": [ |
|
"sanitized_prompt", |
|
"is_valid", |
|
"scanners" |
|
], |
|
"title": "AnalyzePromptResponse" |
|
}, |
|
"HTTPValidationError": { |
|
"properties": { |
|
"detail": { |
|
"items": { |
|
"$ref": "#/components/schemas/ValidationError" |
|
}, |
|
"type": "array", |
|
"title": "Detail" |
|
} |
|
}, |
|
"type": "object", |
|
"title": "HTTPValidationError" |
|
}, |
|
"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" |
|
} |
|
} |
|
} |
|
} |
|
|