Image Moderation
Image moderation is crucial for any application that deals with user-generated content. Kayle helps you automate this process with our image moderation API.
We don't yet support directly uploading images to Kayle.
Request Image Moderation
This endpoint allows you to moderate images.
Required attributes
- Name
image_url
- Type
- string
- Description
The URL to the image file to moderate.
- Name
type
- Type
- string
- Description
If you haven't specified a type via the URL (i.e. you've used
/v1/moderate
instead of/v1/moderate/image
), you must specify the type of content you are moderating here. For image moderation, this must be set toimage
.
For now, the image must be hosted on a public URL that can be accessed without authentication.
Optional attributes
- Name
immediate
- Type
- boolean
- Default
- default: true
- Description
If set to true, the API will return a decision immediately.
Webhooks
If you've set immediate
to false
, we'll send you a webhook when the moderation is complete.
See the webhooks guide for more information on how webhooks work.
Request
curl -X POST https://api.kayle.ai/v1/moderate \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"image_url": "{image_url}", "type": "image" }'
Image Moderation Response
{
"is_safe": false,
"violations": [
"nudity"
],
"severity": 6
}
Image Moderation Webhook
{
"id": "WAz8eIbvDR60rouK",
"type": "image.moderation",
"payload": {
"is_safe": false,
"violations": [
"nudity"
],
"severity": 6
}
}