Voices
Preview Voice
Performs a test generation of a voice, returning the resulting audio or error.
POST
/
api
/
voice_preview
cURL
curl --request POST \
--url https://api.ultravox.ai/api/voice_preview \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"definition": {
"elevenLabs": {
"voiceId": "<string>",
"model": "<string>",
"speed": 123,
"useSpeakerBoost": true,
"style": 123,
"similarityBoost": 123,
"stability": 123,
"pronunciationDictionaries": [
{
"dictionaryId": "<string>",
"versionId": "<string>"
}
],
"optimizeStreamingLatency": 123,
"maxSampleRate": 123,
"enableSsmlParsing": true
},
"cartesia": {
"voiceId": "<string>",
"model": "<string>",
"speed": 123,
"emotion": "<string>",
"emotions": [
"<string>"
],
"generationConfig": {
"volume": 123,
"speed": 123,
"emotion": "<string>",
"pronunciationDictId": "<string>"
}
},
"lmnt": {
"voiceId": "<string>",
"model": "<string>",
"speed": 123,
"conversational": true
},
"google": {
"voiceId": "<string>",
"speakingRate": 123
},
"inworld": {
"voiceId": "<string>",
"modelId": "<string>",
"speakingRate": 123,
"temperature": 123,
"applyTextNormalization": true
},
"respeecher": {
"voiceId": "<string>",
"model": "<string>",
"seed": 123,
"temperature": 123,
"topK": 123,
"topP": 123,
"minP": 123,
"presencePenalty": 123,
"repetitionPenalty": 123,
"frequencyPenalty": 123
},
"generic": {
"url": "<string>",
"headers": {},
"body": {},
"responseSampleRate": 123,
"responseWordsPerMinute": 123,
"responseMimeType": "<string>",
"jsonAudioFieldPath": "<string>"
}
},
"description": "<string>",
"primaryLanguage": "<string>"
}
'import requests
url = "https://api.ultravox.ai/api/voice_preview"
payload = {
"name": "<string>",
"definition": {
"elevenLabs": {
"voiceId": "<string>",
"model": "<string>",
"speed": 123,
"useSpeakerBoost": True,
"style": 123,
"similarityBoost": 123,
"stability": 123,
"pronunciationDictionaries": [
{
"dictionaryId": "<string>",
"versionId": "<string>"
}
],
"optimizeStreamingLatency": 123,
"maxSampleRate": 123,
"enableSsmlParsing": True
},
"cartesia": {
"voiceId": "<string>",
"model": "<string>",
"speed": 123,
"emotion": "<string>",
"emotions": ["<string>"],
"generationConfig": {
"volume": 123,
"speed": 123,
"emotion": "<string>",
"pronunciationDictId": "<string>"
}
},
"lmnt": {
"voiceId": "<string>",
"model": "<string>",
"speed": 123,
"conversational": True
},
"google": {
"voiceId": "<string>",
"speakingRate": 123
},
"inworld": {
"voiceId": "<string>",
"modelId": "<string>",
"speakingRate": 123,
"temperature": 123,
"applyTextNormalization": True
},
"respeecher": {
"voiceId": "<string>",
"model": "<string>",
"seed": 123,
"temperature": 123,
"topK": 123,
"topP": 123,
"minP": 123,
"presencePenalty": 123,
"repetitionPenalty": 123,
"frequencyPenalty": 123
},
"generic": {
"url": "<string>",
"headers": {},
"body": {},
"responseSampleRate": 123,
"responseWordsPerMinute": 123,
"responseMimeType": "<string>",
"jsonAudioFieldPath": "<string>"
}
},
"description": "<string>",
"primaryLanguage": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
definition: {
elevenLabs: {
voiceId: '<string>',
model: '<string>',
speed: 123,
useSpeakerBoost: true,
style: 123,
similarityBoost: 123,
stability: 123,
pronunciationDictionaries: [{dictionaryId: '<string>', versionId: '<string>'}],
optimizeStreamingLatency: 123,
maxSampleRate: 123,
enableSsmlParsing: true
},
cartesia: {
voiceId: '<string>',
model: '<string>',
speed: 123,
emotion: '<string>',
emotions: ['<string>'],
generationConfig: {volume: 123, speed: 123, emotion: '<string>', pronunciationDictId: '<string>'}
},
lmnt: {voiceId: '<string>', model: '<string>', speed: 123, conversational: true},
google: {voiceId: '<string>', speakingRate: 123},
inworld: {
voiceId: '<string>',
modelId: '<string>',
speakingRate: 123,
temperature: 123,
applyTextNormalization: true
},
respeecher: {
voiceId: '<string>',
model: '<string>',
seed: 123,
temperature: 123,
topK: 123,
topP: 123,
minP: 123,
presencePenalty: 123,
repetitionPenalty: 123,
frequencyPenalty: 123
},
generic: {
url: '<string>',
headers: {},
body: JSON.stringify({}),
responseSampleRate: 123,
responseWordsPerMinute: 123,
responseMimeType: '<string>',
jsonAudioFieldPath: '<string>'
}
},
description: '<string>',
primaryLanguage: '<string>'
})
};
fetch('https://api.ultravox.ai/api/voice_preview', 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.ultravox.ai/api/voice_preview",
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([
'name' => '<string>',
'definition' => [
'elevenLabs' => [
'voiceId' => '<string>',
'model' => '<string>',
'speed' => 123,
'useSpeakerBoost' => true,
'style' => 123,
'similarityBoost' => 123,
'stability' => 123,
'pronunciationDictionaries' => [
[
'dictionaryId' => '<string>',
'versionId' => '<string>'
]
],
'optimizeStreamingLatency' => 123,
'maxSampleRate' => 123,
'enableSsmlParsing' => true
],
'cartesia' => [
'voiceId' => '<string>',
'model' => '<string>',
'speed' => 123,
'emotion' => '<string>',
'emotions' => [
'<string>'
],
'generationConfig' => [
'volume' => 123,
'speed' => 123,
'emotion' => '<string>',
'pronunciationDictId' => '<string>'
]
],
'lmnt' => [
'voiceId' => '<string>',
'model' => '<string>',
'speed' => 123,
'conversational' => true
],
'google' => [
'voiceId' => '<string>',
'speakingRate' => 123
],
'inworld' => [
'voiceId' => '<string>',
'modelId' => '<string>',
'speakingRate' => 123,
'temperature' => 123,
'applyTextNormalization' => true
],
'respeecher' => [
'voiceId' => '<string>',
'model' => '<string>',
'seed' => 123,
'temperature' => 123,
'topK' => 123,
'topP' => 123,
'minP' => 123,
'presencePenalty' => 123,
'repetitionPenalty' => 123,
'frequencyPenalty' => 123
],
'generic' => [
'url' => '<string>',
'headers' => [
],
'body' => [
],
'responseSampleRate' => 123,
'responseWordsPerMinute' => 123,
'responseMimeType' => '<string>',
'jsonAudioFieldPath' => '<string>'
]
],
'description' => '<string>',
'primaryLanguage' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-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.ultravox.ai/api/voice_preview"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"definition\": {\n \"elevenLabs\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"speed\": 123,\n \"useSpeakerBoost\": true,\n \"style\": 123,\n \"similarityBoost\": 123,\n \"stability\": 123,\n \"pronunciationDictionaries\": [\n {\n \"dictionaryId\": \"<string>\",\n \"versionId\": \"<string>\"\n }\n ],\n \"optimizeStreamingLatency\": 123,\n \"maxSampleRate\": 123,\n \"enableSsmlParsing\": true\n },\n \"cartesia\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"speed\": 123,\n \"emotion\": \"<string>\",\n \"emotions\": [\n \"<string>\"\n ],\n \"generationConfig\": {\n \"volume\": 123,\n \"speed\": 123,\n \"emotion\": \"<string>\",\n \"pronunciationDictId\": \"<string>\"\n }\n },\n \"lmnt\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"speed\": 123,\n \"conversational\": true\n },\n \"google\": {\n \"voiceId\": \"<string>\",\n \"speakingRate\": 123\n },\n \"inworld\": {\n \"voiceId\": \"<string>\",\n \"modelId\": \"<string>\",\n \"speakingRate\": 123,\n \"temperature\": 123,\n \"applyTextNormalization\": true\n },\n \"respeecher\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"seed\": 123,\n \"temperature\": 123,\n \"topK\": 123,\n \"topP\": 123,\n \"minP\": 123,\n \"presencePenalty\": 123,\n \"repetitionPenalty\": 123,\n \"frequencyPenalty\": 123\n },\n \"generic\": {\n \"url\": \"<string>\",\n \"headers\": {},\n \"body\": {},\n \"responseSampleRate\": 123,\n \"responseWordsPerMinute\": 123,\n \"responseMimeType\": \"<string>\",\n \"jsonAudioFieldPath\": \"<string>\"\n }\n },\n \"description\": \"<string>\",\n \"primaryLanguage\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-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.ultravox.ai/api/voice_preview")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"definition\": {\n \"elevenLabs\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"speed\": 123,\n \"useSpeakerBoost\": true,\n \"style\": 123,\n \"similarityBoost\": 123,\n \"stability\": 123,\n \"pronunciationDictionaries\": [\n {\n \"dictionaryId\": \"<string>\",\n \"versionId\": \"<string>\"\n }\n ],\n \"optimizeStreamingLatency\": 123,\n \"maxSampleRate\": 123,\n \"enableSsmlParsing\": true\n },\n \"cartesia\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"speed\": 123,\n \"emotion\": \"<string>\",\n \"emotions\": [\n \"<string>\"\n ],\n \"generationConfig\": {\n \"volume\": 123,\n \"speed\": 123,\n \"emotion\": \"<string>\",\n \"pronunciationDictId\": \"<string>\"\n }\n },\n \"lmnt\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"speed\": 123,\n \"conversational\": true\n },\n \"google\": {\n \"voiceId\": \"<string>\",\n \"speakingRate\": 123\n },\n \"inworld\": {\n \"voiceId\": \"<string>\",\n \"modelId\": \"<string>\",\n \"speakingRate\": 123,\n \"temperature\": 123,\n \"applyTextNormalization\": true\n },\n \"respeecher\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"seed\": 123,\n \"temperature\": 123,\n \"topK\": 123,\n \"topP\": 123,\n \"minP\": 123,\n \"presencePenalty\": 123,\n \"repetitionPenalty\": 123,\n \"frequencyPenalty\": 123\n },\n \"generic\": {\n \"url\": \"<string>\",\n \"headers\": {},\n \"body\": {},\n \"responseSampleRate\": 123,\n \"responseWordsPerMinute\": 123,\n \"responseMimeType\": \"<string>\",\n \"jsonAudioFieldPath\": \"<string>\"\n }\n },\n \"description\": \"<string>\",\n \"primaryLanguage\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ultravox.ai/api/voice_preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"definition\": {\n \"elevenLabs\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"speed\": 123,\n \"useSpeakerBoost\": true,\n \"style\": 123,\n \"similarityBoost\": 123,\n \"stability\": 123,\n \"pronunciationDictionaries\": [\n {\n \"dictionaryId\": \"<string>\",\n \"versionId\": \"<string>\"\n }\n ],\n \"optimizeStreamingLatency\": 123,\n \"maxSampleRate\": 123,\n \"enableSsmlParsing\": true\n },\n \"cartesia\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"speed\": 123,\n \"emotion\": \"<string>\",\n \"emotions\": [\n \"<string>\"\n ],\n \"generationConfig\": {\n \"volume\": 123,\n \"speed\": 123,\n \"emotion\": \"<string>\",\n \"pronunciationDictId\": \"<string>\"\n }\n },\n \"lmnt\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"speed\": 123,\n \"conversational\": true\n },\n \"google\": {\n \"voiceId\": \"<string>\",\n \"speakingRate\": 123\n },\n \"inworld\": {\n \"voiceId\": \"<string>\",\n \"modelId\": \"<string>\",\n \"speakingRate\": 123,\n \"temperature\": 123,\n \"applyTextNormalization\": true\n },\n \"respeecher\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"seed\": 123,\n \"temperature\": 123,\n \"topK\": 123,\n \"topP\": 123,\n \"minP\": 123,\n \"presencePenalty\": 123,\n \"repetitionPenalty\": 123,\n \"frequencyPenalty\": 123\n },\n \"generic\": {\n \"url\": \"<string>\",\n \"headers\": {},\n \"body\": {},\n \"responseSampleRate\": 123,\n \"responseWordsPerMinute\": 123,\n \"responseMimeType\": \"<string>\",\n \"jsonAudioFieldPath\": \"<string>\"\n }\n },\n \"description\": \"<string>\",\n \"primaryLanguage\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body"<string>"{}Authorizations
API key
Body
application/json
Maximum string length:
40A voice not known to Ultravox Realtime that can nonetheless be used for a call. Such voices are significantly less validated than normal voices and you'll be responsible for your own TTS-related errors. Exactly one field must be set.
Show child attributes
Show child attributes
Maximum string length:
240BCP47 language code for the primary language supported by this voice.
Maximum string length:
10Response
The response is of type file.
⌘I
cURL
curl --request POST \
--url https://api.ultravox.ai/api/voice_preview \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"definition": {
"elevenLabs": {
"voiceId": "<string>",
"model": "<string>",
"speed": 123,
"useSpeakerBoost": true,
"style": 123,
"similarityBoost": 123,
"stability": 123,
"pronunciationDictionaries": [
{
"dictionaryId": "<string>",
"versionId": "<string>"
}
],
"optimizeStreamingLatency": 123,
"maxSampleRate": 123,
"enableSsmlParsing": true
},
"cartesia": {
"voiceId": "<string>",
"model": "<string>",
"speed": 123,
"emotion": "<string>",
"emotions": [
"<string>"
],
"generationConfig": {
"volume": 123,
"speed": 123,
"emotion": "<string>",
"pronunciationDictId": "<string>"
}
},
"lmnt": {
"voiceId": "<string>",
"model": "<string>",
"speed": 123,
"conversational": true
},
"google": {
"voiceId": "<string>",
"speakingRate": 123
},
"inworld": {
"voiceId": "<string>",
"modelId": "<string>",
"speakingRate": 123,
"temperature": 123,
"applyTextNormalization": true
},
"respeecher": {
"voiceId": "<string>",
"model": "<string>",
"seed": 123,
"temperature": 123,
"topK": 123,
"topP": 123,
"minP": 123,
"presencePenalty": 123,
"repetitionPenalty": 123,
"frequencyPenalty": 123
},
"generic": {
"url": "<string>",
"headers": {},
"body": {},
"responseSampleRate": 123,
"responseWordsPerMinute": 123,
"responseMimeType": "<string>",
"jsonAudioFieldPath": "<string>"
}
},
"description": "<string>",
"primaryLanguage": "<string>"
}
'import requests
url = "https://api.ultravox.ai/api/voice_preview"
payload = {
"name": "<string>",
"definition": {
"elevenLabs": {
"voiceId": "<string>",
"model": "<string>",
"speed": 123,
"useSpeakerBoost": True,
"style": 123,
"similarityBoost": 123,
"stability": 123,
"pronunciationDictionaries": [
{
"dictionaryId": "<string>",
"versionId": "<string>"
}
],
"optimizeStreamingLatency": 123,
"maxSampleRate": 123,
"enableSsmlParsing": True
},
"cartesia": {
"voiceId": "<string>",
"model": "<string>",
"speed": 123,
"emotion": "<string>",
"emotions": ["<string>"],
"generationConfig": {
"volume": 123,
"speed": 123,
"emotion": "<string>",
"pronunciationDictId": "<string>"
}
},
"lmnt": {
"voiceId": "<string>",
"model": "<string>",
"speed": 123,
"conversational": True
},
"google": {
"voiceId": "<string>",
"speakingRate": 123
},
"inworld": {
"voiceId": "<string>",
"modelId": "<string>",
"speakingRate": 123,
"temperature": 123,
"applyTextNormalization": True
},
"respeecher": {
"voiceId": "<string>",
"model": "<string>",
"seed": 123,
"temperature": 123,
"topK": 123,
"topP": 123,
"minP": 123,
"presencePenalty": 123,
"repetitionPenalty": 123,
"frequencyPenalty": 123
},
"generic": {
"url": "<string>",
"headers": {},
"body": {},
"responseSampleRate": 123,
"responseWordsPerMinute": 123,
"responseMimeType": "<string>",
"jsonAudioFieldPath": "<string>"
}
},
"description": "<string>",
"primaryLanguage": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
definition: {
elevenLabs: {
voiceId: '<string>',
model: '<string>',
speed: 123,
useSpeakerBoost: true,
style: 123,
similarityBoost: 123,
stability: 123,
pronunciationDictionaries: [{dictionaryId: '<string>', versionId: '<string>'}],
optimizeStreamingLatency: 123,
maxSampleRate: 123,
enableSsmlParsing: true
},
cartesia: {
voiceId: '<string>',
model: '<string>',
speed: 123,
emotion: '<string>',
emotions: ['<string>'],
generationConfig: {volume: 123, speed: 123, emotion: '<string>', pronunciationDictId: '<string>'}
},
lmnt: {voiceId: '<string>', model: '<string>', speed: 123, conversational: true},
google: {voiceId: '<string>', speakingRate: 123},
inworld: {
voiceId: '<string>',
modelId: '<string>',
speakingRate: 123,
temperature: 123,
applyTextNormalization: true
},
respeecher: {
voiceId: '<string>',
model: '<string>',
seed: 123,
temperature: 123,
topK: 123,
topP: 123,
minP: 123,
presencePenalty: 123,
repetitionPenalty: 123,
frequencyPenalty: 123
},
generic: {
url: '<string>',
headers: {},
body: JSON.stringify({}),
responseSampleRate: 123,
responseWordsPerMinute: 123,
responseMimeType: '<string>',
jsonAudioFieldPath: '<string>'
}
},
description: '<string>',
primaryLanguage: '<string>'
})
};
fetch('https://api.ultravox.ai/api/voice_preview', 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.ultravox.ai/api/voice_preview",
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([
'name' => '<string>',
'definition' => [
'elevenLabs' => [
'voiceId' => '<string>',
'model' => '<string>',
'speed' => 123,
'useSpeakerBoost' => true,
'style' => 123,
'similarityBoost' => 123,
'stability' => 123,
'pronunciationDictionaries' => [
[
'dictionaryId' => '<string>',
'versionId' => '<string>'
]
],
'optimizeStreamingLatency' => 123,
'maxSampleRate' => 123,
'enableSsmlParsing' => true
],
'cartesia' => [
'voiceId' => '<string>',
'model' => '<string>',
'speed' => 123,
'emotion' => '<string>',
'emotions' => [
'<string>'
],
'generationConfig' => [
'volume' => 123,
'speed' => 123,
'emotion' => '<string>',
'pronunciationDictId' => '<string>'
]
],
'lmnt' => [
'voiceId' => '<string>',
'model' => '<string>',
'speed' => 123,
'conversational' => true
],
'google' => [
'voiceId' => '<string>',
'speakingRate' => 123
],
'inworld' => [
'voiceId' => '<string>',
'modelId' => '<string>',
'speakingRate' => 123,
'temperature' => 123,
'applyTextNormalization' => true
],
'respeecher' => [
'voiceId' => '<string>',
'model' => '<string>',
'seed' => 123,
'temperature' => 123,
'topK' => 123,
'topP' => 123,
'minP' => 123,
'presencePenalty' => 123,
'repetitionPenalty' => 123,
'frequencyPenalty' => 123
],
'generic' => [
'url' => '<string>',
'headers' => [
],
'body' => [
],
'responseSampleRate' => 123,
'responseWordsPerMinute' => 123,
'responseMimeType' => '<string>',
'jsonAudioFieldPath' => '<string>'
]
],
'description' => '<string>',
'primaryLanguage' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-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.ultravox.ai/api/voice_preview"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"definition\": {\n \"elevenLabs\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"speed\": 123,\n \"useSpeakerBoost\": true,\n \"style\": 123,\n \"similarityBoost\": 123,\n \"stability\": 123,\n \"pronunciationDictionaries\": [\n {\n \"dictionaryId\": \"<string>\",\n \"versionId\": \"<string>\"\n }\n ],\n \"optimizeStreamingLatency\": 123,\n \"maxSampleRate\": 123,\n \"enableSsmlParsing\": true\n },\n \"cartesia\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"speed\": 123,\n \"emotion\": \"<string>\",\n \"emotions\": [\n \"<string>\"\n ],\n \"generationConfig\": {\n \"volume\": 123,\n \"speed\": 123,\n \"emotion\": \"<string>\",\n \"pronunciationDictId\": \"<string>\"\n }\n },\n \"lmnt\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"speed\": 123,\n \"conversational\": true\n },\n \"google\": {\n \"voiceId\": \"<string>\",\n \"speakingRate\": 123\n },\n \"inworld\": {\n \"voiceId\": \"<string>\",\n \"modelId\": \"<string>\",\n \"speakingRate\": 123,\n \"temperature\": 123,\n \"applyTextNormalization\": true\n },\n \"respeecher\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"seed\": 123,\n \"temperature\": 123,\n \"topK\": 123,\n \"topP\": 123,\n \"minP\": 123,\n \"presencePenalty\": 123,\n \"repetitionPenalty\": 123,\n \"frequencyPenalty\": 123\n },\n \"generic\": {\n \"url\": \"<string>\",\n \"headers\": {},\n \"body\": {},\n \"responseSampleRate\": 123,\n \"responseWordsPerMinute\": 123,\n \"responseMimeType\": \"<string>\",\n \"jsonAudioFieldPath\": \"<string>\"\n }\n },\n \"description\": \"<string>\",\n \"primaryLanguage\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-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.ultravox.ai/api/voice_preview")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"definition\": {\n \"elevenLabs\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"speed\": 123,\n \"useSpeakerBoost\": true,\n \"style\": 123,\n \"similarityBoost\": 123,\n \"stability\": 123,\n \"pronunciationDictionaries\": [\n {\n \"dictionaryId\": \"<string>\",\n \"versionId\": \"<string>\"\n }\n ],\n \"optimizeStreamingLatency\": 123,\n \"maxSampleRate\": 123,\n \"enableSsmlParsing\": true\n },\n \"cartesia\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"speed\": 123,\n \"emotion\": \"<string>\",\n \"emotions\": [\n \"<string>\"\n ],\n \"generationConfig\": {\n \"volume\": 123,\n \"speed\": 123,\n \"emotion\": \"<string>\",\n \"pronunciationDictId\": \"<string>\"\n }\n },\n \"lmnt\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"speed\": 123,\n \"conversational\": true\n },\n \"google\": {\n \"voiceId\": \"<string>\",\n \"speakingRate\": 123\n },\n \"inworld\": {\n \"voiceId\": \"<string>\",\n \"modelId\": \"<string>\",\n \"speakingRate\": 123,\n \"temperature\": 123,\n \"applyTextNormalization\": true\n },\n \"respeecher\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"seed\": 123,\n \"temperature\": 123,\n \"topK\": 123,\n \"topP\": 123,\n \"minP\": 123,\n \"presencePenalty\": 123,\n \"repetitionPenalty\": 123,\n \"frequencyPenalty\": 123\n },\n \"generic\": {\n \"url\": \"<string>\",\n \"headers\": {},\n \"body\": {},\n \"responseSampleRate\": 123,\n \"responseWordsPerMinute\": 123,\n \"responseMimeType\": \"<string>\",\n \"jsonAudioFieldPath\": \"<string>\"\n }\n },\n \"description\": \"<string>\",\n \"primaryLanguage\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ultravox.ai/api/voice_preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"definition\": {\n \"elevenLabs\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"speed\": 123,\n \"useSpeakerBoost\": true,\n \"style\": 123,\n \"similarityBoost\": 123,\n \"stability\": 123,\n \"pronunciationDictionaries\": [\n {\n \"dictionaryId\": \"<string>\",\n \"versionId\": \"<string>\"\n }\n ],\n \"optimizeStreamingLatency\": 123,\n \"maxSampleRate\": 123,\n \"enableSsmlParsing\": true\n },\n \"cartesia\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"speed\": 123,\n \"emotion\": \"<string>\",\n \"emotions\": [\n \"<string>\"\n ],\n \"generationConfig\": {\n \"volume\": 123,\n \"speed\": 123,\n \"emotion\": \"<string>\",\n \"pronunciationDictId\": \"<string>\"\n }\n },\n \"lmnt\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"speed\": 123,\n \"conversational\": true\n },\n \"google\": {\n \"voiceId\": \"<string>\",\n \"speakingRate\": 123\n },\n \"inworld\": {\n \"voiceId\": \"<string>\",\n \"modelId\": \"<string>\",\n \"speakingRate\": 123,\n \"temperature\": 123,\n \"applyTextNormalization\": true\n },\n \"respeecher\": {\n \"voiceId\": \"<string>\",\n \"model\": \"<string>\",\n \"seed\": 123,\n \"temperature\": 123,\n \"topK\": 123,\n \"topP\": 123,\n \"minP\": 123,\n \"presencePenalty\": 123,\n \"repetitionPenalty\": 123,\n \"frequencyPenalty\": 123\n },\n \"generic\": {\n \"url\": \"<string>\",\n \"headers\": {},\n \"body\": {},\n \"responseSampleRate\": 123,\n \"responseWordsPerMinute\": 123,\n \"responseMimeType\": \"<string>\",\n \"jsonAudioFieldPath\": \"<string>\"\n }\n },\n \"description\": \"<string>\",\n \"primaryLanguage\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body"<string>"{}