curl --request POST \
--url https://api.chariot.in/v1/tts/stream \
--header 'Content-Type: application/json' \
--header 'chariotai-api-key: <api-key>' \
--data '
{
"voice_id": "bac7d666-094d-4698-91fa-741d60fce662",
"text": "Hello from Chariot.",
"model_type": "chariot-multilingual-v1",
"speed": 1,
"optimize_streaming_latency": 0
}
'import requests
url = "https://api.chariot.in/v1/tts/stream"
payload = {
"voice_id": "bac7d666-094d-4698-91fa-741d60fce662",
"text": "Hello from Chariot.",
"model_type": "chariot-multilingual-v1",
"speed": 1,
"optimize_streaming_latency": 0
}
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: 'bac7d666-094d-4698-91fa-741d60fce662',
text: 'Hello from Chariot.',
model_type: 'chariot-multilingual-v1',
speed: 1,
optimize_streaming_latency: 0
})
};
fetch('https://api.chariot.in/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 => "https://api.chariot.in/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' => 'bac7d666-094d-4698-91fa-741d60fce662',
'text' => 'Hello from Chariot.',
'model_type' => 'chariot-multilingual-v1',
'speed' => 1,
'optimize_streaming_latency' => 0
]),
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 := "https://api.chariot.in/v1/tts/stream"
payload := strings.NewReader("{\n \"voice_id\": \"bac7d666-094d-4698-91fa-741d60fce662\",\n \"text\": \"Hello from Chariot.\",\n \"model_type\": \"chariot-multilingual-v1\",\n \"speed\": 1,\n \"optimize_streaming_latency\": 0\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("https://api.chariot.in/v1/tts/stream")
.header("chariotai-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"voice_id\": \"bac7d666-094d-4698-91fa-741d60fce662\",\n \"text\": \"Hello from Chariot.\",\n \"model_type\": \"chariot-multilingual-v1\",\n \"speed\": 1,\n \"optimize_streaming_latency\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chariot.in/v1/tts/stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["chariotai-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"voice_id\": \"bac7d666-094d-4698-91fa-741d60fce662\",\n \"text\": \"Hello from Chariot.\",\n \"model_type\": \"chariot-multilingual-v1\",\n \"speed\": 1,\n \"optimize_streaming_latency\": 0\n}"
response = http.request(request)
puts response.read_body"<string>"Stream text to speech
Synthesize speech and stream raw signed 16-bit little-endian PCM (audio/L16) at 44.1 kHz, mono. Pass model_type in the JSON body: chariot-v0 (default, up to 500 characters) or chariot-multilingual-v1 (up to 1,000). Unsupported models, voice/model combinations, or speeds return 422.
The server checks the upstream response and waits for initial audio before returning 200. Earlier failures return an HTTP error. Failures after the first audio chunk end the stream early without changing its status code, so verify you received a complete stream.
Metadata arrives in response headers before the body: X-inference-id, X-audio-url, and Credit-Utilized. The WAV archive is uploaded after generation on a best-effort basis.
Cost: 1 credit per input character. Credits are checked before generation and charged after successful delivery. A generation that fails partway is not charged.
curl --request POST \
--url https://api.chariot.in/v1/tts/stream \
--header 'Content-Type: application/json' \
--header 'chariotai-api-key: <api-key>' \
--data '
{
"voice_id": "bac7d666-094d-4698-91fa-741d60fce662",
"text": "Hello from Chariot.",
"model_type": "chariot-multilingual-v1",
"speed": 1,
"optimize_streaming_latency": 0
}
'import requests
url = "https://api.chariot.in/v1/tts/stream"
payload = {
"voice_id": "bac7d666-094d-4698-91fa-741d60fce662",
"text": "Hello from Chariot.",
"model_type": "chariot-multilingual-v1",
"speed": 1,
"optimize_streaming_latency": 0
}
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: 'bac7d666-094d-4698-91fa-741d60fce662',
text: 'Hello from Chariot.',
model_type: 'chariot-multilingual-v1',
speed: 1,
optimize_streaming_latency: 0
})
};
fetch('https://api.chariot.in/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 => "https://api.chariot.in/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' => 'bac7d666-094d-4698-91fa-741d60fce662',
'text' => 'Hello from Chariot.',
'model_type' => 'chariot-multilingual-v1',
'speed' => 1,
'optimize_streaming_latency' => 0
]),
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 := "https://api.chariot.in/v1/tts/stream"
payload := strings.NewReader("{\n \"voice_id\": \"bac7d666-094d-4698-91fa-741d60fce662\",\n \"text\": \"Hello from Chariot.\",\n \"model_type\": \"chariot-multilingual-v1\",\n \"speed\": 1,\n \"optimize_streaming_latency\": 0\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("https://api.chariot.in/v1/tts/stream")
.header("chariotai-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"voice_id\": \"bac7d666-094d-4698-91fa-741d60fce662\",\n \"text\": \"Hello from Chariot.\",\n \"model_type\": \"chariot-multilingual-v1\",\n \"speed\": 1,\n \"optimize_streaming_latency\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chariot.in/v1/tts/stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["chariotai-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"voice_id\": \"bac7d666-094d-4698-91fa-741d60fce662\",\n \"text\": \"Hello from Chariot.\",\n \"model_type\": \"chariot-multilingual-v1\",\n \"speed\": 1,\n \"optimize_streaming_latency\": 0\n}"
response = http.request(request)
puts response.read_body"<string>"Authorizations
Your Chariot API key, generated from the dashboard. Send it in the chariotai-api-key header on every request.
Body
The voice to synthesize with. Get valid ids from GET /v1/voices.
"bac7d666-094d-4698-91fa-741d60fce662"
Text to synthesize, with at least one character after trimming surrounding whitespace. For chariot-v0, sync accepts up to 700 characters and HTTP streaming up to 500. For chariot-multilingual-v1, both accept up to 1,000.
1 - 1000"Hello from Chariot."
TTS model to use. Defaults to chariot-v0. The legacy spelling v0 remains accepted for compatibility. Select a model supported by the voice.
chariot-v0, chariot-multilingual-v1 Speaking rate. Choose a value from the selected voice model entry's speeds list. chariot-v0 supports only 1.0. Other rates depend on the voice and model; an unavailable rate returns 422.
0.5 <= x <= 2Latency-optimization level. 0 applies all quality passes. Higher values trade quality passes for lower latency and may reduce output quality.
0 <= x <= 4Response
A chunked stream of raw PCM audio (16-bit LE, 44100 Hz, mono).
The response is of type file.