Skip to main content
POST
/
api
/
open
/
v3
/
avatar
/
create
Upload Streaming Avatar
curl --request POST \
  --url https://openapi.akool.com/api/open/v3/avatar/create \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "url": "https://drz0f01yeq1cx.cloudfront.net/1721197444322-leijun000.mp4",
  "avatar_id": "HHdEKhn7k7vVBlR5FSi0e",
  "name": "My Streaming Avatar",
  "type": 2,
  "url_from": 1
}'
{
  "code": 1000,
  "msg": "ok",
  "data": {
    "_id": "655ffeada6976ea317087193",
    "disabled": false,
    "uid": 1,
    "type": 2,
    "from": 2,
    "status": 1,
    "sort": 12,
    "create_time": 1700788730000,
    "name": "Yasmin in White shirt",
    "avatar_id": "Yasmin_in_White_shirt_20231121",
    "url": "https://drz0f01yeq1cx.cloudfront.net/1700786304161-b574407f-f926-4b3e-bba7-dc77d1742e60-8169.png",
    "modify_url": "https://drz0f01yeq1cx.cloudfront.net/1700786304161-b574407f-f926-4b3e-bba7-dc77d1742e60-8169.png",
    "gender": "female",
    "thumbnailUrl": "https://drz0f01yeq1cx.cloudfront.net/avatar/thumbnail/1700786304161-b574407f-f926-4b3e-bba7-dc77d1742e60-8169.png",
    "crop_arr": []
  }
}
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.

Authorizations

x-api-key
string
header
required

Your API Key used for request authorization. If both Authorization and x-api-key have values, Authorization will be used first and x-api-key will be discarded.

Body

application/json
url
string
required

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
required

Avatar unique ID, can only contain alphanumeric characters

name
string
required

Avatar display name for easier identification and management

type
enum<integer>
required

Avatar type 2 represents stream avatar. When type is 2, you need to wait until status is 3 before you can use it. You can get the current status in real time through the Get Avatar Detail API.

Available options:
2
url_from
enum<integer>
required

URL source, 1 means akool and other links, 2 means other third-party links (currently only supports YouTube / TikTok / X / Google Drive)

Available options:
1,
2

Response

200 - application/json

Avatar created successfully

code
integer
required

Interface returns business status code (1000: success)

Example:

1000

msg
string
required

Interface returns status information

Example:

"OK"

data
object