Elevenlabs flash v2 Text to Speech
curl --request POST \
--url https://api.myrouter.ai/v3/elevenlabs-tts-flash-v2 \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"seed": 123,
"text": "<string>",
"voice_id": "<string>",
"next_text": "<string>",
"language_code": "<string>",
"output_format": "<string>",
"previous_text": "<string>",
"use_pvc_as_ivc": true,
"voice_settings": {
"speed": 123,
"style": 123,
"stability": 123,
"similarity_boost": 123,
"use_speaker_boost": true
},
"next_request_ids": [
{}
],
"previous_request_ids": [
{}
],
"apply_text_normalization": "<string>",
"apply_language_text_normalization": true,
"pronunciation_dictionary_locators": [
{
"version_id": "<string>",
"pronunciation_dictionary_id": "<string>"
}
]
}
'import requests
url = "https://api.myrouter.ai/v3/elevenlabs-tts-flash-v2"
payload = {
"seed": 123,
"text": "<string>",
"voice_id": "<string>",
"next_text": "<string>",
"language_code": "<string>",
"output_format": "<string>",
"previous_text": "<string>",
"use_pvc_as_ivc": True,
"voice_settings": {
"speed": 123,
"style": 123,
"stability": 123,
"similarity_boost": 123,
"use_speaker_boost": True
},
"next_request_ids": [{}],
"previous_request_ids": [{}],
"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>',
voice_id: '<string>',
next_text: '<string>',
language_code: '<string>',
output_format: '<string>',
previous_text: '<string>',
use_pvc_as_ivc: true,
voice_settings: {
speed: 123,
style: 123,
stability: 123,
similarity_boost: 123,
use_speaker_boost: true
},
next_request_ids: [{}],
previous_request_ids: [{}],
apply_text_normalization: '<string>',
apply_language_text_normalization: true,
pronunciation_dictionary_locators: [{version_id: '<string>', pronunciation_dictionary_id: '<string>'}]
})
};
fetch('https://api.myrouter.ai/v3/elevenlabs-tts-flash-v2', 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.myrouter.ai/v3/elevenlabs-tts-flash-v2",
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>',
'voice_id' => '<string>',
'next_text' => '<string>',
'language_code' => '<string>',
'output_format' => '<string>',
'previous_text' => '<string>',
'use_pvc_as_ivc' => true,
'voice_settings' => [
'speed' => 123,
'style' => 123,
'stability' => 123,
'similarity_boost' => 123,
'use_speaker_boost' => true
],
'next_request_ids' => [
[
]
],
'previous_request_ids' => [
[
]
],
'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.myrouter.ai/v3/elevenlabs-tts-flash-v2"
payload := strings.NewReader("{\n \"seed\": 123,\n \"text\": \"<string>\",\n \"voice_id\": \"<string>\",\n \"next_text\": \"<string>\",\n \"language_code\": \"<string>\",\n \"output_format\": \"<string>\",\n \"previous_text\": \"<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 \"next_request_ids\": [\n {}\n ],\n \"previous_request_ids\": [\n {}\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.myrouter.ai/v3/elevenlabs-tts-flash-v2")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"seed\": 123,\n \"text\": \"<string>\",\n \"voice_id\": \"<string>\",\n \"next_text\": \"<string>\",\n \"language_code\": \"<string>\",\n \"output_format\": \"<string>\",\n \"previous_text\": \"<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 \"next_request_ids\": [\n {}\n ],\n \"previous_request_ids\": [\n {}\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.myrouter.ai/v3/elevenlabs-tts-flash-v2")
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 \"voice_id\": \"<string>\",\n \"next_text\": \"<string>\",\n \"language_code\": \"<string>\",\n \"output_format\": \"<string>\",\n \"previous_text\": \"<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 \"next_request_ids\": [\n {}\n ],\n \"previous_request_ids\": [\n {}\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 flash v2 Text to Speech
POST
/
v3
/
elevenlabs-tts-flash-v2
Elevenlabs flash v2 Text to Speech
curl --request POST \
--url https://api.myrouter.ai/v3/elevenlabs-tts-flash-v2 \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"seed": 123,
"text": "<string>",
"voice_id": "<string>",
"next_text": "<string>",
"language_code": "<string>",
"output_format": "<string>",
"previous_text": "<string>",
"use_pvc_as_ivc": true,
"voice_settings": {
"speed": 123,
"style": 123,
"stability": 123,
"similarity_boost": 123,
"use_speaker_boost": true
},
"next_request_ids": [
{}
],
"previous_request_ids": [
{}
],
"apply_text_normalization": "<string>",
"apply_language_text_normalization": true,
"pronunciation_dictionary_locators": [
{
"version_id": "<string>",
"pronunciation_dictionary_id": "<string>"
}
]
}
'import requests
url = "https://api.myrouter.ai/v3/elevenlabs-tts-flash-v2"
payload = {
"seed": 123,
"text": "<string>",
"voice_id": "<string>",
"next_text": "<string>",
"language_code": "<string>",
"output_format": "<string>",
"previous_text": "<string>",
"use_pvc_as_ivc": True,
"voice_settings": {
"speed": 123,
"style": 123,
"stability": 123,
"similarity_boost": 123,
"use_speaker_boost": True
},
"next_request_ids": [{}],
"previous_request_ids": [{}],
"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>',
voice_id: '<string>',
next_text: '<string>',
language_code: '<string>',
output_format: '<string>',
previous_text: '<string>',
use_pvc_as_ivc: true,
voice_settings: {
speed: 123,
style: 123,
stability: 123,
similarity_boost: 123,
use_speaker_boost: true
},
next_request_ids: [{}],
previous_request_ids: [{}],
apply_text_normalization: '<string>',
apply_language_text_normalization: true,
pronunciation_dictionary_locators: [{version_id: '<string>', pronunciation_dictionary_id: '<string>'}]
})
};
fetch('https://api.myrouter.ai/v3/elevenlabs-tts-flash-v2', 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.myrouter.ai/v3/elevenlabs-tts-flash-v2",
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>',
'voice_id' => '<string>',
'next_text' => '<string>',
'language_code' => '<string>',
'output_format' => '<string>',
'previous_text' => '<string>',
'use_pvc_as_ivc' => true,
'voice_settings' => [
'speed' => 123,
'style' => 123,
'stability' => 123,
'similarity_boost' => 123,
'use_speaker_boost' => true
],
'next_request_ids' => [
[
]
],
'previous_request_ids' => [
[
]
],
'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.myrouter.ai/v3/elevenlabs-tts-flash-v2"
payload := strings.NewReader("{\n \"seed\": 123,\n \"text\": \"<string>\",\n \"voice_id\": \"<string>\",\n \"next_text\": \"<string>\",\n \"language_code\": \"<string>\",\n \"output_format\": \"<string>\",\n \"previous_text\": \"<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 \"next_request_ids\": [\n {}\n ],\n \"previous_request_ids\": [\n {}\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.myrouter.ai/v3/elevenlabs-tts-flash-v2")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"seed\": 123,\n \"text\": \"<string>\",\n \"voice_id\": \"<string>\",\n \"next_text\": \"<string>\",\n \"language_code\": \"<string>\",\n \"output_format\": \"<string>\",\n \"previous_text\": \"<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 \"next_request_ids\": [\n {}\n ],\n \"previous_request_ids\": [\n {}\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.myrouter.ai/v3/elevenlabs-tts-flash-v2")
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 \"voice_id\": \"<string>\",\n \"next_text\": \"<string>\",\n \"language_code\": \"<string>\",\n \"output_format\": \"<string>\",\n \"previous_text\": \"<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 \"next_request_ids\": [\n {}\n ],\n \"previous_request_ids\": [\n {}\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_bodyConverts text to speech using your chosen voice and returns audio.
Request Headers
string
required
Enum:
application/jsonstring
required
Bearer authentication format: Bearer {{API Key}}.
Request Body
integer
If specified, the system will attempt to sample deterministically. Repeated requests with the same seed and parameters should return the same result, but full determinism is not guaranteed.Range: [0, 4294967295]
string
required
The text to convert to speech.
string
required
The voice ID to use.
string
The text that comes after the current request text. Used to improve speech continuity when concatenating multiple generations.
string
Language code (ISO 639-1) used for the model and text normalization. An error will be returned if the model does not support this language code.
string
default:"mp3_44100_128"
Output format for the generated audio. Format is codec_sample_rate_bitrate. The 192kbps bitrate for MP3 requires a Creator or higher account; the 44.1kHz sample rate for PCM requires a Pro or higher account.Possible 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_192string
The text that comes before the current request text. Used to improve speech continuity when concatenating multiple generations.
boolean
default:false
If true, uses the IVC version of the voice instead of the PVC version. This is a temporary workaround for higher latency with 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, values above 1.0 speed it up.
number
default:0
Controls the exaggeration of the voice style. Attempts to amplify the style of the original speaker. Setting to a non-zero value consumes more compute resources and may increase latency.
number
Controls the stability of voice generation and the randomness between each generation. Lower values produce a wider emotional range; higher values may result in a more monotone voice.
number
Controls how closely the AI attempts to replicate the original voice.
boolean
default:true
Enhances similarity to the original speaker. Requires slightly more compute and increases latency.
array
List of request_ids for subsequent samples. Used to maintain speech continuity when regenerating samples. Up to 3 request_ids can be provided.Array length: 0 - 3
array
List of request_ids for previously generated samples before the current generation. Can be used to improve speech continuity. Up to 3 request_ids can be provided.Array length: 0 - 3
string
default:"auto"
Controls text normalization. ‘auto’ lets the system decide, ‘on’ always normalizes, ‘off’ skips normalization.Possible values:
auto, on, offboolean
default:false
Controls language-specific text normalization for certain supported languages to achieve more natural pronunciation. Warning: may significantly increase latency. Currently only supports Japanese.
array
List of pronunciation dictionary locators (id, version_id) to apply to the text. Applied in order. Up to 3 locators per request.Array length: 0 - 3
Response
The generated audio file Format:binary