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
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer {your_api_token} |
Content-Type | Yes | application/json |
Request
POST https://maasunion.com/kling/v1/extended/videos/image-recognize
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
image | string | Yes | Image 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"
}
}| Field | Description |
|---|---|
data.task_result.images[].type | Segmentation type, see the table below |
data.task_result.images[].is_contain | Whether the image contains this type of content |
data.task_result.images[].url | Segmentation result image URL |
type Enumerations
| type | Meaning |
|---|---|
object_seg | Subject |
head_seg | Head (including hair and face) |
face_seg | Face (excluding hair and face) |
cloth_seg | Clothing |
Error Handling
When code != 0, the request failed; message contains the specific reason. Common cases:
imagenot 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?