MaasUnionMaasUnion
API Reference
AI Model APIVideoKling Video

Kling Image Recognition (Sync)

Channel type: Kling Extended (66) Gateway path: POST https://maasunion.com/kling/v1/extended/videos/image-recognize (sync) Official upstream: https://api-beijing.klingai.com (/v1/videos/image-recognize)


Overview

Image recognition is a synchronous endpoint; after uploading an image, it directly returns segmentation results (subject, head, face, clothing, etc.), commonly used for preparing materials for the subject library or multi-image subject generation.


Authentication

HeaderRequiredDescription
AuthorizationYesBearer {your_api_token}
Content-TypeYesapplication/json

Request

POST https://maasunion.com/kling/v1/extended/videos/image-recognize

Request Parameters

ParameterTypeRequiredDescription
imagestringYesImage URL

Request Example

curl --request POST \
  --url "https://maasunion.com/kling/v1/extended/videos/image-recognize" \
  --header "Authorization: Bearer {your_api_token}" \
  --header "Content-Type: application/json" \
  --data '{
    "image": "https://example.com/person.jpg"
  }'

Sync Response

{
  "code": 0,
  "message": "string",
  "request_id": "string",
  "data": {
    "task_result": {
      "images": [
        { "type": "object_seg", "is_contain": true, "url": "string" },
        { "type": "head_seg", "is_contain": true, "url": "string" },
        { "type": "face_seg", "is_contain": true, "url": "string" },
        { "type": "cloth_seg", "is_contain": true, "url": "string" }
      ]
    },
    "final_unit_deduction": "string"
  }
}
FieldDescription
data.task_result.images[].typeSegmentation type, see the table below
data.task_result.images[].is_containWhether the image contains this type of content
data.task_result.images[].urlSegmentation result image URL

type Enumerations

typeMeaning
object_segSubject
head_segHead (including hair and face)
face_segFace (excluding hair and face)
cloth_segClothing

Error Handling

When code != 0, the request failed; message contains the specific reason. Common cases:

  • image not passed or the URL is inaccessible
  • Image format not supported (only .jpg / .jpeg / .png)
  • Invalid token or insufficient balance

Image recognition is a synchronous endpoint that returns results directly; no polling required.

For more general information, see Kling Gateway Overview.

How is this guide?