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
client.moderations.create(ModerationCreateParams { input, model } body, RequestOptionsoptions?): ModerationCreateResponse { id, model, results }
POST/moderations
ModelsExpand Collapse
Moderation { categories, category_applied_input_types, category_scores, flagged }
ModerationCreateResponse { id, model, results }

Represents if a given text input is potentially harmful.

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.

ModerationTextInput { text, type }

An object describing text to classify.