Stability AI
Stable Audio 3 Medium
stable-audio-3-medium/audio-outpainting
Stable Audio 3 Medium is an audio generation model from Stability AI, offering three tasks on HiAPI: generating audio from scratch based on a text description, with a default of 30 seconds and a maximum of 380 seconds; redoing a specified time segment within existing audio; and extending new content at the beginning or end of audio. Output supports 7 formats including MP3, WAV, and FLAC, and supports fixed random seeds for reproducing results, making it suitable for scenarios such as short video soundtracks, game and ambient audio, podcast packaging, and sound effect drafts.
Try stable-audio-3-medium/audio-outpainting
Input
Showcases
View all showcasesOutput
Pricing
stable-audio-3-medium/audio-outpainting $0.0638 per audio
Overview
Stable Audio 3 Medium's audio continuation capability generates new content extending an existing audio clip either forward or backward. You can add only a beginning, only an ending, or new content at both ends, returning a single complete audio track that includes both the original audio and the newly added parts. It is ideal for padding out the end of a video, adding an intro to loop material, or continuing with new phrases after an existing soundtrack.
Key Highlights
- Specify seconds separately for each end — extend_seconds_before and extend_seconds_after each set the added duration, both defaulting to 0.
- The original audio is preserved in the output — the newly added parts and the original recording are joined directly into one audio track, with no manual splicing needed.
- Continuation content is guided by the prompt — prompt describes the rhythm, instruments, and atmosphere the added parts should continue, keeping the style consistent at the seams.
- Output format and bitrate are adjustable — consistent with text-to-audio, 7 containers such as mp3, wav, and flac are supported, and compressed formats allow specifying a bitrate.
Capability Details
- Ending only: set extend_seconds_before to 0 and extend_seconds_after to the number of seconds to add; for example, continuing 4 seconds after an 8-second audio returns a 12-second output.
- Beginning only: set extend_seconds_after to 0 and fill in only extend_seconds_before; the new content is generated before the original audio.
- Add at both ends simultaneously: give values to both parameters, and the model generates the specified duration before and after respectively; the total output duration equals the original duration plus the sum of both added segments.
- Description and avoidance: prompt states the musical characteristics the added parts should continue; negative_prompt describes sounds to avoid, defaulting to empty; guidance_scale defaults to 1 and takes effect only on base (non-distilled) checkpoints.
- Output and steps: output_format defaults to mp3, with wav, flac, ogg, opus, m4a, and aac available; bitrate defaults to 192k and is ignored for lossless formats; num_inference_steps defaults to 8 and can be set from 1 to 100.
Use Cases
- Padding out video endings — when the soundtrack is a few seconds shorter than the visuals, continue it to fill the gap and avoid an abrupt cut-off.
- Adding an intro to loop material — generate a transitional prelude for a loop section for a natural entry.
- Phrase extension experiments — continue with new phrases after an existing clip to quickly explore arrangement directions.
- Adding a tail to audio content — append a fading ambient tail to the end of a podcast or course recording for a more complete finish.
Limitations and Selection Advice
audio_url and prompt are required, and prompt can be up to 5000 characters; extend_seconds_before and extend_seconds_after default to 0, each with an upper limit of 380 seconds, and when both are 0 no new content is produced. The total output duration equals the original audio duration plus the sum of both added segments, so reserve headroom when downstream systems have length limits. The added parts continue temporally from the original audio; it is recommended to audition from a few seconds before the original ending to check whether the transition sounds natural. To modify a short segment in the middle of a recording, use "Local Repair"; when there is no source audio, use "Text-to-Audio".
What's new
View changelog →- New model stable-audio-3-medium text-to-audio model now available
- New model stable-audio-3-medium/audio-inpainting is now available
- New model New model available: stable-audio-3-medium/audio-outpainting
Frequently asked questions
View all FAQs →-
How long an audio clip can be generated at once?
duration controls the length, ranging from 1 to 380 seconds (about 6 minutes 20 seconds), with a default of 30 seconds. For longer works, it is recommended to generate them segment by segment, then use audio continuation to connect the segments.
-
What is the maximum length of a prompt?
The prompt is required, and the platform's input limit per request is 5000 characters. Clearly specifying the instruments, rhythm, mood, and use case is more likely to produce the expected result than piling on adjectives; when the prompt is very short, you can enable enable_prompt_expansion to let the model expand it first.
-
How should prompts be organized when generating music?
Write in the order of "instruments and timbre, rhythm and groove, emotion and dynamics, scene and texture", and state whether vocals are wanted. Put unwanted elements in negative_prompt, for example noise, distortion, abrupt silence.
-
How can I repair only a segment of the audio?
Use mask_start_seconds and mask_end_seconds to specify the start and end times in seconds. The end time must be later than the start time and cannot exceed the duration of the source audio. For example, in an 8-second audio clip, setting the start point to 2 and the end point to 4 will repair seconds 2 through 4.
Create a generation task
https://api.hiapi.ai/v1/tasks Headers
AuthorizationstringRequiredAccount API key. Required on every request. Example: Bearer YOUR_HIAPI_API_KEY. Get your API key
Content-TypestringOptionalThe request body is always parsed as JSON; when sent, only application/json (optionally with charset) is accepted — any other value returns 415. Example: application/json.
Idempotency-KeystringOptionalIdempotency key, up to 255 bytes. Retries with the same key from the same account create the task only once; replays return the original taskId.
On network timeouts or client retries, the same key creates the task only once — no double charges (scope: the API key's account). Use a business-unique identifier as the key (e.g. "order-42"); replays return the original taskId, and keys expire 24 hours after the first request. See the Unified Async API overview for the full scenario matrix.
Body
modelstringRequiredCurrent fixed value: stable-audio-3-medium/audio-outpainting
routestringOptionalCurrent fixed value: default
inputobjectRequired
Business parameters for stable-audio-3-medium/audio-outpainting and route default — see the parameter table below.
seedintegerOptionalRandom seed, used to reproduce generation results; if not provided, a random seed is used.
promptstringRequiredminLength 1maxLength 5000pattern \SText description used to guide the content of the audio extension section.
bitratestringOptionalDefault: "192k"Audio bitrate for compressed output formats (such as mp3, aac, opus), as a string like '192k' or '320k', default 192k; has no effect on lossless formats (wav, flac).
audio_urlstringRequiredminLength 1URL of the source audio to be extended.
output_formatstringOptionalDefault: "mp3"Output container format of the generated audio, default mp3.
mp3wavflacoggopusm4aaacguidance_scalenumberOptionalDefault: 1min 0max 25Classifier-free guidance strength; higher values follow the prompt more strictly, default 1; only takes effect on base (non-distilled) checkpoints.
negative_promptstringOptionalDefault: ""Negative prompt describing features to avoid in the output, default empty string.
num_inference_stepsintegerOptionalDefault: 8min 1max 100Number of sampling steps, default 8; post-trained (distilled) checkpoints already perform well at the default value, and increasing steps yields little benefit.
extend_seconds_afternumberOptionalDefault: 0min 0max 380Number of seconds added at the end of the original audio, default 0. To write only forward, set extend_seconds_before to 0. For example, adding 4 seconds after an 8-second audio gives a target total duration of 12 seconds.
extend_seconds_beforenumberOptionalDefault: 0min 0max 380Duration (in seconds) of new audio generated before the source audio, default 0.
enable_prompt_expansionbooleanOptionalDefault: falseWhether to use an LLM to expand the prompt for more detailed, higher-quality results, default false.
callbackobjectOptional
Terminal-state notification config. When omitted, no callback is delivered — poll the task yourself. See the callback note below.
Provide callback.url when creating a task and HiAPI POSTs to your service once the task reaches a terminal state — no polling needed. The callback payload mirrors the task detail structure; signature verification, delivery retries and idempotency are documented on the Unified Async API overview page.
urlstringRequiredRequired when callback is present. A POST is sent to this URL once the task reaches a terminal state; must be a valid http(s) URL.
whenstringOptionalDefault: "final"Only final is supported today — notified on both success and fail.
finalstoragestringOptionalDefault: "temp"Artifact storage tier: temp (default, retained about 7 days) or persistent (long-term, billed by size). Insufficient balance or exceeding the storage cap silently downgrades to temp; the effective tier is shown in the task detail response.
temppersistentRequest examples
# Submit an async task; returns a taskId immediately (no waiting for generation)
curl -X POST "https://api.hiapi.ai/v1/tasks" \
-H "Authorization: Bearer $HIAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "stable-audio-3-medium/audio-outpainting",
"input": {
"prompt": "…",
"bitrate": "192k",
"audio_url": "…",
"output_format": "mp3",
"guidance_scale": 1,
"negative_prompt": "",
"num_inference_steps": 8,
"extend_seconds_after": 0,
"extend_seconds_before": 0,
"enable_prompt_expansion": false
}
}' const res = await fetch("https://api.hiapi.ai/v1/tasks", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.HIAPI_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "stable-audio-3-medium/audio-outpainting",
input: {
"prompt": "…",
"bitrate": "192k",
"audio_url": "…",
"output_format": "mp3",
"guidance_scale": 1,
"negative_prompt": "",
"num_inference_steps": 8,
"extend_seconds_after": 0,
"extend_seconds_before": 0,
"enable_prompt_expansion": false
}
}),
});
const task = await res.json();
// { code: 200, message: "success", data: { taskId } } import os, requests
res = requests.post(
"https://api.hiapi.ai/v1/tasks",
headers={"Authorization": f"Bearer {os.environ['HIAPI_API_KEY']}"},
json={
"model": "stable-audio-3-medium/audio-outpainting",
"input": {
"prompt": "…",
"bitrate": "192k",
"audio_url": "…",
"output_format": "mp3",
"guidance_scale": 1,
"negative_prompt": "",
"num_inference_steps": 8,
"extend_seconds_after": 0,
"extend_seconds_before": 0,
"enable_prompt_expansion": False
}
},
)
print(res.json()) # { code, message, data: { taskId } } 200 OK
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR"
}
} 400 Bad Request
{
"code": 400,
"message": "invalid request",
"data": null,
"error_code": "INVALID_REQUEST"
} Get task detail
https://api.hiapi.ai/v1/tasks/:id Response fields
taskIdstringRequiredTask ID, always prefixed with tk-hiapi-.
modelstringRequiredResolved full model name. Tasks submitted with the route parameter return base@route (e.g. gpt-image-2/text-to-image@ext); otherwise identical to the name passed at creation.
routestringOptionalPresent only when the task was submitted with an explicit route parameter; echoes the submitted value.
statusstringRequiredTask status.
queued Queued, not started yet.
handling Being processed.
archiving Processing finished, artifacts being prepared.
success Terminal: completed, artifacts available (output returned).
fail Terminal: failed (error returned).
After submission, check status: success and fail are terminal, everything else is non-terminal. Poll every 1–3 seconds until terminal. On success, download artifacts from output[].url and transfer them before expireAt; pass storage: "persistent" at creation time when long-term retention is needed.
creatednumberRequiredTask creation time (Unix seconds).
completednumberRequiredUnix seconds when the task reached a terminal state; fixed to 0 while not terminal.
outputarrayOptional
Present only when status == success. Artifact list — always an array; a single task may return multiple types at once (e.g. video + first_frame).
Array [ object ]
Array items
urlstringRequiredArtifact URL, directly downloadable.
typestringRequiredCurrent possible values: video, image, audio, first_frame, last_frame, thumbnail; more may be added later.
expireAtnumberRequiredUnix seconds until which the artifact remains accessible; download or transfer before it expires.
errorobjectOptional
Present only when status == fail.
codestringRequiredBusiness error code.
messagestringRequiredError description.
Response examples
Success
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR",
"model": "happyhorse-1-0",
"status": "success",
"created": 1777282033,
"completed": 1777282099,
"output": [
{
"url": "https://cdn.hiapi.ai/tasks/.../video.mp4",
"type": "video",
"expireAt": 1777886899
}
]
}
} Processing (non-terminal)
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "archiving",
"created": 1777282033,
"completed": 0
}
} Failed
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "fail",
"created": 1777282033,
"completed": 1777282099,
"error": {
"code": "TASK_FAILED",
"message": "task failed"
}
}
} Articles
View all articles →-
Tutorial
Stable Audio 3 Medium Audio Outpainting in Practice: 5 High-Value Use Cases and Integration Essentials
-
Guide
Stable Audio 3 Medium Audio Outpainting Getting Started Guide: Capability Boundaries, API Integration, and Cost Estimation
A practical guide to integrating and selecting audio outpainting models for developers
-
Comparison
Stable Audio 3 Medium Audio Outpainting Review: Model Selection and Migration Guide
Related Models
View all models →Same Type
-
MiniMax Music 1.5 MiniMax $0.070 /song -
Lyria 3.5 Google $0.090 /song -
Lyria 3 Pro Google $0.140 /song -
Mureka 9.5 Mureka $0.322 per request -
Mirelo SFX 2.0 Mirelo AI $0.021 /second -
ElevenLabs Sound Effects ElevenLabs $0.0029 /second -
Qwen Audio 3.0 TTS Alibaba $0.030 /1,000 characters -
MiniMax Music 3 MiniMax $0.0026 /second -
ElevenLabs ElevenLabs $0.125 /1,000 characters -
MiniMax Music 2.6 MiniMax $0.210 /song



