# ACE Studio ACE-Step Audio Inpaint API

> ACE-Step Audio Inpaint regenerates a chosen time range inside an existing song from genre tags and lyrics, keeping the surrounding audio as context.

Source: https://www.sandbase.ai/models/ace/ace-step/audio-inpaint
API reference: https://www.sandbase.ai/models/ace/ace-step/audio-inpaint#api

## Facts

- Provider: ACE Studio
- Type: Audio model
- Model ID: `ace/ace-step/audio-inpaint`
- Price: From $0.01 per run
- Capabilities: audio to audio
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

- Unified Run API: `POST https://api.sandbase.ai/v1/run`

```bash
curl -X POST https://api.sandbase.ai/v1/run \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "ace/ace-step/audio-inpaint",
  "tags": "lofi, hiphop, drum and bass, trap, chill",
  "audio": "https://static.sandbase.ai/examples/ace/ace-step/audio-inpaint/input_audio_0.wav",
  "end_time": 30,
  "variance": 0.5,
  "start_time": 0,
  "end_time_relative_to": "start",
  "start_time_relative_to": "start"
}'
```

The response returns a run id; poll `GET https://api.sandbase.ai/v1/run/{id}` until the status is `completed` or `failed`.

## FAQ

### How do I call ACE Studio ACE-Step Audio Inpaint through SandBase?

Create a SandBase API key, then send requests with the model ID "ace/ace-step/audio-inpaint" to Unified Run API (/v1/run) at https://api.sandbase.ai. The request examples on this page show the exact payload.

### Do I need a separate ACE Studio account?

No. One SandBase API key and balance gives you access to ACE Studio ACE-Step Audio Inpaint and the other models in the catalog; you do not need to sign up with ACE Studio separately.

## README

### ACE-Step Audio Inpaint

ACE-Step Audio Inpaint rewrites one time range of a song from tags and lyrics and keeps the rest.

#### Fields

| Field | Type | Default | Notes |
|---|---|---|---|
| `audio` | audio file or URL, required | — | Source song. |
| `tags` | string, required | — | Style for the new region. |
| `lyrics` | string | `""` | Lyrics for the new region. |
| `start_time` | number 0–240 | 0 | Region start in seconds. |
| `end_time` | number 0–240 | 30 | Region end in seconds. |
| `start_time_relative_to` | `start` / `end` | `start` | Count `start_time` from the start or the end. |
| `end_time_relative_to` | `start` / `end` | `start` | Count `end_time` from the start or the end. |
| `variance` | number 0–1 | 0.5 | Higher gives more change. |
| `seed` | integer | random | Fix it to compare changes. |

#### Output

| Field | Notes |
|---|---|
| `url` | WAV file. |
| `tags` | Genre tags used. |
| `lyrics` | Lyrics used. |
| `seed` | Seed used; pass it back to reproduce. |

#### Billing

$0.0002 per second of generated audio. The quote uses the source audio length; the final charge uses the output length.

| Length | Price |
|---|---|
| 30 s | $0.006 |
| 60 s | $0.012 |
| 240 s | $0.048 |

Failed runs are not charged.

#### Prompting

- Keep the region short and the tags close to the source so the edges blend.

#### Also on SandBase

Related: `ace/ace-step`, `ace/ace-step/prompt-to-audio`, `ace/ace-step/audio-to-audio`, `ace/ace-step/audio-outpaint`.
