Moderations

moderations

Methods

Create Moderation -> { id, model, results }
post/moderations

Classifies if text and/or image inputs are potentially harmful. Learn more in the moderation guide.

Security
Bearer Auth

Example: Authorization: Bearer My API Key

Body parameters
input: string | Array<string> | Array<>

Input (or inputs) to classify. Can be a single string, an array of strings, or an array of multi-modal input objects similar to other models.

model?: string |

The content moderation model you would like to use. Learn more in the moderation guide, and learn about available models here.

Response fields
id: string

The unique identifier for the moderation request.

model: string

The model used to generate the moderation results.

results: Array<>

A list of moderation objects.

Request example
200Example

Domain types

Moderation = { categories, category_applied_input_types, category_scores, 1 more... }
ModerationImageURLInput = { image_url, type }
ModerationModel = "omni-moderation-latest" | "omni-moderation-2024-09-26" | "text-moderation-latest" | 1 more...
ModerationMultiModalInput = |
ModerationTextInput = { text, type }