Content rating

Your scale.One value.

Rate an image you already have, or rate one while you generate it. The default answers sfw or nsfw. Describe two to seven levels and the answer is one of them.

Scale

url
https://example.com/photo.webp

Sending a URL is enough. It defaults to sfw or nsfw.

Comes back as

  • sfw

    Content is safe for work. No nudity, violence, or other explicit content. Non-erotic lingerie and bikini are allowed.

  • nsfw

    Content is not safe for work. Contains nudity, violence, or other explicit content.

SDK

const result = await mynth.image.rate({
  url: "https://example.com/photo.webp",
});

result.level; // "sfw" | "nsfw"

On generate, rating: true is this scale. Use content rating is the generate path.

Where it runs

A URL, or an image you are generating

Same levels either way. The task and the price differ.

POST /image/rate
One http or https URL. Creates an image.rate task and returns 201 with a taskId. Poll GET /tasks/:id, or listen for task.image.rate.completed. The result is { "level" }.
$0.0002
Reserved at creation, charged when the task succeeds. A failed task releases the reserve. 5,000 ratings to the dollar. When the balance cannot cover the reserve, the call returns 402 INSUFFICIENT_BALANCE.
rating
On image.generate. true is the sfw / nsfw scale. An object takes the same mode and levels as POST /image/rate. A successful image includes rating with status "success" and level. When rating fails, the image still comes back and rating has status "failed" and an error code. Included with generation, so the generation price is the whole charge.
Webhooks
task.image.rate.completed and task.image.rate.failed fire for POST /image/rate. Rating on generate stays on that generate task, and the generate webhook includes it.
SDK
image.rate waits, and level narrows to your values. as const on the levels array keeps the strings as literals. image.rateAsync returns the task if you want to poll. Pass a file and the SDK uploads it, then rates the URL.

Rate an image is the URL call. Use content rating is rating on generate. The field table is Image rate request.

The scale

Levels a model can tell apart

A vision model reads each description and picks one value.

Default
Omit mode, or send nsfw_sfw. sfw is no nudity, violence, or other explicit content, and non-erotic lingerie and bikini are allowed. nsfw is nudity, violence, or other explicit content.
value
1 to 24 characters. This is the string in level.
description
1 to 150 characters. This is the sentence the model reads.
Count
2 to 7 levels when mode is custom.
Borderline images
The same image can come back on different levels when it sits between two descriptions. Run it more than once before you trust a close call.
Fine distinctions
Broad separations stay reliable. safe / suggestive / explicit, and safe-for-children / safe-for-adults / nsfw, are the kind to write. A fine visual call, such as artistic nudity against explicit nudity, drifts between requests.

A rating describes the image. The Terms of Service still apply.