The Kling 3.0 series models API is now fully available
Learn More

Image Recognize


Image Recognize

POST/v1/videos/image-recognize
curl --request POST \
  --url https://api-singapore.klingai.com/v1/videos/image-recognize \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "image": "https://p2-kling.klingai.com/kcdn/cdn-kcdn112452/kling-qa-test/multi-1.png"
  }'
200
{
  "code": 0, // Error codes; Specific definitions can be found in Error codes
  "message": "string", // Error information
  "request_id": "string", // Request ID, generated by the system, is used to track requests and troubleshoot problems
  "data": {
    "final_unit_deduction": "string", //  The deduction units of task
    "task_result": {
      "images": [
        {
          "type": "object_seg", // Identification of subject recognition results
          "is_contain": true, // Has the subject been identified; Boolean value
          "url": "string" //URL for generating videos,such as https://p1.a.kwimgs.com/bs2/upload-ylab-stunt/special-effect/output/HB1_PROD_ai_web_46554461/-2878350957757294165/output.png(请注意,为保障信息安全,生成的图片/视频会在30天后被清理,请及时转存)
        },
        {
          "type": "head_seg", // Identification of facial recognition results for individuals with hair included
          "is_contain": true, // Has the subject been identified; Boolean value
          "url": "string" //URL for generating videos,such as https://p1.a.kwimgs.com/bs2/upload-ylab-stunt/special-effect/output/HB1_PROD_ai_web_46554461/-2878350957757294165/output.png(请注意,为保障信息安全,生成的图片/视频会在30天后被清理,请及时转存)
        },
        {
          "type": "face_seg", // Identification of facial recognition results for individuals without hair included
          "is_contain": true, // Has the subject been identified; Boolean value
          "url": "string" //URL for generating videos,such as https://p1.a.kwimgs.com/bs2/upload-ylab-stunt/special-effect/output/HB1_PROD_ai_web_46554461/-2878350957757294165/output.png(请注意,为保障信息安全,生成的图片/视频会在30天后被清理,请及时转存)
        },
        {
          "type": "cloth_seg", // Identification of clothing recognition results
          "is_contain": true, // Has the subject been identified; Boolean value
          "url": "string" //URL for generating videos,such as https://p1.a.kwimgs.com/bs2/upload-ylab-stunt/special-effect/output/HB1_PROD_ai_web_46554461/-2878350957757294165/output.png(请注意,为保障信息安全,生成的图片/视频会在30天后被清理,请及时转存)
        }
      ]
    },
    "final_unit_deduction": "string" // The deduction units of task
  }
}

Request Header

Content-TypestringRequiredDefault to application/json

Data Exchange Format

AuthorizationstringRequired

Authentication information, refer to API authentication

Request Body

imagestringRequired

Image to be recognized

Support inputting image Base64 encoding or image URL (ensure accessibility).

Please note, if you use the Base64 method, make sure all image data parameters you pass are in Base64 encoding format. When submitting data, do not add any prefixes to the Base64-encoded string, such as data:image/png;base64,. The correct parameter format should be the Base64-encoded string itself. Please provide only the Base64-encoded string portion so that the system can correctly process and parse your data.

Supported image formats: .jpg / .jpeg / .png. The image file size cannot exceed 10MB, and the width and height dimensions of the image shall not be less than 300px, and the aspect ratio of the image should be between 1:2.5 ~ 2.5:1.

curl --request POST \
  --url https://api-singapore.klingai.com/v1/videos/image-recognize \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "image": "https://p2-kling.klingai.com/kcdn/cdn-kcdn112452/kling-qa-test/multi-1.png"
  }'
200
{
  "code": 0, // Error codes; Specific definitions can be found in Error codes
  "message": "string", // Error information
  "request_id": "string", // Request ID, generated by the system, is used to track requests and troubleshoot problems
  "data": {
    "final_unit_deduction": "string", //  The deduction units of task
    "task_result": {
      "images": [
        {
          "type": "object_seg", // Identification of subject recognition results
          "is_contain": true, // Has the subject been identified; Boolean value
          "url": "string" //URL for generating videos,such as https://p1.a.kwimgs.com/bs2/upload-ylab-stunt/special-effect/output/HB1_PROD_ai_web_46554461/-2878350957757294165/output.png(请注意,为保障信息安全,生成的图片/视频会在30天后被清理,请及时转存)
        },
        {
          "type": "head_seg", // Identification of facial recognition results for individuals with hair included
          "is_contain": true, // Has the subject been identified; Boolean value
          "url": "string" //URL for generating videos,such as https://p1.a.kwimgs.com/bs2/upload-ylab-stunt/special-effect/output/HB1_PROD_ai_web_46554461/-2878350957757294165/output.png(请注意,为保障信息安全,生成的图片/视频会在30天后被清理,请及时转存)
        },
        {
          "type": "face_seg", // Identification of facial recognition results for individuals without hair included
          "is_contain": true, // Has the subject been identified; Boolean value
          "url": "string" //URL for generating videos,such as https://p1.a.kwimgs.com/bs2/upload-ylab-stunt/special-effect/output/HB1_PROD_ai_web_46554461/-2878350957757294165/output.png(请注意,为保障信息安全,生成的图片/视频会在30天后被清理,请及时转存)
        },
        {
          "type": "cloth_seg", // Identification of clothing recognition results
          "is_contain": true, // Has the subject been identified; Boolean value
          "url": "string" //URL for generating videos,such as https://p1.a.kwimgs.com/bs2/upload-ylab-stunt/special-effect/output/HB1_PROD_ai_web_46554461/-2878350957757294165/output.png(请注意,为保障信息安全,生成的图片/视频会在30天后被清理,请及时转存)
        }
      ]
    },
    "final_unit_deduction": "string" // The deduction units of task
  }
}