Skip to main content
POST
openai-python

Authorizations

Authorization
string
header
required

An account API key. Send it as Authorization: Bearer <key>.

Body

application/json

The request body of POST /v1/moderations.

model
string
required

The moderation model, named by its id or alias.

input
required

What to moderate. Each image_url part costs a flat 250 input tokens.

models
string[] | null

Fallback models, tried in order when model cannot answer: none of its providers served it. At most 3, and only the model that answered is billed. A NagaAI extension in OpenRouter's shape.

Maximum array length: 3
routing
object

How NagaAI picks the providers for this request: max_price removes the dearer ones and can fail the request. Takes no strategy. A NagaAI extension.

Response

The verdict. results carries one entry per input, each with the flag, the per-category verdicts and the scores behind them.

The body of a successful POST /v1/moderations, without usage.

id
string
required

The identifier of this moderation, minted by the gateway.

model
string
required

The model that moderated, as the catalog id the request resolved to.

results
object[]
required

The verdicts, in the order the model returned them.