curl --request POST \
--url https://us-east.api.slng.ai/v1/tts/slng/deepgram/aura:2-en \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "aura-2-thalia-en",
"text": "Hello, this is a test of text to speech synthesis."
}
'import requests
url = "https://us-east.api.slng.ai/v1/tts/slng/deepgram/aura:2-en"
payload = {
"model": "aura-2-thalia-en",
"text": "Hello, this is a test of text to speech synthesis."
}
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({
model: 'aura-2-thalia-en',
text: 'Hello, this is a test of text to speech synthesis.'
})
};
fetch('https://us-east.api.slng.ai/v1/tts/slng/deepgram/aura:2-en', 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://us-east.api.slng.ai/v1/tts/slng/deepgram/aura:2-en",
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([
'model' => 'aura-2-thalia-en',
'text' => 'Hello, this is a test of text to speech synthesis.'
]),
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://us-east.api.slng.ai/v1/tts/slng/deepgram/aura:2-en"
payload := strings.NewReader("{\n \"model\": \"aura-2-thalia-en\",\n \"text\": \"Hello, this is a test of text to speech synthesis.\"\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://us-east.api.slng.ai/v1/tts/slng/deepgram/aura:2-en")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"aura-2-thalia-en\",\n \"text\": \"Hello, this is a test of text to speech synthesis.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://us-east.api.slng.ai/v1/tts/slng/deepgram/aura:2-en")
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 \"model\": \"aura-2-thalia-en\",\n \"text\": \"Hello, this is a test of text to speech synthesis.\"\n}"
response = http.request(request)
puts response.read_bodyAura 2 (English)
Synthesize English speech using SLNG-hosted Deepgram Aura 2.
curl --request POST \
--url https://us-east.api.slng.ai/v1/tts/slng/deepgram/aura:2-en \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "aura-2-thalia-en",
"text": "Hello, this is a test of text to speech synthesis."
}
'import requests
url = "https://us-east.api.slng.ai/v1/tts/slng/deepgram/aura:2-en"
payload = {
"model": "aura-2-thalia-en",
"text": "Hello, this is a test of text to speech synthesis."
}
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({
model: 'aura-2-thalia-en',
text: 'Hello, this is a test of text to speech synthesis.'
})
};
fetch('https://us-east.api.slng.ai/v1/tts/slng/deepgram/aura:2-en', 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://us-east.api.slng.ai/v1/tts/slng/deepgram/aura:2-en",
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([
'model' => 'aura-2-thalia-en',
'text' => 'Hello, this is a test of text to speech synthesis.'
]),
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://us-east.api.slng.ai/v1/tts/slng/deepgram/aura:2-en"
payload := strings.NewReader("{\n \"model\": \"aura-2-thalia-en\",\n \"text\": \"Hello, this is a test of text to speech synthesis.\"\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://us-east.api.slng.ai/v1/tts/slng/deepgram/aura:2-en")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"aura-2-thalia-en\",\n \"text\": \"Hello, this is a test of text to speech synthesis.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://us-east.api.slng.ai/v1/tts/slng/deepgram/aura:2-en")
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 \"model\": \"aura-2-thalia-en\",\n \"text\": \"Hello, this is a test of text to speech synthesis.\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
API key issued by SLNG. Pass as Authorization: Bearer <token>.
Body
Text to synthesize.
1English voice model. Check the full list with audio samples in the voice list.
aura-2-amalthea-en, aura-2-andromeda-en, aura-2-apollo-en, aura-2-arcas-en, aura-2-aries-en, aura-2-asteria-en, aura-2-athena-en, aura-2-atlas-en, aura-2-aurora-en, aura-2-callista-en, aura-2-cordelia-en, aura-2-cora-en, aura-2-delia-en, aura-2-draco-en, aura-2-electra-en, aura-2-harmonia-en, aura-2-helena-en, aura-2-hera-en, aura-2-hermes-en, aura-2-hyperion-en, aura-2-iris-en, aura-2-janus-en, aura-2-juno-en, aura-2-jupiter-en, aura-2-luna-en, aura-2-mars-en, aura-2-minerva-en, aura-2-neptune-en, aura-2-odysseus-en, aura-2-ophelia-en, aura-2-orion-en, aura-2-orpheus-en, aura-2-pandora-en, aura-2-phoebe-en, aura-2-pluto-en, aura-2-saturn-en, aura-2-selene-en, aura-2-thalia-en, aura-2-theia-en, aura-2-vesta-en, aura-2-zeus-en Output audio encoding for HTTP synthesis (default linear16). Parameter applicability depends on the encoding and Deepgram rejects a parameter that does not apply: sample_rate does not apply to mp3 or opus, container does not apply to mp3 or flac, and bit_rate applies only to mp3 and opus. flac accepts every sample rate except 24000. aac is not offered because its raw stream cannot be metered. Over WebSocket the same Aura models accept only linear16, mulaw, and alaw.
linear16, mp3, opus, flac, mulaw, alaw Output sample rate in Hz. Applies to linear16 (all values, default 24000), mulaw/alaw (8000 or 16000), and flac (8000, 16000, 32000, 48000; 24000 is rejected, default 48000). Must be omitted for mp3 and opus.
8000, 16000, 24000, 32000, 48000 Output container. none or wav for linear16, mulaw, and alaw (default wav); ogg only for opus. Must be omitted for mp3 and flac.
none, wav, ogg Output bit rate for lossy encodings only. mp3 accepts 8000, 16000, 24000, 32000, and 48000 (the MP3 sample rate is derived from it, e.g. 48000 bps yields 24000 Hz); opus accepts every listed value. Must be omitted for other encodings.
8000, 16000, 24000, 32000, 48000, 64000, 96000, 128000, 192000, 256000 Response
Synthesis successful.
Binary audio data.