Skip to main content
Image moderation uses typed image_url input objects. Use it to screen uploaded or linked images before generation, display, or publishing.

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": "image_url",
            "image_url": {"url": "https://example.com/image.png"},
        }
    ],
)

print(result.results[0].flagged)
Use this when you need to screen uploaded or linked images before further processing.

Common uses

  • checking uploaded profile images or attachments
  • screening images before passing them into a multimodal model
  • applying different review paths for safe vs risky media

Common mistakes

  • trying to send a plain string instead of a typed image object
  • assuming the moderation result replaces your own product policy logic
  • forgetting that image availability and URL validity still matter at request time