Soniox TTS v1
curl --request POST \
--url https://api.slng.ai/v1/tts/soniox/tts-rt:v1 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Hello from Soniox text-to-speech.",
"voice": "Adrian",
"audio_format": "wav",
"sample_rate": 24000
}
'import requests
url = "https://api.slng.ai/v1/tts/soniox/tts-rt:v1"
payload = {
"text": "Hello from Soniox text-to-speech.",
"voice": "Adrian",
"audio_format": "wav",
"sample_rate": 24000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: 'Hello from Soniox text-to-speech.',
voice: 'Adrian',
audio_format: 'wav',
sample_rate: 24000
})
};
fetch('https://api.slng.ai/v1/tts/soniox/tts-rt:v1', 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.slng.ai/v1/tts/soniox/tts-rt:v1",
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([
'text' => 'Hello from Soniox text-to-speech.',
'voice' => 'Adrian',
'audio_format' => 'wav',
'sample_rate' => 24000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.slng.ai/v1/tts/soniox/tts-rt:v1"
payload := strings.NewReader("{\n \"text\": \"Hello from Soniox text-to-speech.\",\n \"voice\": \"Adrian\",\n \"audio_format\": \"wav\",\n \"sample_rate\": 24000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.slng.ai/v1/tts/soniox/tts-rt:v1")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Hello from Soniox text-to-speech.\",\n \"voice\": \"Adrian\",\n \"audio_format\": \"wav\",\n \"sample_rate\": 24000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.slng.ai/v1/tts/soniox/tts-rt:v1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"Hello from Soniox text-to-speech.\",\n \"voice\": \"Adrian\",\n \"audio_format\": \"wav\",\n \"sample_rate\": 24000\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}TTS v1
Soniox TTS v1
Real-time text-to-speech with streaming WebSocket and one-shot HTTP synthesis
POST
/
v1
/
tts
/
soniox
/
tts-rt:v1
Soniox TTS v1
curl --request POST \
--url https://api.slng.ai/v1/tts/soniox/tts-rt:v1 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Hello from Soniox text-to-speech.",
"voice": "Adrian",
"audio_format": "wav",
"sample_rate": 24000
}
'import requests
url = "https://api.slng.ai/v1/tts/soniox/tts-rt:v1"
payload = {
"text": "Hello from Soniox text-to-speech.",
"voice": "Adrian",
"audio_format": "wav",
"sample_rate": 24000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: 'Hello from Soniox text-to-speech.',
voice: 'Adrian',
audio_format: 'wav',
sample_rate: 24000
})
};
fetch('https://api.slng.ai/v1/tts/soniox/tts-rt:v1', 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.slng.ai/v1/tts/soniox/tts-rt:v1",
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([
'text' => 'Hello from Soniox text-to-speech.',
'voice' => 'Adrian',
'audio_format' => 'wav',
'sample_rate' => 24000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.slng.ai/v1/tts/soniox/tts-rt:v1"
payload := strings.NewReader("{\n \"text\": \"Hello from Soniox text-to-speech.\",\n \"voice\": \"Adrian\",\n \"audio_format\": \"wav\",\n \"sample_rate\": 24000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.slng.ai/v1/tts/soniox/tts-rt:v1")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Hello from Soniox text-to-speech.\",\n \"voice\": \"Adrian\",\n \"audio_format\": \"wav\",\n \"sample_rate\": 24000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.slng.ai/v1/tts/soniox/tts-rt:v1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"Hello from Soniox text-to-speech.\",\n \"voice\": \"Adrian\",\n \"audio_format\": \"wav\",\n \"sample_rate\": 24000\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Soniox real-time TTS synthesis request.
Text to synthesize.
Required string length:
1 - 5000Voice name.
ISO 639-1 language code.
Available options:
af, sq, ar, az, eu, be, bn, bs, bg, ca, zh, hr, cs, da, nl, en, et, fi, fr, gl, de, el, gu, he, hi, hu, id, it, ja, kn, kk, ko, lv, lt, mk, ms, ml, mr, no, fa, pl, pt, pa, ro, ru, sr, sk, sl, es, sw, sv, tl, ta, te, th, tr, uk, ur, vi, cy Output audio format.
Output sample rate in Hz.
Codec bitrate in bps. Only applicable to lossy compressed formats.
Soniox TTS model identifier.
Response
Success
Was this page helpful?
⌘I