Skip to main content

SFX Endpoint

Overview

The sfx endpoint allows you to generate sound effects (SFX) using the stable-audio-open model. It takes user input in the form of a text prompt to conditionally generate audio effects.

Request

--request POST 'https://modelslab.com/api/v1/enterprise/voice/sfx' \

Make a POST request to https://modelslab.com/api/v1/enterprise/voice/sfx endpoint and pass the required parameters as a request body.

caution

Make sure you add your s3 details for voice_cloning server, so you can receive image generated in your bucket. Images generated without s3 details being added will be delete after 24 hours

Body Attributes

ParameterDescriptionValues
keyYour API Key used for request authorizationstring
promptA descriptive prompt that conditions the audio generation, specifying the type of sound effect desired.string

Example

Body

Body
{
"key":"",
"prompt":"Thunderstorm with rain",
"temp": false,
"webhook": null,
"track_id": null
}

Request

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
"key":"",
"prompt":"Thunderstorm with rain",
"temp": false,
"webhook": null,
"track_id": null
});

var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};

fetch("https://modelslab.com/api/v1/enterprise/voice/sfx", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));

Response

{
{
"eta": 5,
"fileId": "8b8f9044-bb13-4d2c-bc42-db427caf182d.wav",
"links": [
"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/generations/8b8f9044-bb13-4d2c-bc42-db427caf182d.wav"
],
"message": "Request has been queued",
"meta": {
"filename": "8b8f9044-bb13-4d2c-bc42-db427caf182d.wav",
"prompt": "man laughing",
"temp": "no"
},
"proxy_links": [
"https://cdn2.stablediffusionapi.com/generations/8b8f9044-bb13-4d2c-bc42-db427caf182d.wav"
],
"seconds": null,
"status": "queued",
"taskId": "a3525188-a894-47ea-9946-1e5a8f2c4abb"
}
}