Skip to content

Image Moderation API Interface

API Endpoint

https://api.steamdata.cloud.cubicnode.com/service-api/image-moderation/get-image-score

This endpoint is used to submit an image for detection and returns the safety score of the image.

API Call Instructions

  • The file size of the image should not exceed 5 MB
  • Recommended image resolution is greater than 512x512
  • Recommended image formats are jpeg, png, webp
  • Upload must use form-data format and POST method
  • The image name can only contain letters, numbers, underscores, hyphens, and periods, and the length cannot exceed 128 characters

Request Method

POST

Request Parameters

Parameter NameParameter TypeParameter Description
imagefileThe image to be detected

Request Example

POST / HTTP/1.1

Request Headers:
    Host: api.safeimages.com
    Accept: */*
    Authorization: SD1-HMAC-SHA256 Credential=012345ABCDEFGHJKLNMOPQRSTU/20240101/ap-east-1/service/sd1_request,SignedHeaders=host;x-sd-api-version;x-sd-datetime,Signature=1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
    Content-Type: multipart/form-data; boundary=-----------------xxxxxxxxxxxxxxxxx
    X-SD-Api-Version: 1.0
    X-SD-Datetime: 20240101T173850Z
    ...

Request Body:
    image: <image>

Response Example

json
{
    'message': 'success',
    'code': 00000,
    'data': {
        'safe_score': 0.90,
        'unsafe_score': 0.10
    }
}