stable-audio

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

  • stable-audio

Model Overview

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
Authorizations
Body
modelundefined · enumRequiredPossible values:
promptstringRequired
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
default
application/json
post
POST /v2/generate/audio HTTP/1.1
Host: api.aimlapi.com
Authorization: Bearer <YOUR_AIMLAPI_KEY>
Content-Type: application/json
Accept: */*
Content-Length: 89

{
  "model": "stable-audio",
  "prompt": "text",
  "seconds_start": 1,
  "seconds_total": 30,
  "steps": 100
}
default
{
  "id": "text",
  "status": "queued"
}

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 50-60 seconds or take a bit more.

get
Authorizations
Query parameters
generation_idstringRequired
Responses
default
application/json
get
GET /v2/generate/audio HTTP/1.1
Host: api.aimlapi.com
Authorization: Bearer <YOUR_AIMLAPI_KEY>
Accept: */*
default
{
  "audio_file": {
    "url": "https://example.com"
  },
  "id": "text",
  "status": "queued",
  "error": null
}

Last updated

Was this helpful?