Audio-to-Audio
Stable Audio transforms existing audio samples into new high-quality compositions up to three minutes long at 44.1kHz stereo using text instructions. Discover techniques for sample transformation in our Audio to Audio Guide to maximize creative control. Read more about the model capabilities here.
Try it out
Click Try it to test this endpoint with your API key, or try Stable Audio 2.0 for free at stableaudio.com.
How to use
Please invoke this endpoint with a POST request.
The headers of the request must include an API key in the authorization field. The body of the request must be
multipart/form-data. The accept header should be set to one of the following:
audio/*to receive the audio in the format specified by theoutput_formatparameter.application/jsonto receive the audio encoded as base64 in a JSON response.
The body of the request should include:
prompt- text to generate the audio from. Check our prompt guide for tipsaudio- the audio to use as the starting point for the generation
Notes:
- We do not allow copyrighted content to be uploaded to our platform.
- Maximum request size is 50Mb.
Optional Parameters:
The body may optionally include:
output_format- the format of the output audioseed- the randomness seed to use for the generationsteps- the number of sampling stepsduration- the number of seconds of the generated audiocfg_scale- controls how strictly the diffusion process adheres to the prompt text (only forstable-audio-2)model- the model to use [stable-audio-2,stable-audio-2.5]strength- controls how much influence theaudioparameter has on the output audio
Note: for more details about these parameters please see the request schema below.
Credits
Stable Audio 2.0
By default, 20 credits per successful generation. The number of credits is determined
by the following formula: credits = 17 + 0.06 * steps.
Examples:
- 50 steps = 20 credits [default]
- 100 steps = 23 credits
Stable Audio 2.5
Requests made using the Stable Audio 2.5 model have a flat rate of 8 credits per successful result.
As always, you will not be charged for failed generations.
Authorizations
Your Stability API key, sent as a bearer token in the Authorization header.
Headers
Body
What you wish the output audio to be. A strong, descriptive prompt that clearly defines instruments, moods, styles, and genre will lead to better results.
You can make a prompt as simple or complex as you like. Simple prompts are good for clean output audio. Complex prompts are good for adding texture and depth to the output audio.
Check our prompt guide for tips.
10000Sometimes referred to as denoising, this parameter controls how much influence the
audio parameter has on the generated audio.
A value of 0 would yield audio that is identical to the input.
A value of 1 would be as if you passed in no audio at all.
Minimum value for stable-audio-2.5 is 0.01.
0 <= x <= 1Response
Generation was successful.
The bytes of the generated audio.
The finish-reason and seed will be present as headers.