avatar-pro

This documentation is valid for the following list of our models:

  • klingai/avatar-pro

From a single image and a voice track, this model generates expressive character animations aligned with the speech’s rhythm, intonation, and meaning. This version outputs 1080p video at 48 fps.

Setup your API Key

If you don’t have an API key for the AI/ML API yet, feel free to use our Quickstart guide.

How to Make a Call

Step-by-Step Instructions

Generating a video using this model involves sequentially calling two endpoints:

  • The first one is for creating and sending a video generation task to the server (returns a generation ID).

  • The second one is for requesting the generated video from the server using the generation ID received from the first endpoint.

Below, you can find both corresponding API schemas.

API Schemas

Create a video generation task and send it to the server

You can create a video with this API by providing a reference image of a character and an audio file. The character will deliver the audio with full lip-sync and natural gestures. This POST request creates and submits a video generation task to the server — and returns a generation ID.

post
Body
modelundefined · enumRequiredPossible values:
image_urlstring · uriRequired

A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video.

audio_urlstringRequired
promptstring · max: 2500Optional

The text description of the scene, subject, or action to generate in the video.

Responses
200

Successfully generated video

application/json
post
/v2/video/generations
200

Successfully generated video

Retrieve the generated video from the server

After sending a request for video generation, this task is added to the queue. This endpoint lets you check the status of a video generation task using its generation_id, obtained from the endpoint described above. If the video generation task status is complete, the response will include the final result — with the generated video URL and additional metadata.

get
Query parameters
generation_idstringRequired
Responses
200

Successfully generated video

application/json
get
/v2/video/generations
200

Successfully generated video

Full Example: Generating and Retrieving the Video From the Server

The code below creates a video generation task, then automatically polls the server every 10 seconds until it finally receives the video URL.

Response

Generation time: ~ 8 min 50 s.

Original (1920x1080, with sound):

The following video was generated by adding just one line to our example:

See how dramatically the prompt parameter can change the character’s behavior and mannerisms:

Last updated

Was this helpful?