Skip to main content
Use the rating option when you want generated images to include a classification result. It is optional and omitted by default.

Enable default rating

The simplest form is rating: true, which enables the built-in sfw / nsfw scale:
const task = await mynth.image.generate({
  prompt: "Fantasy character concept art",
  model: "google/gemini-3.1-flash-image",
  rating: true,
});
You can also be explicit with mode: "nsfw_sfw":
const task = await mynth.image.generate({
  prompt: "Fantasy character concept art",
  model: "google/gemini-3.1-flash-image",
  rating: { mode: "nsfw_sfw" },
});
Successful images then include a rating object:
{
  "rating": {
    "status": "success",
    "level": "sfw"
  }
}
If the rating step itself fails, the rating field is simply omitted from the image — the image is still returned normally.

Use custom rating levels

Provide mode: "custom" with your own levels to replace the default scale:
rating: {
  mode: "custom",
  levels: [
    { value: "safe", description: "Safe for all audiences" },
    { value: "sensitive", description: "Contains mature or suggestive content" }
  ]
}
Constraints:
  • 2 to 7 levels
  • value length: 1 to 24 characters
  • description length: 1 to 150 characters
When you provide custom levels, Mynth returns the chosen custom level.

Choosing effective levels

Content rating is performed by a vision language model (LLM). Because LLM inference is non-deterministic, results for borderline images may occasionally vary between requests. This feature is designed for high-level, coarse-grained content classification — not fine-grained tagging. Scales with broad, clearly separated categories perform reliably:
  • sfw / nsfw
  • safe / suggestive / explicit
  • safe-for-children / safe-for-adults / nsfw
  • blood / no-blood
Scales that rely on subtle visual distinctions — for example subtle-nudity vs artistic-nudity vs explicit-nudity — are outside the intended scope of this feature and may produce inconsistent results. If you need that level of granularity, test thoroughly before relying on the output in production.