ElevenLabs Text-to-Speech V3
curl --request POST \
--url https://api.highwayapi.ai/v3/elevenlabs-tts-v3 \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"seed": 123,
"text": "<string>",
"stream": true,
"voice_id": "<string>",
"language_code": "<string>",
"output_format": "<string>",
"use_pvc_as_ivc": true,
"voice_settings": {
"speed": 123,
"style": 123,
"stability": 123,
"similarity_boost": 123,
"use_speaker_boost": true
},
"apply_text_normalization": "<string>",
"apply_language_text_normalization": true,
"pronunciation_dictionary_locators": [
{
"version_id": "<string>",
"pronunciation_dictionary_id": "<string>"
}
]
}
'import requests
url = "https://api.highwayapi.ai/v3/elevenlabs-tts-v3"
payload = {
"seed": 123,
"text": "<string>",
"stream": True,
"voice_id": "<string>",
"language_code": "<string>",
"output_format": "<string>",
"use_pvc_as_ivc": True,
"voice_settings": {
"speed": 123,
"style": 123,
"stability": 123,
"similarity_boost": 123,
"use_speaker_boost": True
},
"apply_text_normalization": "<string>",
"apply_language_text_normalization": True,
"pronunciation_dictionary_locators": [
{
"version_id": "<string>",
"pronunciation_dictionary_id": "<string>"
}
]
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
seed: 123,
text: '<string>',
stream: true,
voice_id: '<string>',
language_code: '<string>',
output_format: '<string>',
use_pvc_as_ivc: true,
voice_settings: {
speed: 123,
style: 123,
stability: 123,
similarity_boost: 123,
use_speaker_boost: true
},
apply_text_normalization: '<string>',
apply_language_text_normalization: true,
pronunciation_dictionary_locators: [{version_id: '<string>', pronunciation_dictionary_id: '<string>'}]
})
};
fetch('https://api.highwayapi.ai/v3/elevenlabs-tts-v3', 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.highwayapi.ai/v3/elevenlabs-tts-v3",
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([
'seed' => 123,
'text' => '<string>',
'stream' => true,
'voice_id' => '<string>',
'language_code' => '<string>',
'output_format' => '<string>',
'use_pvc_as_ivc' => true,
'voice_settings' => [
'speed' => 123,
'style' => 123,
'stability' => 123,
'similarity_boost' => 123,
'use_speaker_boost' => true
],
'apply_text_normalization' => '<string>',
'apply_language_text_normalization' => true,
'pronunciation_dictionary_locators' => [
[
'version_id' => '<string>',
'pronunciation_dictionary_id' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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.highwayapi.ai/v3/elevenlabs-tts-v3"
payload := strings.NewReader("{\n \"seed\": 123,\n \"text\": \"<string>\",\n \"stream\": true,\n \"voice_id\": \"<string>\",\n \"language_code\": \"<string>\",\n \"output_format\": \"<string>\",\n \"use_pvc_as_ivc\": true,\n \"voice_settings\": {\n \"speed\": 123,\n \"style\": 123,\n \"stability\": 123,\n \"similarity_boost\": 123,\n \"use_speaker_boost\": true\n },\n \"apply_text_normalization\": \"<string>\",\n \"apply_language_text_normalization\": true,\n \"pronunciation_dictionary_locators\": [\n {\n \"version_id\": \"<string>\",\n \"pronunciation_dictionary_id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
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.highwayapi.ai/v3/elevenlabs-tts-v3")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"seed\": 123,\n \"text\": \"<string>\",\n \"stream\": true,\n \"voice_id\": \"<string>\",\n \"language_code\": \"<string>\",\n \"output_format\": \"<string>\",\n \"use_pvc_as_ivc\": true,\n \"voice_settings\": {\n \"speed\": 123,\n \"style\": 123,\n \"stability\": 123,\n \"similarity_boost\": 123,\n \"use_speaker_boost\": true\n },\n \"apply_text_normalization\": \"<string>\",\n \"apply_language_text_normalization\": true,\n \"pronunciation_dictionary_locators\": [\n {\n \"version_id\": \"<string>\",\n \"pronunciation_dictionary_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/elevenlabs-tts-v3")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"seed\": 123,\n \"text\": \"<string>\",\n \"stream\": true,\n \"voice_id\": \"<string>\",\n \"language_code\": \"<string>\",\n \"output_format\": \"<string>\",\n \"use_pvc_as_ivc\": true,\n \"voice_settings\": {\n \"speed\": 123,\n \"style\": 123,\n \"stability\": 123,\n \"similarity_boost\": 123,\n \"use_speaker_boost\": true\n },\n \"apply_text_normalization\": \"<string>\",\n \"apply_language_text_normalization\": true,\n \"pronunciation_dictionary_locators\": [\n {\n \"version_id\": \"<string>\",\n \"pronunciation_dictionary_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyAudio
ElevenLabs Text-to-Speech V3
POST
/
v3
/
elevenlabs-tts-v3
ElevenLabs Text-to-Speech V3
curl --request POST \
--url https://api.highwayapi.ai/v3/elevenlabs-tts-v3 \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"seed": 123,
"text": "<string>",
"stream": true,
"voice_id": "<string>",
"language_code": "<string>",
"output_format": "<string>",
"use_pvc_as_ivc": true,
"voice_settings": {
"speed": 123,
"style": 123,
"stability": 123,
"similarity_boost": 123,
"use_speaker_boost": true
},
"apply_text_normalization": "<string>",
"apply_language_text_normalization": true,
"pronunciation_dictionary_locators": [
{
"version_id": "<string>",
"pronunciation_dictionary_id": "<string>"
}
]
}
'import requests
url = "https://api.highwayapi.ai/v3/elevenlabs-tts-v3"
payload = {
"seed": 123,
"text": "<string>",
"stream": True,
"voice_id": "<string>",
"language_code": "<string>",
"output_format": "<string>",
"use_pvc_as_ivc": True,
"voice_settings": {
"speed": 123,
"style": 123,
"stability": 123,
"similarity_boost": 123,
"use_speaker_boost": True
},
"apply_text_normalization": "<string>",
"apply_language_text_normalization": True,
"pronunciation_dictionary_locators": [
{
"version_id": "<string>",
"pronunciation_dictionary_id": "<string>"
}
]
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
seed: 123,
text: '<string>',
stream: true,
voice_id: '<string>',
language_code: '<string>',
output_format: '<string>',
use_pvc_as_ivc: true,
voice_settings: {
speed: 123,
style: 123,
stability: 123,
similarity_boost: 123,
use_speaker_boost: true
},
apply_text_normalization: '<string>',
apply_language_text_normalization: true,
pronunciation_dictionary_locators: [{version_id: '<string>', pronunciation_dictionary_id: '<string>'}]
})
};
fetch('https://api.highwayapi.ai/v3/elevenlabs-tts-v3', 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.highwayapi.ai/v3/elevenlabs-tts-v3",
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([
'seed' => 123,
'text' => '<string>',
'stream' => true,
'voice_id' => '<string>',
'language_code' => '<string>',
'output_format' => '<string>',
'use_pvc_as_ivc' => true,
'voice_settings' => [
'speed' => 123,
'style' => 123,
'stability' => 123,
'similarity_boost' => 123,
'use_speaker_boost' => true
],
'apply_text_normalization' => '<string>',
'apply_language_text_normalization' => true,
'pronunciation_dictionary_locators' => [
[
'version_id' => '<string>',
'pronunciation_dictionary_id' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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.highwayapi.ai/v3/elevenlabs-tts-v3"
payload := strings.NewReader("{\n \"seed\": 123,\n \"text\": \"<string>\",\n \"stream\": true,\n \"voice_id\": \"<string>\",\n \"language_code\": \"<string>\",\n \"output_format\": \"<string>\",\n \"use_pvc_as_ivc\": true,\n \"voice_settings\": {\n \"speed\": 123,\n \"style\": 123,\n \"stability\": 123,\n \"similarity_boost\": 123,\n \"use_speaker_boost\": true\n },\n \"apply_text_normalization\": \"<string>\",\n \"apply_language_text_normalization\": true,\n \"pronunciation_dictionary_locators\": [\n {\n \"version_id\": \"<string>\",\n \"pronunciation_dictionary_id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
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.highwayapi.ai/v3/elevenlabs-tts-v3")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"seed\": 123,\n \"text\": \"<string>\",\n \"stream\": true,\n \"voice_id\": \"<string>\",\n \"language_code\": \"<string>\",\n \"output_format\": \"<string>\",\n \"use_pvc_as_ivc\": true,\n \"voice_settings\": {\n \"speed\": 123,\n \"style\": 123,\n \"stability\": 123,\n \"similarity_boost\": 123,\n \"use_speaker_boost\": true\n },\n \"apply_text_normalization\": \"<string>\",\n \"apply_language_text_normalization\": true,\n \"pronunciation_dictionary_locators\": [\n {\n \"version_id\": \"<string>\",\n \"pronunciation_dictionary_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/elevenlabs-tts-v3")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"seed\": 123,\n \"text\": \"<string>\",\n \"stream\": true,\n \"voice_id\": \"<string>\",\n \"language_code\": \"<string>\",\n \"output_format\": \"<string>\",\n \"use_pvc_as_ivc\": true,\n \"voice_settings\": {\n \"speed\": 123,\n \"style\": 123,\n \"stability\": 123,\n \"similarity_boost\": 123,\n \"use_speaker_boost\": true\n },\n \"apply_text_normalization\": \"<string>\",\n \"apply_language_text_normalization\": true,\n \"pronunciation_dictionary_locators\": [\n {\n \"version_id\": \"<string>\",\n \"pronunciation_dictionary_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyConvert text into speech using the voice of your choice and return audio.
Request Headers
string
required
Enum value:
application/jsonstring
required
Bearer authentication format: Bearer {{API Key}}.
Request Body
integer
If specified, the system will try to sample deterministically. Repeated requests with the same seed and parameters should return the same result, but complete determinism is not guaranteed.Value range: [0, 4294967295]
string
required
The text to convert into speech.
boolean
Whether to enable Stream mode.
string
required
The voice ID to use.
string
The language code (ISO 639-1) used for the model and text normalization. If the model does not support this language code, an error will be returned.
string
default:"mp3_44100_128"
The output format of the generated audio. The format is codec_sample_rate_bitrate. The 192 kbps bitrate for MP3 requires a Creator account or above, and the 44.1 kHz sample rate for PCM requires a Pro account or above.Available values:
mp3_22050_32, mp3_24000_48, mp3_44100_32, mp3_44100_64, mp3_44100_96, mp3_44100_128, mp3_44100_192, pcm_8000, pcm_16000, pcm_22050, pcm_24000, pcm_32000, pcm_44100, pcm_48000, ulaw_8000, alaw_8000, opus_48000_32, opus_48000_64, opus_48000_96, opus_48000_128, opus_48000_192boolean
default:false
If true, uses the IVC version of the voice instead of the PVC version. This is a temporary workaround for the higher latency of the PVC version.
object
Hide properties
Hide properties
number
default:1
Adjusts the speed of the voice. 1.0 is the default speed; values below 1.0 slow down the speech, while values above 1.0 speed it up.
number
default:0
Determines the degree of exaggeration in the voice style. Attempts to amplify the original speaker’s style. When set to a non-zero value, it consumes more compute resources and may increase latency.
number
Determines the stability of speech generation and the randomness between each generation. Lower values produce a wider emotional range, while higher values may make the voice sound monotonous.
number
Determines how closely the AI attempts to replicate the original voice.
boolean
default:true
Enhances similarity to the original speaker. Requires a slightly higher computational load and increases latency.
string
default:"auto"
Controls text normalization. ‘auto’ lets the system decide, ‘on’ always normalizes, and ‘off’ skips normalization.Available values:
auto, on, offboolean
default:false
Controls language-specific text normalization for certain supported languages to achieve more natural pronunciation. Warning: this may significantly increase latency. Currently only Japanese is supported.
object[]
A list of pronunciation dictionary locators (id, version_id) to apply to the text. They take effect in order. Each request can have up to 3 locators.Array length: 0 - 3
Response Information
Generated audio file Format:binary⌘I