cURL
curl --request POST \
--url https://app.duix.ai/duix-openapi-v2/sdk/v2/createAvatar \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"ttsName": "<string>",
"conversationId": "<string>",
"coverImage": "<string>",
"defaultSpeakingLanguage": "<string>",
"greetings": "<string>",
"name": "<string>",
"profile": "<string>"
}
'import requests
url = "https://app.duix.ai/duix-openapi-v2/sdk/v2/createAvatar"
payload = {
"ttsName": "<string>",
"conversationId": "<string>",
"coverImage": "<string>",
"defaultSpeakingLanguage": "<string>",
"greetings": "<string>",
"name": "<string>",
"profile": "<string>"
}
headers = {
"token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ttsName: '<string>',
conversationId: '<string>',
coverImage: '<string>',
defaultSpeakingLanguage: '<string>',
greetings: '<string>',
name: '<string>',
profile: '<string>'
})
};
fetch('https://app.duix.ai/duix-openapi-v2/sdk/v2/createAvatar', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.duix.ai/duix-openapi-v2/sdk/v2/createAvatar",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ttsName' => '<string>',
'conversationId' => '<string>',
'coverImage' => '<string>',
'defaultSpeakingLanguage' => '<string>',
'greetings' => '<string>',
'name' => '<string>',
'profile' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.duix.ai/duix-openapi-v2/sdk/v2/createAvatar"
payload := strings.NewReader("{\n \"ttsName\": \"<string>\",\n \"conversationId\": \"<string>\",\n \"coverImage\": \"<string>\",\n \"defaultSpeakingLanguage\": \"<string>\",\n \"greetings\": \"<string>\",\n \"name\": \"<string>\",\n \"profile\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.duix.ai/duix-openapi-v2/sdk/v2/createAvatar")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"ttsName\": \"<string>\",\n \"conversationId\": \"<string>\",\n \"coverImage\": \"<string>\",\n \"defaultSpeakingLanguage\": \"<string>\",\n \"greetings\": \"<string>\",\n \"name\": \"<string>\",\n \"profile\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.duix.ai/duix-openapi-v2/sdk/v2/createAvatar")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ttsName\": \"<string>\",\n \"conversationId\": \"<string>\",\n \"coverImage\": \"<string>\",\n \"defaultSpeakingLanguage\": \"<string>\",\n \"greetings\": \"<string>\",\n \"name\": \"<string>\",\n \"profile\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"code": "<string>",
"msg": "<string>",
"success": true,
"data": {
"taskId": "<string>"
}
}API reference
Create avatar
Create an avatar
POST
/
createAvatar
cURL
curl --request POST \
--url https://app.duix.ai/duix-openapi-v2/sdk/v2/createAvatar \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"ttsName": "<string>",
"conversationId": "<string>",
"coverImage": "<string>",
"defaultSpeakingLanguage": "<string>",
"greetings": "<string>",
"name": "<string>",
"profile": "<string>"
}
'import requests
url = "https://app.duix.ai/duix-openapi-v2/sdk/v2/createAvatar"
payload = {
"ttsName": "<string>",
"conversationId": "<string>",
"coverImage": "<string>",
"defaultSpeakingLanguage": "<string>",
"greetings": "<string>",
"name": "<string>",
"profile": "<string>"
}
headers = {
"token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ttsName: '<string>',
conversationId: '<string>',
coverImage: '<string>',
defaultSpeakingLanguage: '<string>',
greetings: '<string>',
name: '<string>',
profile: '<string>'
})
};
fetch('https://app.duix.ai/duix-openapi-v2/sdk/v2/createAvatar', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.duix.ai/duix-openapi-v2/sdk/v2/createAvatar",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ttsName' => '<string>',
'conversationId' => '<string>',
'coverImage' => '<string>',
'defaultSpeakingLanguage' => '<string>',
'greetings' => '<string>',
'name' => '<string>',
'profile' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.duix.ai/duix-openapi-v2/sdk/v2/createAvatar"
payload := strings.NewReader("{\n \"ttsName\": \"<string>\",\n \"conversationId\": \"<string>\",\n \"coverImage\": \"<string>\",\n \"defaultSpeakingLanguage\": \"<string>\",\n \"greetings\": \"<string>\",\n \"name\": \"<string>\",\n \"profile\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.duix.ai/duix-openapi-v2/sdk/v2/createAvatar")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"ttsName\": \"<string>\",\n \"conversationId\": \"<string>\",\n \"coverImage\": \"<string>\",\n \"defaultSpeakingLanguage\": \"<string>\",\n \"greetings\": \"<string>\",\n \"name\": \"<string>\",\n \"profile\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.duix.ai/duix-openapi-v2/sdk/v2/createAvatar")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ttsName\": \"<string>\",\n \"conversationId\": \"<string>\",\n \"coverImage\": \"<string>\",\n \"defaultSpeakingLanguage\": \"<string>\",\n \"greetings\": \"<string>\",\n \"name\": \"<string>\",\n \"profile\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"code": "<string>",
"msg": "<string>",
"success": true,
"data": {
"taskId": "<string>"
}
}Body
application/json
Avatar to add to the store
TTS name, select the public TTS voice. See at Settings -> Avatar creator -> Select voice
The conversation ID. Value is required when using public AI avatar Get Conversation ID
A value is needed if you are using images to customize your AI avatar. Base64 format. e.g. data:image/png;base64,iVBORw0KGgoAAAANSUhEUgA
Default speaking language. default English
Enter a greeting for your AI avatar’s first words, If not, the system will generate it randomly
Enter a name for your AI avatar. If not, the system will generate it randomly
Enter a description of personality and preferences you’d love your AI avatar to have.. If not, the system will generate it randomly
⌘I