Create Moderation

Go to Product

Classifies if text and/or image inputs are potentially harmful. Learn more in the [moderation guide](/docs/guides/moderation).

Options

Body

Request body which must comply to the following JSON Schema:

{
  "required" : [ "input" ],
  "type" : "object",
  "properties" : {
    "input" : {
      "description" : "Input (or inputs) to classify. Can be a single string, an array of strings, or\nan array of multi-modal input objects similar to other models.\n",
      "oneOf" : [ {
        "type" : "string",
        "description" : "A string of text to classify for moderation.",
        "example" : "I want to kill them.",
        "default" : ""
      }, {
        "type" : "array",
        "description" : "An array of strings to classify for moderation.",
        "items" : {
          "type" : "string",
          "example" : "I want to kill them.",
          "default" : ""
        }
      }, {
        "type" : "array",
        "description" : "An array of multi-modal inputs to the moderation model.",
        "items" : {
          "oneOf" : [ {
            "required" : [ "image_url", "type" ],
            "type" : "object",
            "properties" : {
              "type" : {
                "type" : "string",
                "description" : "Always `image_url`.",
                "enum" : [ "image_url" ]
              },
              "image_url" : {
                "required" : [ "url" ],
                "type" : "object",
                "properties" : {
                  "url" : {
                    "type" : "string",
                    "description" : "Either a URL of the image or the base64 encoded image data.",
                    "format" : "uri",
                    "example" : "https://example.com/image.jpg"
                  }
                },
                "description" : "Contains either an image URL or a data URL for a base64 encoded image."
              }
            },
            "description" : "An object describing an image to classify."
          }, {
            "required" : [ "text", "type" ],
            "type" : "object",
            "properties" : {
              "type" : {
                "type" : "string",
                "description" : "Always `text`.",
                "enum" : [ "text" ]
              },
              "text" : {
                "type" : "string",
                "description" : "A string of text to classify.",
                "example" : "I want to kill them"
              }
            },
            "description" : "An object describing text to classify."
          } ],
          "x-oaiExpandable" : true
        }
      } ],
      "x-oaiExpandable" : true
    },
    "model" : {
      "description" : "The content moderation model you would like to use. Learn more in\n[the moderation guide](/docs/guides/moderation), and learn about\navailable models [here](/docs/models/moderation).\n",
      "nullable" : false,
      "example" : "omni-moderation-2024-09-26",
      "anyOf" : [ {
        "type" : "string"
      }, {
        "type" : "string",
        "enum" : [ "omni-moderation-latest", "omni-moderation-2024-09-26", "text-moderation-latest", "text-moderation-stable" ]
      } ],
      "default" : "omni-moderation-latest",
      "x-oaiTypeLabel" : "string"
    }
  }
}
Result Format

Specify how the response should be mapped to the table output. The following formats are available:

Raw Response: Returns the raw response in a single row with the following columns:

  • body: Response body
  • status: HTTP status code

Input Ports

Icon
Configuration data.

Output Ports

Icon
Result of the request depending on the selected Result Format.
Icon
Configuration data (this is the same as the input port; it is provided as passthrough for sequentially chaining nodes to declutter your workflow connections).

Popular Predecessors

  • No recommendations found

Popular Successors

  • No recommendations found

Views

This node has no views

Workflows

  • No workflows found

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.