Skip to main content
The /image/rate endpoint accepts up to 10 image URLs and returns a content rating for each one. The response is synchronous — results are returned in the same HTTP response, not via polling.

Rate images with the default scale

The default scale has two levels: sfw and nsfw.
curl https://api.mynth.io/image/rate \
  -X POST \
  -H "Authorization: Bearer $MYNTH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": [
      "https://example.com/photo-1.webp",
      "https://example.com/photo-2.webp"
    ]
  }'
Response:
{
  "taskId": "tsk_01KE7XWWEQ4MCGWKBQKJ1G47RP",
  "results": [
    { "url": "https://example.com/photo-1.webp", "rating": "sfw" },
    { "url": "https://example.com/photo-2.webp", "rating": "nsfw" }
  ]
}

Rate images with custom levels

Replace the default scale with 2 to 7 custom levels. Each level requires a value (the string returned in the result) and a description (used by the rating model to decide which level applies).
Ratings are performed by a vision language model and are non-deterministic. Results for borderline images may vary between requests. The endpoint is optimised for speed and accuracy at a high level of abstraction — it is not a fine-grained tagging or classification pipeline.Broad, clearly separated scales work best: safe / suggestive / explicit, or safe-for-children / safe-for-adults / nsfw are reliable choices. Scales that rely on subtle visual distinctions — such as subtle-nudity vs artistic-nudity vs explicit-nudity — are outside the intended use-case and may produce inconsistent results. If you need that level of granularity, test thoroughly before relying on the output in production.
curl https://api.mynth.io/image/rate \
  -X POST \
  -H "Authorization: Bearer $MYNTH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": ["https://example.com/photo-1.webp"],
    "levels": [
      { "value": "g",    "description": "Suitable for all audiences" },
      { "value": "pg",   "description": "Mild content, suitable for general audiences" },
      { "value": "pg13", "description": "May contain mature themes, not suitable for children" },
      { "value": "r",    "description": "Restricted content, adult themes or partial nudity" },
      { "value": "x",    "description": "Explicit adult content" }
    ]
  }'
Response:
{
  "taskId": "tsk_01KE7XWWEQ4MCGWKBQKJ1G47RP",
  "results": [
    { "url": "https://example.com/photo-1.webp", "rating": "pg" }
  ]
}

Handle per-image errors

Ratings are processed in parallel. If a single image cannot be rated, its result contains error_code instead of rating. Other images in the same request are not affected.
{
  "taskId": "tsk_01KE7XWWEQ4MCGWKBQKJ1G47RP",
  "results": [
    { "url": "https://example.com/photo-1.webp", "rating": "sfw" },
    { "error_code": "UNKNOWN_ERROR" }
  ]
}
Check each item before reading the rating field:
for (const item of response.results) {
  if ("error_code" in item) {
    console.error("Failed to rate image:", item.error_code);
  } else {
    console.log(item.url, "→", item.rating);
  }
}

Rate images generated by Mynth

If you want to rate images that Mynth generated, use the content_rating parameter on the generation request instead. This runs the rating during generation and attaches the result to each image. See Use Content Rating for details.