Search⌘ K
AI Features

Moderations

Explore how to use the OpenAI moderations endpoint to analyze text for content policy compliance. Learn about request and response parameters, flagging mechanisms, and practical applications to detect hate speech, violence, and self-harm for safer user interactions and content management.

The moderations endpoint

Moderations is an endpoint that OpenAI provides to flag text. This API endpoint analyzes the text provided and evaluates whether the content complies with OpenAI’s usage policies. After the API analyzes the text, it tells the user which flags fit the text and the confidence that the API has for each flag.

Moderations
Moderations

The following URL uses the POST method, which can be used to call the moderations endpoint.

https://api.openai.com/v1/moderations

Understanding the moderations endpoint

Let’s look at the moderations endpoint in more detail, reviewing the various models, the request parameters, and the response parameters.

Request parameters

Let’s look at the parameters ...