Naar hoofdinhoud gaan
POST
/
kling
/
v1
/
videos
/
avatar
/
image2video
Create a Kling avatar task
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": {}
  }
}
Gebruik deze endpoint om pratende avatarclips te maken van één bronafbeelding plus één audiobron.

Voordat je deze aanroept

  • Geef één avatar-image op als publieke URL of onbewerkte base64-string
  • Verstuur exact één van audio_id of sound_file
  • Houd het eerste verzoek eenvoudig: één gezichtsafbeelding, één audioclip en een korte optionele prompt
  • Begin met mode: std, tenzij je specifiek het pad met hogere kwaliteit nodig hebt

Regels voor audiobronnen

  • audio_id is de eenvoudigste optie als je al spraak hebt gegenereerd via de Kling TTS-route
  • sound_file werkt als je al je eigen MP3-, WAV-, M4A- of AAC-bestand hebt
  • Avatar-audio is gedocumenteerd als 2 tot 60 seconden lang

Taakverloop

1

Maak de avatar-taak aan

Dien de afbeelding en één audiobron in en sla daarna het geretourneerde task id op.
2

Poll de taak

Ga verder met Individuele Queries totdat de taak een eindstatus bereikt.
3

Sla het voltooide resultaat op

Kopieer het definitieve bestand naar je eigen opslag als je het langer wilt bewaren dan de delivery URL van de provider.
Zie voor de volledige parameterreferentie de officiële Kling Avatar-documentatie.

Autorisaties

Authorization
string
header
vereist

Bearer token authentication. Use your CometAPI key.

Headers

Content-Type
string

Optional content type header.

Body

application/json
image
string
standaard:example
vereist

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
string
vereist

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.

sound_file
string

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.

prompt
string

Text prompt to guide avatar actions, emotions, and camera movements. Max 2500 characters.

mode
string

Generation mode. std (standard, faster and more cost-effective) or pro (professional, higher quality output).

callback_url
string

Webhook URL for task status notifications. The server sends a callback when the task status changes.

external_task_id
string

Optional user-defined task ID for your own tracking. Does not replace the system-generated task ID. Must be unique per account.

Respons

200 - application/json

Task accepted.

code
integer
vereist
message
string
vereist
data
object
vereist