Skip to main content
POST
Moderate text and images (free beta)
The moderation endpoint is free during beta and does not consume credits.
  • Send text, images, or both. At least one is required.
  • text can be up to 10,000 characters.
  • images takes up to 4 publicly accessible http(s) URLs. Base64 data URLs and videos are not supported.
  • Only sexual content and sexual content involving minors are checked. Other categories, such as violence or hate, are not covered.

Reading the Result

  • decision: block means the input should not be used for generation; otherwise allow.
  • score: a confidence score. Above 0 means block, and the further it is from 0, the more confident the decision. It can be null when no score is available.

Errors

  • 400: the input is invalid, or an image could not be downloaded or decoded.
  • 429: the moderation service is busy. Retry with backoff.

Authorizations

x-api-key
string
header
required

API key to authorize requests

Body

application/json
text
string

Prompt or other text to check, up to 10000 characters.

Required string length: 1 - 10000
images
string<uri>[]

Publicly accessible http(s) image URLs, up to 4. Base64 data URLs are not accepted.

Maximum array length: 4
Maximum string length: 4096
Pattern: ^https?:\/\/

Response

Successful response

decision
enum<string>
required

block if the input should not be used for generation.

Available options:
allow,
block
score
number | null
required

logprob(block) - logprob(allow); above 0 means block.