POST
/
v1
/
sound-generation
curl --request POST \
  --url https://api.elevenlabs.io/v1/sound-generation \
  --header 'Content-Type: application/json' \
  --data '{
  "text": "<string>",
  "duration_seconds": 123,
  "prompt_influence": 123
}'
This response does not have an example.

Pricing

The API is charged at 100 characters per generation with automatic duration or 25 characters per second with set duration.

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
text
string
required

The text that will get converted into a sound effect.

duration_seconds
number

The duration of the sound which will be generated in seconds. Must be at least 0.5 and at most 22. If set to None we will guess the optimal duration using the prompt. Defaults to None.

prompt_influence
number
default: 0.3

A higher prompt influence makes your generation follow the prompt more closely while also making generations less variable. Must be a value between 0 and 1. Defaults to 0.3.

Response

200 - audio/mpeg

The response is of type file.