[Integrations](https://spiral.ai/integrations) › [opencode](https://spiral.ai/integrations/opencode) › [Stable Audio 3 Medium Audio Inpainting](https://spiral.ai/integrations/opencode/stable-audio-3-medium-audio-inpainting)

# How to Use Stable Audio 3 Medium Audio Inpainting in opencode

Stable Audio 3 Medium Audio Inpainting replaces a selected passage or continues an existing recording using the surrounding sound as context. It lets you revise part of a track while preserving the audio outside the selection.

|  |  |
| --- | --- |
| Model | Stable Audio 3 Medium Audio Inpainting |
| Available through | fal |
| Category | Audio |
| Price | $0.05746 per run at the default inputs. |
| Returns | audio |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with Stable Audio 3 Medium Audio Inpainting in opencode

- Use Stable Audio 3 Medium Audio Inpainting on assets/audio/menu.wav. Replace seconds 12 through 24 with quiet ambient piano and sustained strings, matching the surrounding mood. Keep the total length unchanged and save a separate review copy.
- Use Stable Audio 3 Medium Audio Inpainting to continue assets/audio/intro.wav from 20 seconds to 45 seconds total. Request restrained electronic music with soft synth chords and a steady pulse. Save the result beside the original.
- Use Stable Audio 3 Medium Audio Inpainting on assets/audio/exploration.wav. Rework seconds 30 through 50 as sparse instrumental music with muted percussion and warm bass. Preserve everything outside that passage.
- Use Stable Audio 3 Medium Audio Inpainting to make three alternate endings for assets/audio/outro.wav, replacing seconds 20 through 35. Request a gentle acoustic resolution each time, use eight sampling steps, and save each take separately.
- Use Stable Audio 3 Medium Audio Inpainting on assets/audio/demo-bed.wav. Replace seconds 10 through 25 with restrained jazz, brushed drums, and softly played upright bass. Keep the seed fixed while comparing two descriptions of the piano part.

## How to set up Stable Audio 3 Medium Audio Inpainting in opencode

Pick the way that suits you. Each takes about two minutes.

### Use Spiral's MCP server

1. **Add the server**: Leave out `--global` to add Spiral to the current project only. No header and no client ID or secret: opencode registers itself with Spiral.

```bash
opencode mcp add spiral --global --url https://api.spiral.ai/mcp
```

2. **Sign in**: Your browser opens. Sign in to Spiral, pick the organization and click Authorize, then return to the terminal. No API key. Inside opencode, `/mcps` starts the same sign-in.

```bash
opencode mcp auth spiral
```

3. **Check it**: Spiral shows as connected.

```bash
opencode mcp list
```

### Use the Spiral skill

1. **Send opencode this message**: Your agent reads Spiral's skill and sets itself up.

```
set up https://spiral.ai/SKILL.md
```

2. **Sign in or paste a key**: Approve Spiral in the browser, or give the agent a key from the console.

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run Stable Audio 3 Medium Audio Inpainting**: One request; the result comes back by polling or a webhook.

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "fal",
    "model": "fal-ai/stable-audio-3/medium/audio-inpainting",
    "input": {
      "prompt": "punchy kick drum fill",
      "audio_url": "https://storage.googleapis.com/falserverless/model_tests/diffrythm/rock_en.wav",
      "mask_start_seconds": 4,
      "mask_end_seconds": 8
    }
  }'
```

Then paste one of the prompts above: opencode finds Stable Audio 3 Medium Audio Inpainting on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/opencode

## Stable Audio 3 Medium Audio Inpainting tools and prices

- [Stable Audio 3 Medium Audio Inpainting · Audio Inpainting Medium](https://spiral.ai/tools/fal/fal-ai/stable-audio-3/medium/audio-inpainting) (fal): $0.05746 per run at the default inputs.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| negative_prompt |  |  | Text description of qualities to avoid in the output. |
| num_inference_steps | 1 to 100 | 8 | Number of sampling steps. Post-trained (distilled) checkpoints look good with the default 8 and gain little from going higher. |
| guidance_scale | 0 to 25 | 1 | Classifier-free guidance scale. Higher values follow the prompt more strictly. Only effective on base (non-distilled) checkpoints. |
| seed |  | — | Random seed for reproducible outputs. Omit for a random seed. |
| enable_prompt_expansion |  | false | If True, the prompt will be expanded using an LLM for more detailed and higher quality results. |
| output_format | mp3, wav, flac, ogg, opus, m4a, aac | mp3 | Container format for the generated audio output. |

## What can you do with Stable Audio 3 Medium Audio Inpainting in opencode?

Revise a project's instrumental audio without rebuilding the entire cue. A coding agent can work from project recordings, prepare targeted replacements, and keep the results ready for review.

### Replace a transition

Regenerate the passage between two sections of an instrumental track, describing the rhythm and energy you want at the handoff.

### Simplify music beneath narration

Rework a busy passage in an instrumental background track into a sparse arrangement before mixing it under a voiceover.

### Extend a podcast music bed

Continue an existing instrumental cue to fit a longer introduction, keeping the finished recording within 6 minutes 20 seconds.

### Try another ending

Replace the closing passage of a music cue with a quieter resolution while keeping its opening and middle.

### Revise game music

Create an alternate passage in an existing game soundtrack cue, such as a restrained exploration section with fewer percussion accents.

### Compare arrangement ideas

Generate several takes of the same selected passage, changing the instrument emphasis or mood while retaining the surrounding track.

## Overview

- [fal](https://spiral.ai/providers/fal)
- [All opencode guides](https://spiral.ai/integrations/opencode)

## Stable Audio 3 Medium Audio Inpainting in other agents

- [Amp](https://spiral.ai/integrations/amp/stable-audio-3-medium-audio-inpainting)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/stable-audio-3-medium-audio-inpainting)
- [Claude](https://spiral.ai/integrations/claude-desktop/stable-audio-3-medium-audio-inpainting)
- [Claude Code](https://spiral.ai/integrations/claude-code/stable-audio-3-medium-audio-inpainting)
- [Cline](https://spiral.ai/integrations/cline/stable-audio-3-medium-audio-inpainting)
- [Codex](https://spiral.ai/integrations/codex/stable-audio-3-medium-audio-inpainting)
- [Cursor](https://spiral.ai/integrations/cursor/stable-audio-3-medium-audio-inpainting)
- [Devin](https://spiral.ai/integrations/devin/stable-audio-3-medium-audio-inpainting)
- [dots](https://spiral.ai/integrations/dots/stable-audio-3-medium-audio-inpainting)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/stable-audio-3-medium-audio-inpainting)
- [Gemini](https://spiral.ai/integrations/gemini/stable-audio-3-medium-audio-inpainting)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/stable-audio-3-medium-audio-inpainting)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/stable-audio-3-medium-audio-inpainting)
- [goose](https://spiral.ai/integrations/goose/stable-audio-3-medium-audio-inpainting)
- [Grok](https://spiral.ai/integrations/grok/stable-audio-3-medium-audio-inpainting)
- [Grok Build](https://spiral.ai/integrations/grok-build/stable-audio-3-medium-audio-inpainting)
- [Hermes](https://spiral.ai/integrations/hermes/stable-audio-3-medium-audio-inpainting)
- [Instinct](https://spiral.ai/integrations/instinct/stable-audio-3-medium-audio-inpainting)
- [Manus](https://spiral.ai/integrations/manus/stable-audio-3-medium-audio-inpainting)
- [Muse](https://spiral.ai/integrations/muse/stable-audio-3-medium-audio-inpainting)
- [Muse Code](https://spiral.ai/integrations/muse-code/stable-audio-3-medium-audio-inpainting)
- [n8n](https://spiral.ai/integrations/n8n/stable-audio-3-medium-audio-inpainting)
- [Notion](https://spiral.ai/integrations/notion/stable-audio-3-medium-audio-inpainting)
- [OpenClaw](https://spiral.ai/integrations/openclaw/stable-audio-3-medium-audio-inpainting)
- [Perplexity](https://spiral.ai/integrations/perplexity/stable-audio-3-medium-audio-inpainting)
- [Raycast](https://spiral.ai/integrations/raycast/stable-audio-3-medium-audio-inpainting)
- [VS Code](https://spiral.ai/integrations/vscode/stable-audio-3-medium-audio-inpainting)
- [Windsurf](https://spiral.ai/integrations/windsurf/stable-audio-3-medium-audio-inpainting)
- [Zapier](https://spiral.ai/integrations/zapier/stable-audio-3-medium-audio-inpainting)

## More opencode guides

- [Stable Audio 2.5 Text to Audio](https://spiral.ai/integrations/opencode/stable-audio-2-5-text-to-audio)
- [Stable Audio 3 Medium Audio Outpainting](https://spiral.ai/integrations/opencode/stable-audio-3-medium-audio-outpainting)
- [Stable Audio 2.5 Inpaint](https://spiral.ai/integrations/opencode/stable-audio-2-5-inpaint)
- [Stable Audio 3 Medium Audio to Audio](https://spiral.ai/integrations/opencode/stable-audio-3-medium-audio-to-audio)
- [Stable Audio 2.5 Audio to Audio](https://spiral.ai/integrations/opencode/stable-audio-2-5-audio-to-audio)
- [Stable Audio 3 Medium Base Audio Inpainting](https://spiral.ai/integrations/opencode/stable-audio-3-medium-base-audio-inpainting)

## Questions about Stable Audio 3 Medium Audio Inpainting in opencode

**Can opencode use Stable Audio 3 Medium Audio Inpainting?**

Yes. Add Spiral to opencode as an MCP server, and opencode can find and run Stable Audio 3 Medium Audio Inpainting like any built-in tool.

**How much does Stable Audio 3 Medium Audio Inpainting cost in opencode?**

$0.05746 per run at the default inputs. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your opencode plan is separate.

**Do I need a fal account to use Stable Audio 3 Medium Audio Inpainting in opencode?**

No. Spiral runs Stable Audio 3 Medium Audio Inpainting on its own fal account. You sign in to Spiral once and never paste a key.

**How long does it take to set up Stable Audio 3 Medium Audio Inpainting in opencode?**

About two minutes: add the server, then sign in, then check it.

**Does opencode wait while Stable Audio 3 Medium Audio Inpainting runs?**

Stable Audio 3 Medium Audio Inpainting runs in the background. opencode starts the run, checks on it and gives you the audio when it's ready.

**What does audio inpainting change?**

It regenerates the selected passage using the surrounding recording as context. Audio outside the selection stays intact.

**Can Stable Audio 3 Medium extend a recording?**

Yes. Continuation generates material after the existing recording, with a total supported length of up to 6 minutes 20 seconds.

**Can it generate narration or spoken dialogue?**

Stable Audio 3 is not designed for speech or voice generation. Use it for instrumental audio editing rather than a passage that needs understandable words.

**What should I include in an editing prompt?**

Describe the music you want to hear: genre, instruments, rhythm, mood, arrangement, and recording character. For example, ask for a restrained jazz passage with brushed drums and a softly played upright bass.

**Should I write prompts in English?**

Yes. Stable Audio 3 was trained on English descriptions, and Stability says other languages underperform.

