Skip to main content
POST
/
v1
/
voices
Add Voice
curl --request POST \
  --url http://chariot-dev-backend-lb-828367089.ap-south-1.elb.amazonaws.com/v1/voices \
  --header 'Content-Type: multipart/form-data' \
  --header 'chariotai-api-key: <api-key>' \
  --form file='@example-file' \
  --form voice_name= \
  --form voice_description=
import requests

url = "http://chariot-dev-backend-lb-828367089.ap-south-1.elb.amazonaws.com/v1/voices"

files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"voice_name": "",
"voice_description": ""
}
headers = {"chariotai-api-key": "<api-key>"}

response = requests.post(url, data=payload, files=files, headers=headers)

print(response.text)
const form = new FormData();
form.append('file', '<string>');
form.append('voice_name', '');
form.append('voice_description', '');

const options = {method: 'POST', headers: {'chariotai-api-key': '<api-key>'}};

options.body = form;

fetch('http://chariot-dev-backend-lb-828367089.ap-south-1.elb.amazonaws.com/v1/voices', 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 => "http://chariot-dev-backend-lb-828367089.ap-south-1.elb.amazonaws.com/v1/voices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice_name\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice_description\"\r\n\r\n\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"chariotai-api-key: <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 := "http://chariot-dev-backend-lb-828367089.ap-south-1.elb.amazonaws.com/v1/voices"

payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice_name\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice_description\"\r\n\r\n\r\n-----011000010111000001101001--")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("chariotai-api-key", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("http://chariot-dev-backend-lb-828367089.ap-south-1.elb.amazonaws.com/v1/voices")
.header("chariotai-api-key", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice_name\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice_description\"\r\n\r\n\r\n-----011000010111000001101001--")
.asString();
require 'uri'
require 'net/http'

url = URI("http://chariot-dev-backend-lb-828367089.ap-south-1.elb.amazonaws.com/v1/voices")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["chariotai-api-key"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice_name\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice_description\"\r\n\r\n\r\n-----011000010111000001101001--"

response = http.request(request)
puts response.read_body
{
  "voice_id": "<string>",
  "voice_name": "",
  "voice_description": "",
  "voice_sample": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

chariotai-api-key
string
header
required

Use the API key generated from our website to programmatically interact with our endpoints. This key authorizes your requests, allowing you to access and utilize our services securely.

Body

multipart/form-data
file
file
required
voice_name
string | null
default:""
voice_description
string | null
default:""

Response

Successful Response

voice_id
string
required
voice_name
string | null
default:""
voice_description
string | null
default:""
voice_sample
string | null