Moderations
POST /v1/moderations passes your input to OpenAI’s moderation models and returns OpenAI’s answer unchanged. It is free: nothing is reserved or charged, and the request does not appear in your usage. It still needs an API key.
curl https://api.indorouter.ai/v1/moderations \ -H "Authorization: Bearer $INDOROUTER_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "omni-moderation-latest", "input": "hello"}'import osfrom openai import OpenAI
client = OpenAI( base_url="https://api.indorouter.ai/v1", api_key=os.environ["INDOROUTER_API_KEY"],)
result = client.moderations.create( model="omni-moderation-latest", input="hello",)print(result.results[0].flagged)| Field | Notes |
|---|---|
input |
Required. A string, or a list of strings or content parts (text and images), as in OpenAI’s API. |
model |
The moderation model as OpenAI names it, without a vendor prefix. Leave it out to use omni-moderation-latest. |
Only input and model are forwarded. The body may be up to 20 MB. The response, including an error OpenAI returns, is OpenAI’s own. See Error codes for errors returned by indoRouter.