The resources (image, video, voice) generated by our API are valid for 7 days. Please save the relevant resources as soon as possible to prevent expiration.
Finally,The processing status will be returned promptly through the provided callback address, or you can also query it by calling the interface Get Video Info
POST https://openapi.akool.com/api/open/v3/talkingavatar/create
Request Headers
Parameter
Value
Description
Authorization
Bearer {token}
Your API Key used for request authorization.getToken.
Body Attributes
Parameter
Type
Value
Description
width
Number
3840
Set the output video width,must be 3840
height
Number
2160
Set the output video height,must be 2160
avatar_from
Number
2 or 3
You use the avatar from of the avatar model, and you can get from https://openapi.akool.com/api/open/v3/avatar/list api, you will obtain the field 【from】 and pass it here. If you provide an avatar URL yourself, avatar_from must be 3.
webhookUrl
String
Callback url address based on HTTP request.
elements
[Object]
Collection of elements passed in in the video
[elements].url
String
Link to element(When type is equal to image, url can be either a link or a Hexadecimal Color Code). When avatar_from =2, you don’t need to pass this parameter. The image formats currently only support “.png”, “.jpg”, “.jpeg”, “.webp”, and the video formats currently only support “.mp4”, “.mov”, “.avi”
[elements].scale_x
Number
1
Horizontal scaling ratio(Required when type is equal to image or avatar)
[elements].scale_y
Number
1
Vertical scaling ratio (Required when type is equal to image or avatar)
[elements].offset_x
Number
Horizontal offset of the upper left corner of the element from the video setting area (in pixels)(Required when type is equal to image or avatar)
[elements].offset_y
Number
Vertical offset of the upper left corner of the element from the video setting area (in pixels)(Required when type is equal to image or avatar)
[elements].height
Number
The height of the element
[elements].width
Number
The width of the element
[elements].type
String
Element type(avatar、image、audio)
[elements].avatar_id
String
When type is equal to avatar, you use the avatar_id of the avatar model, and you can get from https://openapi.akool.com/api/open/v3/avatar/list api, you will obtain the field 【avatar_id】 and pass it here。 If you provide an avatar URL yourself, you don’t need to pass this parameter.
[elements].input_text
String
Audio element support, for input text, the per-request character limit depends on the subscription plan: Pro – 5,000, Pro Max – 10,000, Business – 50,000. If both the URL and the input text fields are passed, the URL takes precedence. The “input_text” and “voice_id” fields must both be present.
Obtain by polling the following interface Get Video Info
ExampleBody
Copy
{ "width": 3840, "height": 2160, "avatar_from": 3, "elements": [ { "type": "image", "url": "https://drz0f01yeq1cx.cloudfront.net/1729480978805-talkingAvatarbg.png", "width": 780, "height": 438, "scale_x": 1, "scale_y": 1, "offset_x": 1920, "offset_y": 1080 }, { "type": "avatar", "url": "https://drz0f01yeq1cx.cloudfront.net/1735009621724-7ce105c6-ed9a-4d13-9061-7e3df59d9798-7953.mp4", "scale_x": 1, "scale_y": 1, "width": 1080, "height": 1080, "offset_x": 1920, "offset_y": 1080 }, { "type": "audio", "url": "https://drz0f01yeq1cx.cloudfront.net/1729666642023-bd6ad5f1-d558-40c7-b720-ad729688f814-6403.mp3", "input_text": "A military parade is a formation of military personnels whose movement is restricted by close-order manoeuvering known as drilling or marching. Large military parades are today held on major holidays and military events around the world.A military parade is a formation of military personnels whose movement is restricted by close-order manoeuvering known as drilling or marching. Large military parades are today held on major holidays and military events around the world.A military parade is a formation of military personnels whose movement is restricted by close-order manoeuvering known as drilling or marching. Large military parades are today held on major holidays and military events around the world.", "voice_id": "6889b628662160e2caad5dbc" } ], "webhookUrl": ""}
Request
Copy
curl --location 'https://openapi.akool.com/api/open/v3/talkingavatar/create' \--header 'Authorization: Bearer token' \--header 'Content-Type: application/json' \--data '{ "width": 3840, "height": 2160, "avatar_from": 3, "elements": [ { "type": "image", "url": "https://drz0f01yeq1cx.cloudfront.net/1729480978805-talkingAvatarbg.png", "width": 780, "height": 438, "scale_x": 1, "scale_y": 1, "offset_x": 1920, "offset_y": 1080 }, { "type": "avatar", "url": "https://drz0f01yeq1cx.cloudfront.net/1735009621724-7ce105c6-ed9a-4d13-9061-7e3df59d9798-7953.mp4", "scale_x": 1, "scale_y": 1, "width": 1080, "height": 1080, "offset_x": 1920, "offset_y": 1080 }, { "type": "audio", "url": "https://drz0f01yeq1cx.cloudfront.net/1729666642023-bd6ad5f1-d558-40c7-b720-ad729688f814-6403.mp3", "input_text": "A military parade is a formation of military personnels whose movement is restricted by close-order manoeuvering known as drilling or marching. Large military parades are today held on major holidays and military events around the world.A military parade is a formation of military personnels whose movement is restricted by close-order manoeuvering known as drilling or marching. Large military parades are today held on major holidays and military events around the world.A military parade is a formation of military personnels whose movement is restricted by close-order manoeuvering known as drilling or marching. Large military parades are today held on major holidays and military events around the world.", "voice_id": "6889b628662160e2caad5dbc" } ]}'
{ "code": 1000, "msg": "OK", "data": { "_id": "64dd92c1f0b6684651e90e09", "create_time": 1692242625334, // content creation time "uid": 378337, "video_id": "0acfed62e24f4cfd8801c9e846347b1d", // video id "deduction_duration": 10, // credits consumed by the final result "video_status": 2, // current status of video: 【1:queueing(The requested operation is being processed),2:processing(The requested operation is being processing),3:completed(The request operation has been processed successfully),4:failed(The request operation processing failed, the reason for the failure can be viewed in the video translation details.)】 "video": "" // Generated video resource url }}
GET https://openapi.akool.com/api/open/v3/avatar/detail
Request Headers
Parameter
Value
Description
Authorization
Bearer {token}
Your API Key used for request authorization. getToken
Query Attributes
Parameter
Type
Value
Description
id
String
avatar record id.
Response Attributes
Parameter
Type
Value
Description
code
int
1000
Interface returns business status code(1000:success)
msg
String
OK
Interface returns status information
data
Array
[{ avatar_id: "xx", url: "", status: "" }]
avatar_id: Used by avatar interface and creating avatar interface. url: You can preview the avatar via the link. status: 1-queueing 2-processing),3:completed 4-failed
POST https://openapi.akool.com/api/open/v3/avatar/create
Request Headers
Parameter
Value
Description
Authorization
Bearer token
Your API Key used for request authorization. getToken
Body Attributes
Parameter
Type
Value
Description
url
String
Avatar resource link. It is recommended that the video be about one minute long, and the avatar in the video content should rotate at a small angle and be clear.
avatar_id
String
avatar unique ID,Can only contain /^a-zA-Z0-9/.
name
String
Avatar display name for easier identification and management.
type
String
1
Avatar type, 1 represents talking avatar
Response Attributes
Parameter
Type
Value
Description
code
int
1000
Interface returns business status code(1000:success)
msg
String
OK
Interface returns status information
data
Array
[{ avatar_id: "xx", url: "", status: 1 }]
avatar_id: Used by creating live avatar interface. url: You can preview the avatar via the link. status: 1-queueing, 2-processing, 3-success, 4-failed