openapi: 3.1.0 info: title: Toxicity Verify API version: 1.1.0 paths: /classify: post: summary: Classify description: ✨ Classify text as SPAM or NOSPAM. operationId: classify_classify_post requestBody: content: application/json: schema: $ref: '#/components/schemas/Req' required: true responses: '200': description: Successful Response content: application/json: schema: additionalProperties: true type: object title: Response Classify Classify Post '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /health: get: summary: Health description: |- ✨ Unified health check for all models. Returns status for spam classifier, toxicity classifier, and system info. operationId: health_health_get responses: '200': description: Successful Response content: application/json: schema: additionalProperties: true type: object title: Response Health Health Get /metrics: get: summary: Metrics description: |- ✨ Expose basic metrics about the application. Note: If OTEL_PROMETHEUS_ENABLED is True, Prometheus metrics are available on a separate port (default: 8001) at the standard /metrics endpoint. operationId: metrics_metrics_get responses: '200': description: Successful Response content: application/json: schema: {} /toxicity/check: post: summary: Toxicity Check description: |- ✨ Classify a single text for toxicity. Uses thread offload to avoid blocking the event loop. operationId: toxicity_check_toxicity_check_post requestBody: content: application/json: schema: $ref: '#/components/schemas/ToxicityCheckIn' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ToxicityScores' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /toxicity/check-batch: post: summary: Toxicity Check Batch description: |- ✨ Classify multiple texts for toxicity in one call. Uses thread offload to avoid blocking the event loop. operationId: toxicity_check_batch_toxicity_check_batch_post requestBody: content: application/json: schema: $ref: '#/components/schemas/ToxicityBatchIn' required: true responses: '200': description: Successful Response content: application/json: schema: items: $ref: '#/components/schemas/ToxicityScores' type: array title: Response Toxicity Check Batch Toxicity Check Batch Post '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /check-all: post: summary: Check All description: |- ✨ Perform both spam and toxicity checks simultaneously. This endpoint runs both classifiers in parallel and returns a combined result, which is more efficient than making two separate API calls. Args: payload: Contains text and optional thresholds for both checks Returns: Combined result with spam detection, toxicity detection, and overall verdict operationId: check_all_check_all_post requestBody: content: application/json: schema: $ref: '#/components/schemas/CombinedCheckIn' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/CombinedCheckResult' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: CombinedCheckIn: properties: text: type: string title: Text spam_threshold: anyOf: - type: number - type: 'null' title: Spam Threshold toxicity_threshold: type: number title: Toxicity Threshold default: 0.5 type: object required: - text title: CombinedCheckIn CombinedCheckResult: properties: text: type: string title: Text spam: additionalProperties: true type: object title: Spam toxicity: additionalProperties: true type: object title: Toxicity is_safe: type: boolean title: Is Safe verdict: type: string title: Verdict type: object required: - text - spam - toxicity - is_safe - verdict title: CombinedCheckResult HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError Req: properties: text: type: string title: Text threshold: anyOf: - type: number - type: 'null' title: Threshold type: object required: - text title: Req ToxicityBatchIn: properties: texts: items: type: string type: array title: Texts threshold: type: number title: Threshold default: 0.5 type: object required: - texts title: ToxicityBatchIn ToxicityCheckIn: properties: text: type: string title: Text threshold: type: number title: Threshold default: 0.5 type: object required: - text title: ToxicityCheckIn ToxicityScores: properties: verdict: type: string title: Verdict toxic: type: number title: Toxic neutral: type: number title: Neutral raw: items: {} type: array title: Raw type: object required: - verdict - toxic - neutral - raw title: ToxicityScores 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