Ana içeriğe atla
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": {}
  }
}
Bu endpoint’i, bir kaynak görsel ve bir ses kaynağı kullanarak konuşan avatar klipleri oluşturmak için kullanın.

Çağırmadan önce

  • Bir avatar image değerini herkese açık bir URL veya ham base64 string olarak sağlayın
  • audio_id veya sound_file alanlarından yalnızca birini gönderin
  • İlk isteği basit tutun: bir yüz görseli, bir ses klibi ve isteğe bağlı kısa bir prompt
  • Özellikle daha yüksek kaliteli yolu gerektiren bir ihtiyacınız yoksa mode: std ile başlayın

Ses kaynağı kuralları

  • audio_id, konuşmayı zaten Kling TTS rotası üzerinden oluşturduysanız en kolay seçenektir
  • sound_file, kendi MP3, WAV, M4A veya AAC dosyanız zaten varsa çalışır
  • Avatar sesi için belgelerde 2 ila 60 saniye uzunluk belirtilmiştir

Görev akışı

1

Avatar görevini oluşturun

Görseli ve bir ses kaynağını gönderin, ardından dönen görev kimliğini kaydedin.
2

Görevi sorgulayın

Görev terminal bir duruma ulaşana kadar Individual Queries ile devam edin.
3

Tamamlanan sonucu saklayın

Sağlayıcının teslim URL’sinin ötesinde saklama ihtiyacınız varsa nihai çıktıyı kendi depolamanıza kopyalayın.
Tam parametre referansı için resmî Kling Avatar dokümantasyonuna bakın.

Yetkilendirmeler

Authorization
string
header
gerekli

Bearer token authentication. Use your CometAPI key.

Başlıklar

Content-Type
string

Optional content type header.

Gövde

application/json
image
string
varsayılan:example
gerekli

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
gerekli

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.

Yanıt

200 - application/json

Task accepted.

code
integer
gerekli
message
string
gerekli
data
object
gerekli