Skip to main content
POST
curl

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 by one of its aliases. A name this gateway does not serve on this route is refused with 400 model_not_found; a name it served and has since retired, with 410 model_deprecated.

input
required

What to moderate. It is billed on tokens counted here rather than reported by the model: text is tokenized locally, and each image_url part costs a flat 250 input tokens whatever the image is.

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. It carries no usage block, unlike the gateway's other non-LLM routes; the request is billed all the same, on tokens counted here rather than reported by the model.

id
string
required

The identifier of this moderation, minted by the gateway: mdr- followed by 28 random letters and digits. It is Naga's own and matches no identifier the upstream may have used.

model
string
required

The model that moderated, as the canonical id the requested name resolved to — an alias sent in the request comes back resolved here. The value is this gateway's catalog name, not anything the provider reported about itself.

results
object[]
required

The verdicts, in the order the moderation model returned them, normally one per input item. The array is passed through as it came: nothing here pads it out to the number of inputs or trims it to them.