Virtual Try-On
April 18, 2025 (October 1, 2025)
Table of contents
This endpoint allows you to create virtual try-on images with Kling AI by providing a human image and clothing items.
https://api.useapi.net/v1/kling/images/virtual-try-on
Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
# Alternatively you can use multipart/form-data
# Content-Type: multipart/form-data
API token
is required, see Setup useapi.net for details.
Request Body
{
"email": "[email protected]",
"humanImage": "https://example.com/person.jpg",
"dressInput": "https://example.com/dress.jpg",
"imageCount": 2,
"replyUrl": "https://your-callback-url.com/webhook",
"replyRef": "your-reference-id"
}
-
email
is optional when only one account configured.
However, if you have multiple accounts configured, this parameter becomes required. -
humanImage
is required, URL to the image of a person.
Must be a valid http/https URL. Images can be uploaded using POST /assets and the returned URLs can be used here. -
dressInput
URL to a full-dress image to try on.
Incompatible with upperInput and lowerInput. Images can be uploaded using POST /assets. -
upperInput
URL to an upper garment image.
Incompatible with dressInput. Images can be uploaded using POST /assets. -
lowerInput
URL to a lower garment image.
Incompatible with dressInput. Images can be uploaded using POST /assets. -
imageCount
is optional, range from1
to4
.
Default is1
. -
maxJobs
is optional, range from1
to50
.
Specifies the maximum number of concurrent jobs. -
replyUrl
is optional, a callback URL to receive generation progress and result.
See GET /tasks/task_id
for response model. -
replyRef
is optional, a reference identifier for the callback.
Note: You must provide at least one of: dressInput
, upperInput
, or lowerInput
.
Responses
-
{ "task": { "id": 123456789, "userId": 12345, "type": "mmu_img2img_aitryon", "scene": "NORMAL_CREATION", "status": 5, "status_name": "submitted", "status_final": false, "taskInfo": { "type": "mmu_img2img_aitryon", "inputs": [ { "name": "humanImage", "inputType": "URL", "token": null, "blobStorage": null, "url": "https://example.com/person.jpg", "cover": null, "fromWorkId": null }, { "name": "dressInput", "inputType": "URL", "token": null, "blobStorage": null, "url": "https://example.com/dress.jpg", "cover": null, "fromWorkId": null } ], "arguments": [ { "name": "personType", "value": "Female" }, { "name": "imageCount", "value": "2" } ], "extraArgs": {}, "callbackPayloads": [], "scene": "NORMAL_CREATION" }, "favored": false, "deleted": false, "viewed": false, "createTime": 1745376611075, "updateTime": 1745376611075 }, "works": [], "status": 5, "status_name": "submitted", "status_final": false, "message": "", "limitation": { "type": "mmu_img2img_aitryon", "remaining": 10000, "limit": 10000 }, "userPoints": { "points": [], "total": 0 }, "userTickets": { "ticket": [] }, "editProject": null }
-
{ "error": "At least one of dressInput, upperInput or lowerInput must be provided" }
-
{ "error": "Unauthorized", "code": 401 }
-
Kling was unable to locate one of the referenced assets. Make sure to use POST /assets to upload assets.
{ "error": "Sorry, the requested resource was not found (VALID.ResourceNotFound)", "message": "Not Found" }
-
Kling uses a
500
response to indicate moderation and other issues with the input. It may be hard to separate actual 500 errors from moderation errors, so use theerror
field text and your best judgement to tell them apart, since themessage
field most often has very generic and perhaps misleading text.{ "error": "The content you uploaded appears to violate the community guidelines. (CM_EXT.POther)", "message": "Service busy (CM_EXT.POther)" }
When successful, the response includes a task ID which can be used to check the status using GET /tasks/task_id
.
Model
{ // TypeScript, all fields are optional
task: {
id: number
userId: number
type: string
scene: string
status: number
status_name: 'submitted' | 'failed' | 'processing' | 'succeed'
status_final: boolean
taskInfo: {
type: string
inputs: Array<{
name: string
inputType: string
token: string | null
blobStorage: any | null
url: string
cover: string | null
fromWorkId: number | null
}>
arguments: Array<{
name: string
value: string
}>
extraArgs: Record<string, any>
callbackPayloads: any[]
scene: string
}
favored: boolean
deleted: boolean
viewed: boolean
createTime: number
updateTime: number
viewTime: number
}
works: Array<any>
status: number
status_name: 'submitted' | 'failed' | 'processing' | 'succeed'
status_final: boolean
message: string
error: string
limitation: {
type: string
remaining: number
limit: number
}
userPoints: {
points: Array<{
orderId: string
type: string
amount: number
balance: number
startTime: number
endTime: number
}>
total: number
}
userTickets: {
ticket: Array<{
orderId: string
type: string
packageType: string
amount: number
balance: number
startTime: number
endTime: number
}>
}
editProject: any | null
}
Examples
-
curl -X POST "https://api.useapi.net/v1/kling/images/virtual-try-on" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer …" \ -d '{ "email": "[email protected]", "humanImage": "https://example.com/person.jpg", "dressInput": "https://example.com/dress.jpg", "imageCount": 2 }'
-
const token = "API token"; const email = "Previously configured account email"; const apiUrl = "https://api.useapi.net/v1/kling/images/virtual-try-on"; const response = await fetch(apiUrl, { method: "POST", headers: { "Content-Type": "application/json", "Authorization": `Bearer ${token}`, }, body: JSON.stringify({ email: email, humanImage: "https://example.com/person.jpg", dressInput: "https://example.com/dress.jpg", imageCount: 2 }) }); const result = await response.json(); console.log("response", {response, result});
-
import requests token = "API token" email = "Previously configured account email" apiUrl = "https://api.useapi.net/v1/kling/images/virtual-try-on" headers = { "Content-Type": "application/json", "Authorization" : f"Bearer {token}" } data = { "email": email, "humanImage": "https://example.com/person.jpg", "dressInput": "https://example.com/dress.jpg", "imageCount": 2 } response = requests.post(apiUrl, headers=headers, json=data) print(response, response.json())