stable-audio

This documentation is valid for the following list of our models:

  • stable-audio

An advanced audio generation model designed to create high-quality audio tracks from textual prompts.

Setup your API Key

If you don’t have an API key for the AI/ML API yet, feel free to use our Quickstart guide.

API Schemas

post
Body
modelstring · enumRequiredPossible values:
promptstringRequired

The prompt to generate audio.

seconds_startinteger · min: 1 · max: 47Optional

The start point of the audio clip to generate.

seconds_totalinteger · min: 1 · max: 47Optional

The duration of the audio clip to generate.

Default: 30
stepsinteger · min: 1 · max: 1000Optional

The number of steps to denoise the audio.

Default: 100
Responses
200Success
application/json
post
/v2/generate/audio
200Success

Retrieve the generated music sample from the server

After sending a request for music generation, this task is added to the queue. Based on the service's load, the generation can be completed in 30-40 seconds or take a bit more.

get
Authorizations
AuthorizationstringRequired

Bearer key

Query parameters
generation_idstringRequired
Responses
get
/v2/generate/audio
default

Full Example: Generating and Retrieving the Audio From the Server

The code below creates a audio generation task, then automatically polls the server every 10 seconds until it finally receives the video URL.

Response

Listen to the track we generated:

Last updated

Was this helpful?