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
On this page
What problem does audio outpainting solve
Let's first clarify a common misunderstanding: audio outpainting in stable-audio-3-medium is not "generating an audio clip from scratch", but rather extending outward from an existing audio clip. You give it an existing piece of sound, and it appends style-consistent new content to the beginning or end of that sound.
Here's an analogy familiar to developers: outpainting in the image domain fills in the area around an existing image, rather than drawing a new image from scratch. Audio outpainting works the same way—the input is required, and the output is "the original audio + the extended part". It answers the question "what should this sound sound like going forward/backward", not "give me a piece of audio".
This distinguishes it from several adjacent concepts:
- Audio generation (text-to-audio): generates an entire audio clip from text or noise, without requiring input audio.
- Audio inpainting / restoration: fills gaps in the middle of audio or removes defects; the changes happen inside rather than at the two ends.
- Audio extension (simple looping / splicing): lengthens material by copying and crossfading, without producing new content.
- Audio outpainting: generates new audio content beyond the endpoints that is coherent with the context; the extension direction is at the beginning or the end.
The practical significance of drawing this boundary is: if your need is to produce a soundtrack out of thin air from a one-sentence description, this model is not the right tool; audio outpainting only applies when you already have a usable piece of audio and need it to "naturally continue". The criterion is simple—no input audio, no outpainting.

Capability boundaries and applicable scenarios
Based on the model's publicly available capabilities (capability is audio-outpainting, output type is audio), we can give a rough applicability judgment.
Suitable tasks:
- A short intro music is too short and needs to be extended backward into a longer background bed.
- A recording ends abruptly and you want to add a natural closing atmosphere.
- Loop material needs a small extension at both the front and the back so the transition is seamless.
- You are basically satisfied with the existing audio's mood, instrumentation, and rhythm, and only lack duration.
Unsuitable tasks:
- No material at all, only a text description—use audio generation capabilities instead.
- Need to insert or replace content in the middle of the audio—this is an inpainting-type problem.
- Engineering scenarios requiring strict alignment to a beat grid or sample-exact reproducibility of the output—generative outpainting struggles to guarantee such determinism.
- Scenarios with hard requirements on dialogue clarity and speech content accuracy—outpainting excels at atmosphere and musical continuity, not speech reconstruction.
A practical selection criterion: first ask "can the audio I have be delivered directly?" If it can, and is just not long enough, outpainting is the least troublesome path; if you don't even have basic material, or the material itself is not up to standard, fix the source of the problem first and don't expect outpainting to save you. The quality of the input audio directly carries over to the output; a noisy, heavily clipped input usually won't yield a better extended part.

API integration and key parameters
On HiAPI.ai, the integration entry point for this model is the unified model endpoint, with the model identifier stable-audio-3-medium/audio-outpainting. You can enter from the model page /models/stable-audio-3-medium-audio-outpainting to view the current parameter descriptions and call examples. All requests go through the same aggregation interface, so there is no need to integrate with different upstreams separately.
When calling, what really affects the result and cost centers on a few dimensions:
Input audio. This is the most important item. Pay attention to whether the sample rate, number of channels, duration, and format meet the requirements, and avoid lossy compression on the client before uploading. The cleaner the input, the better the coherence of the extended segment.
Extension direction. Make clear whether you want to extend forward or backward. Reversing the direction is one of the most common invalid requests; the result usually cannot be used directly, which amounts to paying for nothing.
Extension length. The more you extend, the more content is generated, and the more likely style drift becomes. It is recommended to first do one pass according to the target duration, then fine-tune based on the result, rather than requesting an extremely long extension right away.
Output format. Set it according to the needs of the downstream consumer (player, editing software, storage) to avoid transcoding after receiving the result.
In terms of parameters: the source audio is submitted via audio_url, forward extension uses extend_seconds_before, backward extension uses extend_seconds_after; both default to 0 with an upper limit of 380 seconds each, and both being 0 produces no new content; the output format and bitrate are controlled by output_format and bitrate, and fixing seed makes the same result reproducible.
From an engineering perspective, it is recommended to wrap the call in a thin client layer: uniformly perform input validation (format, duration, channels), uniformly log request parameters and responses, and uniformly handle timeouts and retries. Doing validation before sending the request can block a considerable portion of doomed calls—requests rejected at the input validation stage are not billed, but a request that has already executed and is rerun only because the result is unsatisfactory will be billed, which is expanded on in the next section.

Pricing and cost estimation
The billing basis for this capability is straightforward: billed per audio clip, at a unit price of $0.0638. There is no complicated per-second or per-token conversion; cost estimation is just multiplication.
Estimation method:
- Determine the per-clip cost: $0.0638.
- Estimate the batch count N. Here "clip" refers to one request that successfully produces audio.
- Base cost ≈ N × $0.0638.
- Add a retry margin. Generative tasks rarely get it right the first time, so the actual number of requests is usually greater than the target output count.
An example to illustrate how this multiplication is used (not a quote): if the target output is 1,000 clips, the base cost is 1,000 × $0.0638. If you estimate that each clip needs 1.5 requests on average to be satisfactory, budget for 1,500 requests. Keeping "target output count" and "actual request count" on separate books is the key to controlling this type of cost.
A few practices for controlling costs:
- Start with a small sample. Use a small number of requests to validate the parameter combination, confirm the direction, length, and format are all correct, then scale up.
- Move validation upstream. Problems such as non-compliant input or wrong direction are caught on the client, so they don't become paid failed requests.
- Cap retries. Repeatedly retrying the same input often yields diminishing returns; set a retry cap, and if exceeded, look back at input quality.
- Distinguish "unsatisfactory" from "failed". Failed requests need investigation; if it's merely unsatisfactory, adjust parameters before retrying—don't blindly retry.
For real-time prices and billing details, refer to the site's pricing panel; this article only provides the estimation basis.
Best practices and common troubleshooting
When integrating outpainting into a production pipeline, typical issues basically concentrate in three stages: input, request, output.
Input stage:
- Audio format, sample rate, or number of channels does not meet requirements → the request fails outright. Normalize once before uploading.
- Input too short or too long → exceeds the model's processing range. Crop or segment first.
- The input itself is noisy or clipped → poor output coherence. Do basic cleanup first.
Request stage:
- Extension direction reversed → the result looks "wrong", but it's actually a parameter problem, not a model problem.
- Extension length set too large at once → style drift, divergent tail. Stepwise extension is usually more stable.
- Concurrency too high triggering rate limiting → add backoff retries rather than immediately resending.
Output stage:
- Only checking "whether a file is returned" without checking duration and format → problems only surface when consumed downstream. It is recommended to do an automatic validation on the client: whether the duration falls within the expected range, whether the format matches, and whether the file is decodable.
- Request parameters not retained → cannot reproduce when problems occur. Write key parameters into logs.
A suggestion that runs throughout: run through the boundary scenarios with a small sample before launch—shortest input, longest extension, abnormal format, concurrency peak. The request cost for these test cases is very low, but they can block the most expensive batch of invalid payments after launch.
Summary and future evolution
Audio outpainting in stable-audio-3-medium is a clearly positioned tool: it extends outward from existing audio rather than generating from scratch. The key to using it well lies in three things—confirm that the input audio is a qualified starting point, validate parameters such as direction and length on the client side, and factor retry margins into the budget based on the $0.0638/clip basis.
It is better suited as one link in a creative pipeline rather than the only solution: generation, outpainting, and inpainting each solve different problems and can be combined as needed. To continue exploring the platform's audio capabilities, you can start from /models/stable-audio-3-medium-audio-outpainting and integrate this link into your actual pipeline for validation.
Related articles
View all articles →-
Guide
MAI Image 2.7 Text-to-Image Getting Started Guide: Capability Boundaries, Pricing, and Integration Practices
From capability boundaries to per-image billing integration practices, all in one place
-
Guide
MAI Image 2.7 Flash Text-to-Image Integration Guide: Capability Boundaries, Parameters, and Cost Estimation
From capability boundaries to the cost accounting of $0.0149 per image, this article explains clearly in one go how to integrate, how to use, and how to save money
-
Guide
MAI Image 2.7 Image Editing Getting Started Guide: Capabilities, Pricing, and Integration Key Points of the Image Editing Model
From capability boundaries to cost estimation, what developers need to know before integrating the Microsoft image editing model