Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Moderations

Given text and/or image inputs, classifies if those inputs are potentially harmful.

Create moderation
moderations.create(**kwargs) -> ModerationCreateResponse { id, model, results }
POST/moderations
ModelsExpand Collapse
class Moderation { categories, category_applied_input_types, category_scores, flagged }
class ModerationCreateResponse { id, model, results }

Represents if a given text input is potentially harmful.

class ModerationImageURLInput { image_url, type }

An object describing an image to classify.

ModerationModel = :"omni-moderation-latest" | :"omni-moderation-2024-09-26" | :"text-moderation-latest" | :"text-moderation-stable"
ModerationMultiModalInput = ModerationImageURLInput { image_url, type } | ModerationTextInput { text, type }

An object describing an image to classify.

class ModerationTextInput { text, type }

An object describing text to classify.