Buat video berbasis avatar dari gambar menggunakan Kling Avatar API di CometAPI. Gunakan POST /kling/v1/videos/avatar/image2video untuk avatar image-to-video yang cepat.
curl --request POST \
--url https://api.cometapi.com/kling/v1/videos/avatar/image2video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"image": "example"
}
'{
"code": 123,
"message": "<string>",
"data": {
"task_id": "<string>",
"task_status": "<string>",
"created_at": 123,
"updated_at": 123,
"task_info": {}
}
}image avatar sebagai URL publik atau string base64 mentahaudio_id atau sound_filemode: std kecuali Anda memang membutuhkan jalur kualitas yang lebih tinggiaudio_id adalah cara termudah jika Anda sudah menghasilkan speech melalui rute Kling TTSsound_file berfungsi jika Anda sudah memiliki aset MP3, WAV, M4A, atau AAC sendiriPoll task
Bearer token authentication. Use your CometAPI key.
Optional content type header.
Avatar reference image. Accepts an image URL or raw Base64 string (no data: prefix). Supported formats: JPG, JPEG, PNG. Max file size 10 MB. Minimum dimension 300 px on each side; aspect ratio between 1:2.5 and 2.5:1.
Audio ID returned by the Kling TTS API. Only audio clips between 2 and 60 seconds generated within the last 30 days are accepted. Mutually exclusive with sound_file — exactly one must be provided.
Audio file as a URL or Base64 string. Accepted formats: MP3, WAV, M4A, AAC. Max 5 MB, duration 2–60 seconds. Mutually exclusive with audio_id — exactly one must be provided.
Text prompt to guide avatar actions, emotions, and camera movements. Max 2500 characters.
Generation mode. std (standard, faster and more cost-effective) or pro (professional, higher quality output).
Webhook URL for task status notifications. The server sends a callback when the task status changes.
Optional user-defined task ID for your own tracking. Does not replace the system-generated task ID. Must be unique per account.
curl --request POST \
--url https://api.cometapi.com/kling/v1/videos/avatar/image2video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"image": "example"
}
'{
"code": 123,
"message": "<string>",
"data": {
"task_id": "<string>",
"task_status": "<string>",
"created_at": 123,
"updated_at": 123,
"task_info": {}
}
}