Create a moderation

Check whether text content violates usage policies

POST /v1/moderations

Service root: https://getrouter.ai

Protocol: OpenAI Moderations

Authentication: Authorization: Bearer YOUR_API_KEY

Request body

The request body is required. Media type: application/json

Request fields

FieldTypeRequiredDescription
inputstring or array<string>Yes
modelstringNo

Example request

curl --request POST \
  --url https://getrouter.ai/v1/moderations \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "input": "Hello, introduce yourself."
}'

Responses

StatusDescription
200Content moderated successfully

Success response fields

FieldTypeRequiredDescription
idstringNo
modelstringNo
resultsarray<object>No

Example response

{
  "id": "string",
  "model": "MODEL_ID",
  "results": [
    {
      "flagged": false,
      "categories": {},
      "category_scores": {}
    }
  ]
}

This page is generated from the public Relay OpenAPI specification. Browse the complete specification in the API Explorer.