Skip to main content
POST
cURL

Authorizations

Authorization
string
header
required

Your Stability API key, sent as a bearer token in the Authorization header.

Headers

accept
enum<string>
default:audio/*

Specify audio/* to receive the bytes of the audio directly. Otherwise specify application/json to receive the audio as base64 encoded JSON.

Available options:
audio/*,
application/json
stability-client-id
string

The name of your application, used to help us communicate app-specific debugging or moderation issues to you.

Maximum string length: 256
Example:

"my-awesome-app"

stability-client-user-id
string

A unique identifier for your end user. Used to help us communicate user-specific debugging or moderation issues to you. Feel free to obfuscate this value to protect user privacy.

Maximum string length: 256
Example:

"DiscordUser#9999"

stability-client-version
string

The version of your application, used to help us communicate version-specific debugging or moderation issues to you.

Maximum string length: 256
Example:

"1.2.1"

Body

multipart/form-data
prompt
string
required

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.

Maximum string length: 10000
audio
file
required

The audio to be use as the starting point for the generation.

Supported Formats:

  • mp3
  • wav

Validation Rule:

  • Audio must be between 6 and 190 seconds long
duration
number
default:190

Controls the duration in seconds of the generated audio.

Required range: 1 <= x <= 190
seed
number
default:0

A specific value that is used to guide the 'randomness' of the generation. (Omit this parameter or pass 0 to use a random seed.)

Required range: 0 <= x <= 4294967294
steps
integer
default:8

Controls the number of sampling steps.

Required range: 4 <= x <= 8
output_format
enum<string>
default:mp3

Dictates the content-type of the generated audio.

Available options:
mp3,
wav
mask_start
number
default:30
Required range: 0 <= x <= 190
mask_end
number
default:190
Required range: 0 <= x <= 190

Response

Generation was successful.

The bytes of the generated audio.

The finish-reason and seed will be present as headers.