fal-ai/elevenlabs/text-to-voice/design/eleven-v3
Loading API documentation
Voice Design
The client provides a convenient way to interact with the model API.
npm install --save @fal-ai/clientSet FAL_KEY as an environment variable in your runtime.
export FAL_KEY="YOUR_API_KEY"The client API handles the API submit protocol. It will handle the request status updates and return the result when the request is completed.
import { fal } from "@fal-ai/client";
const result = await fal.subscribe("fal-ai/elevenlabs/text-to-voice/design/eleven-v3", {
input: {
prompt: "A scary old and haggard witch who is sneaky and menacing. She has a croaky, harsh, shrill, high-pitch voice that cackles."
},
logs: true,
onQueueUpdate: (update) => {
if (update.status === "IN_PROGRESS") {
update.logs.map((log) => log.message).forEach(console.log);
}
},
});
console.log(result.data);
console.log(result.requestId);The API uses an API Key for authentication. It is recommended you set the FAL_KEY environment variable in your runtime when possible.
import { fal } from "@fal-ai/client";
fal.config({
credentials: "YOUR_FAL_KEY"
});The client API provides a convenient way to submit requests to the model.
import { fal } from "@fal-ai/client";
const { request_id } = await fal.queue.submit("fal-ai/elevenlabs/text-to-voice/design/eleven-v3", {
input: {
prompt: "A scary old and haggard witch who is sneaky and menacing. She has a croaky, harsh, shrill, high-pitch voice that cackles."
},
webhookUrl: "https://optional.webhook.url/for/results",
});You can fetch the status of a request to check if it is completed or still in progress.
import { fal } from "@fal-ai/client";
const status = await fal.queue.status("fal-ai/elevenlabs/text-to-voice/design/eleven-v3", {
requestId: "764cabcf-b745-4b3e-ae38-1200304cf45b",
logs: true,
});Once the request is completed, you can fetch the result. See the Output Schema for the expected result format.
import { fal } from "@fal-ai/client";
const result = await fal.queue.result("fal-ai/elevenlabs/text-to-voice/design/eleven-v3", {
requestId: "764cabcf-b745-4b3e-ae38-1200304cf45b"
});
console.log(result.data);
console.log(result.requestId);Some attributes in the API accept file URLs as input. Whenever that's the case you can pass your own URL or a Base64 data URI.
You can pass a Base64 data URI as a file input. The API will handle the file decoding for you. Keep in mind that for large files, this alternative although convenient can impact the request performance.
You can also pass your own URLs as long as they are publicly accessible. Be aware that some hosts might block cross-site requests, rate-limit, or consider the request as a bot.
We provide a convenient file storage that allows you to upload files and use them in your requests. You can upload files using the client API and use the returned URL in your requests.
import { fal } from "@fal-ai/client";
const file = new File(["Hello, World!"], "hello.txt", { type: "text/plain" });
const url = await fal.storage.upload(file);Read more about file handling in our file upload guide.
prompt string* requiredDescription to use for the created voice.
text stringThe text that will be voiced by the created voice. If not provided auto_generate_text must be enabled.
enable_safety_checker booleanCheck input content for safety. Disabling requires account authorization. Default value: true
auto_generate_text booleanWhether to automatically generate a text suitable for the voice description. If text is provided, this field must be disabled. Default value: true
loudness floatControls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS. Default value: 0.5
seed integerRandom number that controls the voice generation. Same seed with same inputs produces same voice.
guidance_scale floatControls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale. Default value: 5
audio_url stringReference audio to use for the voice generation.
prompt_strength floatControls the balance of prompt versus reference audio when generating voice samples. 0 means almost no prompt influence, 1 means almost no reference audio influence. Only supported when providing reference audio.
output_format OutputFormatEnumOutput format of the generated audio. Formatted as codec_sample_rate_bitrate. Default value: "mp3_44100_128"
Possible enum values: mp3_22050_32, mp3_44100_32, mp3_44100_64, mp3_44100_96, mp3_44100_128, mp3_44100_192, pcm_8000, pcm_16000, pcm_22050, pcm_24000, pcm_44100, pcm_48000, ulaw_8000, alaw_8000, opus_48000_32, opus_48000_64, opus_48000_96, opus_48000_128, opus_48000_192
sync_mode booleanIf True, the media will be returned as a data URI and the output data won't be available in the request history.
voice_name stringName to use for the saved voice. If omitted, a name is generated automatically.
{
"prompt": "A scary old and haggard witch who is sneaky and menacing. She has a croaky, harsh, shrill, high-pitch voice that cackles.",
"enable_safety_checker": true,
"auto_generate_text": true,
"loudness": 0.5,
"guidance_scale": 5,
"output_format": "mp3_44100_128"
}text string* requiredThe text voiced by the created voice.
A list of audio previews generated with the created voice.
seed integer* requiredRandom seed for reproducibility.
voice_id stringThe ID of the saved voice.
{
"text": "[cackles] Heh heh heh... Well now, what have we here? Lost, little one? Don't you worry your pretty head. I can help you find your way. [short pause] Just a small price to pay, of course. Everything has a price, doesn't it? Come closer, my dear. Let's make a deal. Heh heh heh...",
"previews": [
{
"audio": {
"file_size": 524165,
"content_type": "audio/mpeg",
"file_name": "preview0.mp3",
"url": "https://storage.googleapis.com/falserverless/example_outputs/elevenlabs/text-to-voice/design/preview0.mp3"
},
"duration_seconds": 32.7603125,
"generated_voice_id": "XCVVVs8LsbGm09bualZo",
"media_type": "audio/mpeg"
},
{
"audio": {
"file_size": 537122,
"content_type": "audio/mpeg",
"file_name": "preview1.mp3",
"url": "https://storage.googleapis.com/falserverless/example_outputs/elevenlabs/text-to-voice/design/preview1.mp3"
},
"duration_seconds": 33.570125,
"generated_voice_id": "sQIDgd80L1zcoVctSUeS",
"media_type": "audio/mpeg"
},
{
"audio": {
"file_size": 468995,
"content_type": "audio/mpeg",
"file_name": "preview2.mp3",
"url": "https://storage.googleapis.com/falserverless/example_outputs/elevenlabs/text-to-voice/design/preview2.mp3"
},
"duration_seconds": 29.3121875,
"generated_voice_id": "qWwaGEJvfuaQclJj45Nj",
"media_type": "audio/mpeg"
}
],
"seed": 1352814518,
"voice_id": "2ZagUwA5RiKZmn9KaEe5"
}The generated voice
generated_voice_id string* requiredThe ID of the generated voice
media_type string* requiredThe media type of the generated audio
duration_seconds float* requiredDuration of the generated audio in seconds
language stringThe language of the preview
url string* requiredThe URL where the file can be downloaded from.
content_type stringThe mime type of the file.
file_name stringThe name of the file. It will be auto-generated if not provided.
file_size integerThe size of the file in bytes.