Eleven v4

This guide shows how to generate speech using the Eleven v4 model via the Leonardo.AI REST API.

Sample Request

curl --request POST \
     --url https://cloud.leonardo.ai/api/rest/v2/generations \
     --header 'accept: application/json' \
     --header 'authorization: Bearer <YOUR_API_KEY>' \
     --header 'content-type: application/json' \
     --data '
{
    "model": "elevenlabs/eleven-v4",
    "public": false,
    "parameters": {
      "prompt": "[whispers] Welcome back, traveller... The city gates close at sundown. [excited] So we must NOT waste any time!",
      "voice_id": "JBFqnCBsd6RMkjVDRZzb",
      "language_code": "en",
      "prompt_influence": 0.5,
      "quantity": 1
    }
}
'

API Request Endpoint, Headers, Parameters

Endpoint

https://cloud.leonardo.ai/api/rest/v2/generations

Headers

--header "accept: application/json" \
--header "authorization: Bearer <YOUR_API_KEY>" \
--header "content-type: application/json"

Body Parameters

ParameterTypeDefinition
language_codestringLanguage of the script as an ISO 639-1 code, or an ISO 639-3 code for a language without one. Omit to detect the language from the script.
modelstringSpecifies the model used for generation. Set to elevenlabs/eleven-v4.
promptstringThe script to speak. Minimum of 1 and maximum of 2000 characters. The model speaks every word aloud, so write only the words to say — no stage directions, speaker labels, or descriptions of the voice. To direct delivery, place an audio tag in square brackets before or after the words it changes, e.g. [whispers], [sighs], [laughs], [excited], [sarcastic]. Use ellipses (...) for pauses and capital letters for emphasis. SSML is not supported.
prompt_influencenumberA lower value makes the voice respond more to audio tags. Ranges from 0 to 1. Defaults to 0.5.
publicbooleanControls whether the generated audio is public (true) or private (false).
quantitynumberThe number of outputs to generate. Set to 1, 2, 3, or 4. Defaults to 1.
voice_idstringID of the preset voice used for speech. Choose a voice that suits the delivery, as an audio tag cannot make a calm voice shout. See List of Voice IDs below. Defaults to JBFqnCBsd6RMkjVDRZzb (George).

List of Voice IDs

The API accepts the following voice_id values:

Voice NameVoice ID
AdampNInz6obpgDQGcFmaJgB
AliceXb7hH8MSUJpSbSDYk0k2
Bellahpp4J3VqNfWAUOO0d1Us
BillpqHfZKP75CvOlQylNhV4
BriannPczCjzI2devNBz1zQrb
CallumN2lVS1w4EtoT3dr4eOWO
CharlieIKne3meq5aSn9XLyUdCD
ChrisiP95p4xoKVk53GoZ742B
DanielonwK4e9ZLuTAKqWW03F9
EriccjVigY5qzO86Huf0OWal
GeorgeJBFqnCBsd6RMkjVDRZzb
HarrySOYHLrjzK2X1ezoPC6cr
JessicacgSgspJ2msm6clMCkdW9
LauraFGY2WhTYpPnrIDTdsKH5
LiamTX3LPaxmHKxFdv7VOQHJ
LilypFZP5JQG7iQjIQuC4Bku
MatildaXrExE9yKIg1WjnnlVkGX
RiverSAz9YHcvj6GT2YYXdXww
RogerCwhRBWXzGAHq8TQ4Fs17
SarahEXAVITQu4vr4xnSDxMaL
WillbIHbv24MWmeRgasZH58o

Did this page help you?