Content moderation
Review text, images and videos without generating anything. Returns an overall verdict plus a result per content type. Text and images are free; a request with videos costs 1 credit.
/api/v1/moderationsBearer API keyResults and categories
Every result is "none" (not reviewed: turned off, there was nothing of that type, or the review failed), true (passed) or false (blocked). A type fails when any category scores 0.5 or more.
Categories: sexual (nudity or sexual content), violence (graphic violence or gore), minor_sexual (sexual content involving anyone who may be under 18), real_person_sexual (an identifiable real person shown nude, sexually or degraded), and prohibited (the content was refused outright; it has no scores).
Long text is reviewed by its first and last 10,000 characters. A file that cannot be fetched, is too large, is longer than 10 minutes or is not MP4/MOV returns 400 content_unreadable.
The moderation field on generations and chat
Generations (POST and GET /generations, callbacks) and non-streamed chat completions also carry a moderation object: result, then text, image and video, each with its own result and the input and output checks. Which inputs and outputs are reviewed is set per project (all by default); calls without a project follow the platform setting, and the playground always reviews everything.
Blocked input fails with 400 content_policy_violation before anything is charged, and the error body includes moderation. Blocked output fails the generation and refunds its credits.
Streamed chat output is not reviewed; the X-Gateway-Moderation response header carries the input's overall result.
Input parameters
JSON bodytextstring | string[]OptionalText to review: one string or up to 20 strings (reviewed together).
imagesstring[]OptionalUp to 8 image URLs (https or data:image), 8MB each.
videosstring[]OptionalUp to 2 video URLs (https or data:video): MP4 or MOV, up to 20MB and 10 minutes each.
Response fields
idstringmod_…
object"moderation"moderation
result"none" | true | falseOverall verdict: false if any type failed, true if something passed, "none" if nothing was reviewed.
text / image / videoobjectResult per type: result ("none" | true | false), category (the highest-scoring category that failed), scores (0-1 per category) and error (why it could not be reviewed).
creditsnumberCredits charged: 0 for text and images, 1 when the request includes videos (returned if the review cannot run).
Usage notes
- Pricing and limits: text is free; images are free up to 1,000 per account per UTC day; a request with videos costs 1 credit whatever their number (up to 2), refunded when the review cannot run. Each account may have 5 requests running at once. Over a limit you get 429 moderation_limit with a Retry-After header; without enough credits, 402.
Request
curl 'https://01router.com/api/v1/moderations' \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "A golden retriever puppy playing in a sunny park",
"images": [
"https://example.com/photo.jpg"
]
}'Response example
{
"id": "mod_example",
"object": "moderation",
"result": false,
"text": {
"result": true,
"scores": {
"sexual": 0.0006,
"violence": 0.0008,
"minor_sexual": 0.0007,
"real_person_sexual": 0.0008
}
},
"image": {
"result": false,
"category": "violence",
"scores": {
"sexual": 0.012,
"violence": 0.9817,
"minor_sexual": 0.0007,
"real_person_sexual": 0.0008
}
},
"video": {
"result": "none"
},
"credits": 0
}Responses are illustrative. IDs, usage, prices and results depend on the actual request.
Use with AI
Give your coding assistant the documentation index or the full API reference, including live model parameters.