POST
/
v1
/
voice-generation
/
generate-voice
from elevenlabs import ElevenLabs

client = ElevenLabs(
    api_key="YOUR_API_KEY",
)
client.voice_generation.generate(
    gender="female",
    accent="american",
    age="middle_aged",
    accent_strength=2.0,
    text="It sure does, Jackie… My mama always said: “In Carolina, the air's so thick you can wear it!”",
)
This response does not have an example.

This API is deprecated. Please use the new Text to Voice API.

Headers

xi-api-key
string

Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.

Body

application/json
gender
enum<string>
required

Category code corresponding to the gender of the generated voice. Possible values: female, male.

Available options:
female,
male
accent
string
required

Category code corresponding to the accent of the generated voice. Possible values: british, american, african, australian, indian.

age
enum<string>
required

Category code corresponding to the age of the generated voice. Possible values: young, middle_aged, old.

Available options:
young,
middle_aged,
old
accent_strength
number
required

The strength of the accent of the generated voice. Has to be between 0.3 and 2.0.

text
string
required

Text to generate, text length has to be between 100 and 1000.

Required string length: 100 - 1000
Example:

"Every act of kindness, no matter how small, carries value and can make a difference, as no gesture of goodwill is ever wasted."

Response

200
audio/mpeg
Successful Response

The response is of type file.