Skip to main content
POST
/
v1
/
tts
/
stream
TTS Stream API
curl --request POST \
  --url http://chariot-dev-backend-lb-828367089.ap-south-1.elb.amazonaws.com/v1/tts/stream \
  --header 'Content-Type: application/json' \
  --header 'chariotai-api-key: <api-key>' \
  --data '
{
  "voice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "text": "<string>",
  "model_type": "v0"
}
'
import requests

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

payload = {
"voice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"model_type": "v0"
}
headers = {
"chariotai-api-key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'chariotai-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
voice_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
text: '<string>',
model_type: 'v0'
})
};

fetch('http://chariot-dev-backend-lb-828367089.ap-south-1.elb.amazonaws.com/v1/tts/stream', 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/tts/stream",
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([
'voice_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'text' => '<string>',
'model_type' => 'v0'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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/tts/stream"

payload := strings.NewReader("{\n \"voice_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"model_type\": \"v0\"\n}")

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

req.Header.Add("chariotai-api-key", "<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("http://chariot-dev-backend-lb-828367089.ap-south-1.elb.amazonaws.com/v1/tts/stream")
.header("chariotai-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"voice_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"model_type\": \"v0\"\n}")
.asString();
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)
request["chariotai-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"voice_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"model_type\": \"v0\"\n}"

response = http.request(request)
puts response.read_body
"<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

application/json
voice_id
string<uuid>
required
text
string
required
model_type
enum<string>
default:v0
Available options:
v0

Response

Successful Response - Streams audio chunks in real-time

Streaming audio chunks (chunked transfer encoding). Audio chunks are streamed as they are generated.