Gradium TTS default
curl --request POST \
--url https://api.slng.ai/v1/tts/gradium/tts:default \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Hello, this is a test of Gradium text to speech.",
"voice_id": "YTpq7expH9539ERJ",
"output_format": "wav"
}
'import requests
url = "https://api.slng.ai/v1/tts/gradium/tts:default"
payload = {
"text": "Hello, this is a test of Gradium text to speech.",
"voice_id": "YTpq7expH9539ERJ",
"output_format": "wav"
}
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, this is a test of Gradium text to speech.',
voice_id: 'YTpq7expH9539ERJ',
output_format: 'wav'
})
};
fetch('https://api.slng.ai/v1/tts/gradium/tts:default', 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/gradium/tts:default",
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, this is a test of Gradium text to speech.',
'voice_id' => 'YTpq7expH9539ERJ',
'output_format' => 'wav'
]),
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/gradium/tts:default"
payload := strings.NewReader("{\n \"text\": \"Hello, this is a test of Gradium text to speech.\",\n \"voice_id\": \"YTpq7expH9539ERJ\",\n \"output_format\": \"wav\"\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/gradium/tts:default")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Hello, this is a test of Gradium text to speech.\",\n \"voice_id\": \"YTpq7expH9539ERJ\",\n \"output_format\": \"wav\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.slng.ai/v1/tts/gradium/tts:default")
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, this is a test of Gradium text to speech.\",\n \"voice_id\": \"YTpq7expH9539ERJ\",\n \"output_format\": \"wav\"\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Gradium TTS
Gradium TTS default
Real-time multilingual text-to-speech with streaming WebSocket and one-shot HTTP synthesis
POST
/
v1
/
tts
/
gradium
/
tts:default
Gradium TTS default
curl --request POST \
--url https://api.slng.ai/v1/tts/gradium/tts:default \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Hello, this is a test of Gradium text to speech.",
"voice_id": "YTpq7expH9539ERJ",
"output_format": "wav"
}
'import requests
url = "https://api.slng.ai/v1/tts/gradium/tts:default"
payload = {
"text": "Hello, this is a test of Gradium text to speech.",
"voice_id": "YTpq7expH9539ERJ",
"output_format": "wav"
}
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, this is a test of Gradium text to speech.',
voice_id: 'YTpq7expH9539ERJ',
output_format: 'wav'
})
};
fetch('https://api.slng.ai/v1/tts/gradium/tts:default', 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/gradium/tts:default",
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, this is a test of Gradium text to speech.',
'voice_id' => 'YTpq7expH9539ERJ',
'output_format' => 'wav'
]),
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/gradium/tts:default"
payload := strings.NewReader("{\n \"text\": \"Hello, this is a test of Gradium text to speech.\",\n \"voice_id\": \"YTpq7expH9539ERJ\",\n \"output_format\": \"wav\"\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/gradium/tts:default")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Hello, this is a test of Gradium text to speech.\",\n \"voice_id\": \"YTpq7expH9539ERJ\",\n \"output_format\": \"wav\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.slng.ai/v1/tts/gradium/tts:default")
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, this is a test of Gradium text to speech.\",\n \"voice_id\": \"YTpq7expH9539ERJ\",\n \"output_format\": \"wav\"\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.
Headers
Override the default region for this request.
Body
application/json
Text to synthesize.
Minimum string length:
1Voice ID from the Gradium voice library or a custom voice ID.
Output audio format.
Available options:
wav, pcm, pcm_8000, pcm_16000, pcm_24000, opus, ulaw_8000, alaw_8000 SLNG normalized output audio encoding (WebSocket streaming).
Available options:
wav, linear16, pcm, opus, mulaw, alaw Language hint for synthesis.
Available options:
en, fr, de, es, pt Sampling temperature (stability). Lower is more stable.
Required range:
0 <= x <= 1.4HTTP only. When true, returns raw audio bytes instead of a JSON message stream.
Response
Success
Was this page helpful?
⌘I