# Stable Audio 3 API

> Provider: **Stability AI**
> Source: https://www.pixazo.ai/models/stable-audio

High-quality AI music and audio generation from text prompts.

## Stable Audio 3

### Text to Music

## Base URL

```
https://gateway.pixazo.ai/stable-audio-3-small-music-text-to-audio/v1/stable-audio-3-small-music-text-to-audio-request
```

## Authentication

All requests require an API key passed via header.

Header

Type

Required

Description

Ocp-Apim-Subscription-Key

string

Yes

Your API subscription key

## Stable Audio 3 Small Music Text to Audio generate request

## Request Code

HTTP Python JavaScript cURL

```
POST https://gateway.pixazo.ai/stable-audio-3-small-music-text-to-audio/v1/stable-audio-3-small-music-text-to-audio-request
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_API_KEY

{
  "prompt": "Upbeat lo-fi hip hop with mellow piano, warm bassline, and crisp drums",
  "negative_prompt": "",
  "duration": 30,
  "num_inference_steps": 8,
  "guidance_scale": 1,
  "output_format": "mp3",
  "bitrate": "192k",
  "enable_prompt_expansion": false,
  "enable_safety_checker": true,
  "sync_mode": false
}
```

```
import requests

url = "https://gateway.pixazo.ai/stable-audio-3-small-music-text-to-audio/v1/stable-audio-3-small-music-text-to-audio-request"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_API_KEY"
}
data = {
    "prompt": "Upbeat lo-fi hip hop with mellow piano, warm bassline, and crisp drums",
    "negative_prompt": "",
    "duration": 30,
    "num_inference_steps": 8,
    "guidance_scale": 1,
    "output_format": "mp3",
    "bitrate": "192k",
    "enable_prompt_expansion": false,
    "enable_safety_checker": true,
    "sync_mode": false
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
```

```
const url = "https://gateway.pixazo.ai/stable-audio-3-small-music-text-to-audio/v1/stable-audio-3-small-music-text-to-audio-request";

const data = {
  prompt: "Upbeat lo-fi hip hop with mellow piano, warm bassline, and crisp drums",
  negative_prompt: "",
  duration: 30,
  num_inference_steps: 8,
  guidance_scale: 1,
  output_format: "mp3",
  bitrate: "192k",
  enable_prompt_expansion: false,
  enable_safety_checker: true,
  sync_mode: false
};

fetch(url, {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_API_KEY"
  },
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data));
```

```
curl -X POST "https://gateway.pixazo.ai/stable-audio-3-small-music-text-to-audio/v1/stable-audio-3-small-music-text-to-audio-request" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  --data-raw '{
    "prompt": "Upbeat lo-fi hip hop with mellow piano, warm bassline, and crisp drums",
    "negative_prompt": "",
    "duration": 30,
    "num_inference_steps": 8,
    "guidance_scale": 1,
    "output_format": "mp3",
    "bitrate": "192k",
    "enable_prompt_expansion": false,
    "enable_safety_checker": true,
    "sync_mode": false
  }'
```

## Output

```
{
  "request_id": "stable-audio-3-small-music-text-to-audio_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/stable-audio-3-small-music-text-to-audio_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

[Try Now](https://api.pixazo.ai/api-details#api=stable-audio-3-small-music-text-to-audio&operation=stable-audio-3-small-music-text-to-audio-request)

## Webhook (Optional)

Add the `X-Webhook-URL` header to your generate request to receive a POST callback instead of polling.

```
X-Webhook-URL: https://your-server.com/webhook/callback
```

## Request Parameters - Stable Audio 3 Small Music Text to Audio generate request

Parameter

Required

Type

Default

Allowed values / range

Description

prompt

Yes

string

—

—

Text description of the audio to generate. Must be descriptive and specific for best results.

negative\_prompt

No

string

""

—

Qualities to avoid in the output, such as "distorted vocals" or "heavy reverb".

duration

No

float

30

1–120

Output length in seconds. Allowed range: 1 to 120.

num\_inference\_steps

No

integer

8

1–100

Number of sampling steps during generation. Higher values improve quality at the cost of speed.

guidance\_scale

No

float

1

0–25

Classifier-free guidance scale. Controls how closely the output follows the prompt.

output\_format

No

enum

"mp3"

"mp3", "wav", "flac", "ogg", "opus", "m4a", "aac"

Audio file format.

bitrate

No

string

"192k"

—

Audio bitrate. Examples: "192k", "320k", "128k". Higher bitrates improve quality but increase file size.

enable\_prompt\_expansion

No

boolean

false

—

Enables LLM-based prompt enhancement to enrich and expand the input description.

enable\_safety\_checker

No

boolean

true

—

Enables NSFW content filtering. Disabling may allow inappropriate content.

seed

No

integer

—

—

Random seed for reproducible results. Use the same seed with identical parameters to generate identical outputs.

sync\_mode

No

boolean

false

—

If true, returns the audio as a base64-encoded data URI inline in the response. If false, returns a request\_id for asynchronous polling.

## Example Request

```
{
  "prompt": "Upbeat lo-fi hip hop with mellow piano, warm bassline, and crisp drums",
  "negative_prompt": "",
  "duration": 30,
  "num_inference_steps": 8,
  "guidance_scale": 1,
  "output_format": "mp3",
  "bitrate": "192k",
  "enable_prompt_expansion": false,
  "enable_safety_checker": true,
  "sync_mode": false
}
```

## Response

```
{
  "request_id": "stable-audio-3-small-music-text-to-audio_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/stable-audio-3-small-music-text-to-audio_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

## Request Headers

Header

Value

Content-Type

application/json

Cache-Control

no-cache

Ocp-Apim-Subscription-Key

YOUR\_API\_KEY

## Response Handling

Common status codes.

Code

Meaning

202

Accepted — Request queued

400

Bad Request

401

Unauthorized

402

Insufficient Balance

403

Forbidden

429

Too Many Requests

500

Internal Server Error

## Error Responses

Queue system errors and model validation errors.

### Queue System Errors

```
// 402 — Insufficient balance
{
  "error": "Insufficient Balance",
  "message": "Your wallet does not have enough balance."
}
```

```
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'stable-audio-3-small-music-text-to-audio' not found or is disabled"
}
```

### Error via Status/Webhook

```
{
  "request_id": "stable-audio-3-small-music-text-to-audio_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "stable-audio-3-small-music-text-to-audio",
  "error": "Description of the error",
  "output": null
}
```

## Retrieving Results

Poll the universal status endpoint to check progress and retrieve results.

### Endpoint

```
GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY
```

## cURL Example

```
curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/stable-audio-3-small-music-text-to-audio_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
```

## Response (Completed)

```
{
  "request_id": "stable-audio-3-small-music-text-to-audio_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "stable-audio-3-small-music-text-to-audio",
  "error": null,
  "output": {
    "media_url": ["https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/stable-audio-3-small-music-text-to-audio_019dxxxx/output.mp3"],
    "media_type": "audio/mpeg"
  },
  "created_at": "2026-03-31T10:00:00.000Z",
  "updated_at": "2026-03-31T10:00:15.000Z",
  "completed_at": "2026-03-31T10:00:15.000Z"
}
```

## Response Fields

Field

Type

Description

request\_id

string

Unique request identifier

status

string

QUEUED, PROCESSING, COMPLETED, FAILED, or ERROR

model\_id

string

Model that processed the request

error

string|null

Error message if failed

output.media\_url

array

URLs to generated media (R2 CDN)

output.media\_type

string

MIME type of the output

created\_at

string

When request was created

completed\_at

string

When request completed

polling\_url

string

Status URL (initial response only)

## Status Values

Status

Description

QUEUED

Request accepted, waiting to be processed

PROCESSING

Being processed by the model

COMPLETED

Done — output contains the result

FAILED

Failed — check error field

ERROR

System error — not charged

## Status Flow

```
QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR
```

## Typical Workflow

1.  **Send a generate request** to the API endpoint
2.  **Save the `request_id`** from the response
3.  **Poll** every 5-10 seconds: `GET /v2/requests/status/{request_id}`
4.  **When `status` is `"COMPLETED"`**, download from `output.media_url`

**Tip:** Use `X-Webhook-URL` header to get a callback instead of polling.

### Audio to Audio

## Base URL

```
https://gateway.pixazo.ai/stable-audio-3-small-music-audio-to-audio/v1/stable-audio-3-small-music-audio-to-audio-request
```

## Authentication

All requests require an API key passed via header.

Header

Type

Required

Description

Ocp-Apim-Subscription-Key

string

Yes

Your API subscription key

## Stable Audio 3 Small Music Audio to Audio generate request

## Request Code

HTTP Python JavaScript cURL

```
POST https://gateway.pixazo.ai/stable-audio-3-small-music-audio-to-audio/v1/stable-audio-3-small-music-audio-to-audio-request
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_API_KEY

{
  "prompt": "Transform this into a cinematic orchestral arrangement with sweeping strings",
  "audio_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Audio.mp3"
}
```

```
import requests

url = "https://gateway.pixazo.ai/stable-audio-3-small-music-audio-to-audio/v1/stable-audio-3-small-music-audio-to-audio-request"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_API_KEY"
}
data = {
    "prompt": "Transform this into a cinematic orchestral arrangement with sweeping strings",
    "audio_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Audio.mp3"
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
```

```
const url = "https://gateway.pixazo.ai/stable-audio-3-small-music-audio-to-audio/v1/stable-audio-3-small-music-audio-to-audio-request";
const headers = {
  "Content-Type": "application/json",
  "Cache-Control": "no-cache",
  "Ocp-Apim-Subscription-Key": "YOUR_API_KEY"
};
const data = {
  "prompt": "Transform this into a cinematic orchestral arrangement with sweeping strings",
  "audio_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Audio.mp3"
};

fetch(url, {
  method: "POST",
  headers: headers,
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data));
```

```
curl -X POST "https://gateway.pixazo.ai/stable-audio-3-small-music-audio-to-audio/v1/stable-audio-3-small-music-audio-to-audio-request" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  --data-raw '{
    "prompt": "Transform this into a cinematic orchestral arrangement with sweeping strings",
    "audio_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Audio.mp3"
  }'
```

## Output

```
{
  "request_id": "stable-audio-3-small-music-audio-to-audio_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/stable-audio-3-small-music-audio-to-audio_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

[Try Now](https://api.pixazo.ai/api-details#api=stable-audio-3-small-music-audio-to-audio&operation=stable-audio-3-small-music-audio-to-audio-request)

## Webhook (Optional)

Add the `X-Webhook-URL` header to your generate request to receive a POST callback instead of polling.

```
X-Webhook-URL: https://your-server.com/webhook/callback
```

## Request Parameters - Stable Audio 3 Small Music Audio to Audio generate request

Parameter

Required

Type

Default

Allowed values / range

Description

prompt

Yes

string

—

—

Text description guiding how the source audio should be transformed.

audio\_url

Yes

string

—

—

URL of the source audio to transform. Supported formats: mp3, ogg, wav, m4a, aac.

init\_noise\_level

No

float

0.9

0–1

How much noise to add to the source audio (0-1). Lower values keep the output closer to the source; higher values allow more creative deviation.

negative\_prompt

No

string

""

—

Qualities to avoid in the output.

duration

No

float

30

1–120 (seconds)

Output length in seconds (1-120).

num\_inference\_steps

No

integer

8

1–100

Number of sampling steps (1-100).

guidance\_scale

No

float

1

0–25

Classifier-free guidance scale (0-25).

output\_format

No

enum

"mp3"

"mp3", "wav", "flac", "ogg", "opus", "m4a", "aac"

Audio output format. Allowed: mp3, wav, flac, ogg, opus, m4a, aac.

bitrate

No

string

"192k"

—

Audio bitrate for compressed formats (e.g., "128k", "192k", "320k").

enable\_prompt\_expansion

No

boolean

false

—

Enable LLM-based prompt enhancement for improved semantic richness.

enable\_safety\_checker

No

boolean

true

—

Enable NSFW content filter to block inappropriate outputs.

seed

No

integer

—

—

Random seed for reproducibility. If omitted, a random seed is used.

sync\_mode

No

boolean

false

—

If true, returns the audio as a data URI inline in the response instead of a URL.

## Example Request

```
{
  "prompt": "Transform this into a cinematic orchestral arrangement with sweeping strings",
  "audio_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Audio.mp3",
  "init_noise_level": 0.9,
  "negative_prompt": "",
  "duration": 30,
  "num_inference_steps": 8,
  "guidance_scale": 1,
  "output_format": "mp3",
  "bitrate": "192k",
  "enable_prompt_expansion": false,
  "enable_safety_checker": true,
  "sync_mode": false
}
```

## Response

```
{
  "request_id": "stable-audio-3-small-music-audio-to-audio_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/stable-audio-3-small-music-audio-to-audio_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

## Request Headers

Header

Value

Content-Type

application/json

Cache-Control

no-cache

Ocp-Apim-Subscription-Key

YOUR\_API\_KEY

## Response Handling

Common status codes.

Code

Meaning

202

Accepted — Request queued

400

Bad Request

401

Unauthorized

402

Insufficient Balance

403

Forbidden

429

Too Many Requests

500

Internal Server Error

## Error Responses

Queue system errors and model validation errors.

### Queue System Errors

```
// 402 — Insufficient balance
{
  "error": "Insufficient Balance",
  "message": "Your wallet does not have enough balance."
}
```

```
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'stable-audio-3-small-music-audio-to-audio' not found or is disabled"
}
```

### Error via Status/Webhook

```
{
  "request_id": "stable-audio-3-small-music-audio-to-audio_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "stable-audio-3-small-music-audio-to-audio",
  "error": "Description of the error",
  "output": null
}
```

## Retrieving Results

Poll the universal status endpoint to check progress and retrieve results.

### Endpoint

```
GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY
```

## cURL Example

```
curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/stable-audio-3-small-music-audio-to-audio_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
```

## Response (Completed)

```
{
  "request_id": "stable-audio-3-small-music-audio-to-audio_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "stable-audio-3-small-music-audio-to-audio",
  "error": null,
  "output": {
    "media_url": ["https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/stable-audio-3-small-music-audio-to-audio_019dxxxx/output.mp3"],
    "media_type": "audio/mpeg"
  },
  "created_at": "2026-03-31T10:00:00.000Z",
  "updated_at": "2026-03-31T10:00:15.000Z",
  "completed_at": "2026-03-31T10:00:15.000Z"
}
```

## Response Fields

Field

Type

Description

request\_id

string

Unique request identifier

status

string

QUEUED, PROCESSING, COMPLETED, FAILED, or ERROR

model\_id

string

Model that processed the request

error

string|null

Error message if failed

output.media\_url

array

URLs to generated media (R2 CDN)

output.media\_type

string

MIME type of the output

created\_at

string

When request was created

completed\_at

string

When request completed

polling\_url

string

Status URL (initial response only)

## Status Values

Status

Description

QUEUED

Request accepted, waiting to be processed

PROCESSING

Being processed by the model

COMPLETED

Done — output contains the result

FAILED

Failed — check error field

ERROR

System error — not charged

## Status Flow

```
QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR
```

## Typical Workflow

1.  **Send a generate request** to the API endpoint
2.  **Save the `request_id`** from the response
3.  **Poll** every 5-10 seconds: `GET /v2/requests/status/{request_id}`
4.  **When `status` is `"COMPLETED"`**, download from `output.media_url`

**Tip:** Use `X-Webhook-URL` header to get a callback instead of polling.
