Sound Effects v2

This guide shows how to generate sound effects using the Sound Effects v2 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": "sound-effects-v2",
    "public": false,
    "parameters": {
      "prompt": "Heavy wooden door creaking open in a large stone hall",
      "duration": 4,
      "prompt_influence": 0.7,
      "loop": false,
      "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
durationnumberDuration of the generated sound effect in seconds. Set to any whole number from 1 to 22. Defaults to 2.
loopbooleanWhether the generated sound effect loops. Defaults to false.
modelstringSpecifies the model used for generation. Set to sound-effects-v2.
promptstringText description of the sound effect to generate. Maximum of 9999 characters.
prompt_influencenumberControls how closely the output follows the prompt. Ranges from 0 to 1. Defaults to 0.7.
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.


Did this page help you?