Design a voice

Design a voice via a prompt. This method returns a list of voice previews. Each preview has a generated_voice_id and a sample of the voice as base64 encoded mp3 audio. To create a voice use the generated_voice_id of the preferred preview with the /v1/text-to-voice endpoint.

Headers

xi-api-keystringRequired

Query parameters

output_formatenumOptionalDefaults to mp3_44100_192

Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.

Request

This endpoint expects an object.
voice_descriptionstringRequired>=20 characters<=1000 characters
Description to use for the created voice.
model_idenumOptionalDefaults to eleven_multilingual_ttv_v2

Model to use for the voice generation. Possible values: eleven_multilingual_ttv_v2, eleven_ttv_v3.

Allowed values:
textstring or nullOptional>=100 characters<=1000 characters
Text to generate, text length has to be between 100 and 1000.
auto_generate_textbooleanOptionalDefaults to false
Whether to automatically generate a text suitable for the voice description.
loudnessdoubleOptional>=-1<=1Defaults to 0.5

Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS.

seedinteger or nullOptional>=0<=2147483647
Random number that controls the voice generation. Same seed with same inputs produces same voice.
guidance_scaledoubleOptional>=0<=100Defaults to 5
Controls 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.
qualitydouble or nullOptional>=-1<=1
Higher quality results in better voice output but less variety.
reference_audio_base64string or nullOptional

Reference audio to use for the voice generation. The audio should be base64 encoded. Only supported when using the eleven_ttv_v3 model.

prompt_strengthdouble or nullOptional>=0<=1

Controls 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 using the eleven_ttv_v3 model and providing reference audio.

Response

Successful Response
previewslist of objects
The previews of the generated voices.
textstring
The text used to preview the voices.

Errors