Skip to content

Get Image Safety Score

It is recommended to use the Asynchronous Get Image Safety Score API to avoid long waiting times.

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

Request Method

POST

Request Parameters

Parameter NameParameter TypeIs RequiredParameter validation rulesParameter Description
imagefileYesThe image name can only contain letters, numbers, underscores, hyphens, and periods, and the length cannot exceed 128 charactersThe image to be detected

Request Example

POST /service-api/image-moderation/get-image-score 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
    }
}