Skip to main content
The moderation API accepts mixed typed arrays, which is useful when a single user submission contains both text and an image. Use this for real user submissions that combine a caption, prompt, message, or comment with attached media.

Example

from openai import OpenAI

client = OpenAI(
    base_url="https://api.naga.ac/v1",
    api_key="YOUR_API_KEY",
)

result = client.moderations.create(
    model="omni-moderation-latest",
    input=[
        {"type": "text", "text": "Caption this aggressively."},
        {
            "type": "image_url",
            "image_url": {"url": "https://example.com/post-image.png"},
        },
    ],
)

print(result.results[0].flagged)
The response returns one moderation result payload covering the submitted request content.

When this is useful

  • moderating social posts with both text and an image
  • screening user prompts that reference an uploaded image
  • applying one safety check before a multimodal workflow continues

Common mistakes

  • sending separate moderation calls when your product logic really cares about the combined submission
  • expecting separate per-item result objects instead of one result for the whole request
  • mixing typed inputs incorrectly across text and image shapes