Typescript (SDK)
import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.voiceGroups.voiceGroupsCreateVoiceSample({
languageCode: "fa-IR",
voiceProvider: "Google",
voiceDisplayName: "Vindemiatrix (English)",
voiceSpeed: 1,
voicePitch: 0,
});
console.log(result);
}
run();import os
from syllable_sdk import SyllableSDK, models
with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:
res = ss_client.voice_groups.voice_groups_create_voice_sample(request={
"language_code": models.LanguageCode.FA_IR,
"voice_provider": models.TtsProvider.GOOGLE,
"voice_display_name": models.AgentVoiceDisplayName.VINDEMIATRIX_ENGLISH_,
"voice_speed": 1.0,
"voice_pitch": 0.0,
})
# Handle response
print(res)curl --request POST \
--url https://api.syllable.cloud/api/v1/voice_groups/voices/sample \
--header 'Content-Type: application/json' \
--header 'Syllable-API-Key: <api-key>' \
--data '
{
"language_code": "en-US",
"voice_provider": "OpenAI",
"voice_display_name": "Alloy",
"voice_speed": 1,
"voice_pitch": 0,
"text": "",
"apply_pronunciation_overrides": false
}
'const options = {
method: 'POST',
headers: {'Syllable-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
language_code: 'en-US',
voice_provider: 'OpenAI',
voice_display_name: 'Alloy',
voice_speed: 1,
voice_pitch: 0,
text: '',
apply_pronunciation_overrides: false
})
};
fetch('https://api.syllable.cloud/api/v1/voice_groups/voices/sample', 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.syllable.cloud/api/v1/voice_groups/voices/sample",
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([
'language_code' => 'en-US',
'voice_provider' => 'OpenAI',
'voice_display_name' => 'Alloy',
'voice_speed' => 1,
'voice_pitch' => 0,
'text' => '',
'apply_pronunciation_overrides' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Syllable-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.syllable.cloud/api/v1/voice_groups/voices/sample"
payload := strings.NewReader("{\n \"language_code\": \"en-US\",\n \"voice_provider\": \"OpenAI\",\n \"voice_display_name\": \"Alloy\",\n \"voice_speed\": 1,\n \"voice_pitch\": 0,\n \"text\": \"\",\n \"apply_pronunciation_overrides\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Syllable-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.syllable.cloud/api/v1/voice_groups/voices/sample")
.header("Syllable-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"language_code\": \"en-US\",\n \"voice_provider\": \"OpenAI\",\n \"voice_display_name\": \"Alloy\",\n \"voice_speed\": 1,\n \"voice_pitch\": 0,\n \"text\": \"\",\n \"apply_pronunciation_overrides\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/voice_groups/voices/sample")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Syllable-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"language_code\": \"en-US\",\n \"voice_provider\": \"OpenAI\",\n \"voice_display_name\": \"Alloy\",\n \"voice_speed\": 1,\n \"voice_pitch\": 0,\n \"text\": \"\",\n \"apply_pronunciation_overrides\": false\n}"
response = http.request(request)
puts response.read_body"<string>"{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}voice_groups
Create Voice Sample
Generate voice sample.
POST
/
api
/
v1
/
voice_groups
/
voices
/
sample
Typescript (SDK)
import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.voiceGroups.voiceGroupsCreateVoiceSample({
languageCode: "fa-IR",
voiceProvider: "Google",
voiceDisplayName: "Vindemiatrix (English)",
voiceSpeed: 1,
voicePitch: 0,
});
console.log(result);
}
run();import os
from syllable_sdk import SyllableSDK, models
with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:
res = ss_client.voice_groups.voice_groups_create_voice_sample(request={
"language_code": models.LanguageCode.FA_IR,
"voice_provider": models.TtsProvider.GOOGLE,
"voice_display_name": models.AgentVoiceDisplayName.VINDEMIATRIX_ENGLISH_,
"voice_speed": 1.0,
"voice_pitch": 0.0,
})
# Handle response
print(res)curl --request POST \
--url https://api.syllable.cloud/api/v1/voice_groups/voices/sample \
--header 'Content-Type: application/json' \
--header 'Syllable-API-Key: <api-key>' \
--data '
{
"language_code": "en-US",
"voice_provider": "OpenAI",
"voice_display_name": "Alloy",
"voice_speed": 1,
"voice_pitch": 0,
"text": "",
"apply_pronunciation_overrides": false
}
'const options = {
method: 'POST',
headers: {'Syllable-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
language_code: 'en-US',
voice_provider: 'OpenAI',
voice_display_name: 'Alloy',
voice_speed: 1,
voice_pitch: 0,
text: '',
apply_pronunciation_overrides: false
})
};
fetch('https://api.syllable.cloud/api/v1/voice_groups/voices/sample', 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.syllable.cloud/api/v1/voice_groups/voices/sample",
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([
'language_code' => 'en-US',
'voice_provider' => 'OpenAI',
'voice_display_name' => 'Alloy',
'voice_speed' => 1,
'voice_pitch' => 0,
'text' => '',
'apply_pronunciation_overrides' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Syllable-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.syllable.cloud/api/v1/voice_groups/voices/sample"
payload := strings.NewReader("{\n \"language_code\": \"en-US\",\n \"voice_provider\": \"OpenAI\",\n \"voice_display_name\": \"Alloy\",\n \"voice_speed\": 1,\n \"voice_pitch\": 0,\n \"text\": \"\",\n \"apply_pronunciation_overrides\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Syllable-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.syllable.cloud/api/v1/voice_groups/voices/sample")
.header("Syllable-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"language_code\": \"en-US\",\n \"voice_provider\": \"OpenAI\",\n \"voice_display_name\": \"Alloy\",\n \"voice_speed\": 1,\n \"voice_pitch\": 0,\n \"text\": \"\",\n \"apply_pronunciation_overrides\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/voice_groups/voices/sample")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Syllable-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"language_code\": \"en-US\",\n \"voice_provider\": \"OpenAI\",\n \"voice_display_name\": \"Alloy\",\n \"voice_speed\": 1,\n \"voice_pitch\": 0,\n \"text\": \"\",\n \"apply_pronunciation_overrides\": false\n}"
response = http.request(request)
puts response.read_body"<string>"{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
application/json
Request model to generate a sample audio file for a given voice and language.
BCP 47 code of the language
Available options:
yue-HK, en-US, ko-KR, zh-CN, fa-IR, es-US, th-TH, vi-VN, bs-BA, sw-KE, ru-RU, hi-IN, gu-IN, ar-XA, fr-FR, ja-JP, ne-NP Example:
"en-US"
TTS provider of the voice to use for the language
Available options:
OpenAI, ElevenLabs, Google, Cartesia Example:
"OpenAI"
Display name of the voice to use for the language
Available options:
Achernar (English), Achernar (Gujarati), Achernar (Arabic), Achernar (French), Achernar (Japanese), Achernar (Hindi), Achernar (Korean), Achernar (Mandarin), Achernar (Spanish), Achernar (Thai), Achernar (Vietnamese), Alice, Alloy, Aoede (English), Aoede (Gujarati), Aoede (Arabic), Aoede (French), Aoede (Japanese), Aoede (Hindi), Aoede (Korean), Aoede (Mandarin), Aoede (Russian), Aoede (Spanish), Aoede (Thai), Aoede (Vietnamese), Ash, Bill, Brian, Callirrhoe (English), Callirrhoe (Gujarati), Callirrhoe (Arabic), Callirrhoe (French), Callirrhoe (Japanese), Callirrhoe (Hindi), Callirrhoe (Korean), Callirrhoe (Mandarin), Callirrhoe (Spanish), Callirrhoe (Thai), Callirrhoe (Vietnamese), Callum, Charlie, Charlotte, Charon (English), Charon (Gujarati), Charon (Arabic), Charon (French), Charon (Japanese), Charon (Hindi), Charon (Korean), Charon (Mandarin), Charon (Russian), Charon (Spanish), Charon (Thai), Charon (Vietnamese), Chris, cmn-TW-Wavenet-A, Coral, Daniel, Echo, en-US-Neural2-D, en-US-Neural2-F, en-US-Neural2-J, en-US-Studio-O, Eric, es-US-Neural2-A, es-US-Neural2-B, Fable, Fenrir (English), Fenrir (Gujarati), Fenrir (Arabic), Fenrir (French), Fenrir (Japanese), Fenrir (Hindi), Fenrir (Korean), Fenrir (Mandarin), Fenrir (Russian), Fenrir (Spanish), Fenrir (Thai), Fenrir (Vietnamese), George, Jessica, ko-KR-Neural2-A, Kore (English), Kore (Gujarati), Kore (Arabic), Kore (French), Kore (Japanese), Kore (Hindi), Kore (Korean), Kore (Mandarin), Kore (Russian), Kore (Spanish), Kore (Thai), Kore (Vietnamese), Laura, Leda (English), Leda (Gujarati), Leda (Arabic), Leda (French), Leda (Japanese), Leda (Hindi), Leda (Korean), Leda (Mandarin), Leda (Russian), Leda (Spanish), Leda (Thai), Leda (Vietnamese), Liam, Lily, Matilda, Nova, Onyx, Orus (English), Orus (Gujarati), Orus (Arabic), Orus (French), Orus (Japanese), Orus (Hindi), Orus (Korean), Orus (Mandarin), Orus (Russian), Orus (Spanish), Orus (Thai), Orus (Vietnamese), Puck (English), Puck (Gujarati), Puck (Arabic), Puck (French), Puck (Japanese), Puck (Hindi), Puck (Korean), Puck (Mandarin), Puck (Russian), Puck (Spanish), Puck (Thai), Puck (Vietnamese), River, Roger, Sarah, Sage, Shimmer, Umbriel (English), Umbriel (Gujarati), Umbriel (Arabic), Umbriel (French), Umbriel (Japanese), Umbriel (Hindi), Umbriel (Korean), Umbriel (Mandarin), Umbriel (Spanish), Umbriel (Thai), Umbriel (Vietnamese), Vindemiatrix (English), Vindemiatrix (Gujarati), Vindemiatrix (Arabic), Vindemiatrix (French), Vindemiatrix (Japanese), Vindemiatrix (Hindi), Vindemiatrix (Korean), Vindemiatrix (Mandarin), Vindemiatrix (Spanish), Vindemiatrix (Thai), Vindemiatrix (Vietnamese), vi-VN-Neural2-A, Will, yue-HK-Standard-C, Zephyr (English), Zephyr (Gujarati), Zephyr (Arabic), Zephyr (French), Zephyr (Japanese), Zephyr (Hindi), Zephyr (Korean), Zephyr (Mandarin), Zephyr (Russian), Zephyr (Spanish), Zephyr (Thai), Zephyr (Vietnamese), Skylar (US), Daniel (US), Linda (US), Corey (US), Emma (US), Ximena (MX), Fernanda (MX), Emilio (MX), Marta (ES), Mateo (MX), Minji (KR), Haeun (KR), Taehyun (KR), Jaewon (KR), Hua (CN), Liu (CN), Xia (VN), Suda (TH) Example:
"Alloy"
Speed of the voice in the range of 0.25 to 4.0 (OpenAI and Google) or 0.7 to 1.2 (ElevenLabs). Standard speed is 1.0.
Example:
1
Pitch of the voice in the range of -20.0 to 20.0. 20 means increase 20 semitones from the original pitch. -20 means decrease 20 semitones from the original pitch. 0 means use the original pitch. Only supported for Google configs.
Example:
0
Text to generate for this voice.
Apply TTS pronunciation fixes.
Response
Successful Response
The response is of type file.

