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.


POST/v1/moderate/image

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 to image.

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

POST
/v1/moderate
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
	}
}

Was this page helpful?