OpenAI

Consume Open AI

Actions5

Overview

This node provides text moderation functionality using OpenAI's moderation models. It classifies input text to detect potentially harmful or inappropriate content, helping users automatically filter or flag such text in their workflows. Common scenarios include content moderation for user-generated comments, social media posts, chat messages, or any text input where compliance with community guidelines or legal requirements is necessary.

For example, a social media platform could use this node to automatically review posts before publishing, blocking or flagging those containing hate speech, violence, or adult content.

Properties

Name Meaning
Model The moderation model to classify the text. Options: "text-moderation-stable" and "text-moderation-latest". These correspond to different versions of OpenAI's moderation models.
Input The actual text string that you want to classify for moderation.
Simplify Whether to return a simplified version of the response instead of the raw data. If true, the output will be streamlined to only include the relevant moderation results.

Output

The node outputs JSON data representing the moderation results from the OpenAI API.

  • If Simplify is enabled (default), the output JSON contains a data field which holds an array of moderation results extracted from the API response body under results.
  • If Simplify is disabled, the full raw response from the API is returned without modification.

The structure inside data typically includes categories flagged, severity scores, and other metadata about the moderation classification.

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential for authenticating requests to the OpenAI API.
  • The node uses OpenAI's official moderation endpoints, so internet access and valid API credentials are mandatory.
  • No additional external services or environment variables are required beyond the API key.

Troubleshooting

  • Common issues:
    • Invalid or missing API key will cause authentication errors.
    • Input text exceeding length limits may result in request failures.
    • Network connectivity problems can prevent reaching the OpenAI API.
  • Error messages:
    • Authentication errors usually indicate invalid or expired API keys; verify and update credentials.
    • Rate limit errors suggest too many requests in a short time; implement retry logic or reduce request frequency.
    • Validation errors on input mean the text is malformed or empty; ensure proper input is provided.

Links and References

Discussion