Skip to main content

Endpoint

Analyzes a single text through all three models (sexism classifier, toxicity transformer, rule engine) and returns a comprehensive moderation response with ensemble scoring.

Request

Headers

Body Parameters

string
required
The text to moderate. Should be a non-empty string.Min length: 1 character Max length: 10,000 characters (recommended)

Request Example

Response

Returns a ModerationResponse object with:
  • Individual model outputs (label)
  • Ensemble decision (ensemble)
  • Metadata (meta)

Response Schema

Success Response (200)

Error Responses

Cause: Invalid request body or empty text
Cause: Request body doesn’t match expected schema
Cause: Server error during processing

Performance

For optimal performance with multiple texts, use the batch endpoint instead of making multiple individual requests.

Use Cases

  • Real-time moderation: Moderate user comments before posting
  • Content filtering: Screen user-generated content
  • Chat moderation: Filter messages in real-time
  • Form validation: Check text inputs on submission

Best Practices

Preprocessing

The API handles preprocessing automatically. Send raw user input without manual cleaning.

Use Ensemble

Rely on ensemble.summary for quick decisions. Individual model outputs are available for detailed analysis.

Handle Errors

Implement proper error handling. The API returns detailed error messages.

Monitor Latency

Track processing_time_ms to monitor performance and detect issues.

Batch Moderation

Moderate multiple texts at once

Health Check

Check API health status

See Also