> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rawchunks.space/llms.txt
> Use this file to discover all available pages before exploring further.

# Separate stems

> Separate source audio into instrument stems.

HTTP 200 can contain a pending job. Check `status` and poll with `task: "extract"`. Ready stems start muted.

[Extract and separate](https://docs.rawchunks.space/dev/guides/edit/extract-separate.md).

## Headers and parameters

Paid requests accept [USDC session or Credits headers](https://docs.rawchunks.space/dev/guides/payments.md). Use the selected account consistently in headers and creator fields.

**Authorization** `string`

For USDC: `Bearer` followed by the complete issued session token.

For Credits, send `x-wallet-auth-token` and `x-credit-source` (`card` or `promo`). A stable `x-idempotency-key` of at most 80 characters identifies a paid service operation.

**x-session-user-address** `string` *required*

Selected account address. Required for owner-scoped reads and writes. It identifies the account; your product must authenticate its own users.

**x-network-id** `string`

Session network in CAIP-2 form, for example eip155:8453.

## JSON body

**songId** `string` *required*

Opaque ID returned by the API. Minimum length: `1`.

**userAddress** `string` *required*

Wallet address for the selected account. Use the same address as the session owner. Minimum length: `10`.

**srcAudioUrl** `string`

Optional source override, for example the url from Upload source. Use an HTTP(S) URL.

**stemType** `string` (default: all)

Use a stem ID from GET /api/options. Omitted value is all.

## Response (200)

Success.

**status** `string` *required*

Values: `pending`, `processing`, `ready`, `error`.

**progress** `number`

**error** `string`

**take** `object | null`

**Properties**

**id** `string` *required*

**song\_id** `string` *required*

**stem\_id** `string | null`

**take\_number** `integer`

**model** `string`

**task** `string`

**url** `string` *required*

**is\_active** `boolean` *required*

**prompt** `string | null`

**lyrics** `string | null`

**repainting\_start** `number | null`

**repainting\_end** `number | null`

**seed** `integer | null`

**provenance** `object | null`

**Properties**

**target** `string`

Values: `master`, `stem`, `layer`.

**targetStemId** `string | null`

**region** `object | null`

**Properties**

**start** `number` *required*

Start on the song timeline, in seconds. Minimum: `0`.

**end** `number` *required*

End on the song timeline, in seconds. Must exceed start. Minimum: `0`.

**regions** `object[]`

**Properties**

**start** `number` *required*

Start on the song timeline, in seconds. Minimum: `0`.

**end** `number` *required*

End on the song timeline, in seconds. Must exceed start. Minimum: `0`.

**audioOffset** `number`

Source-buffer offset for the eligible section, in seconds.

**outputDuration** `number | null`

**mergedInto** `string`

**layerName** `string`

**created\_at** `string`

**audioUrl** `string`

**audioUrls** `string[]`

**stems** `object[]`

**Properties**

**id** `string` *required*

**song\_id** `string` *required*

**name** `string` *required*

**url** `string` *required*

**volume** `number`

Linear gain, 1 is unity. Minimum: `0`.

**pan** `number`

Range: `-1` to `1`.

**is\_muted** `boolean`

**is\_solo** `boolean`

**waveform\_peaks\_url** `string | null`

**created\_at** `string`

**versionState** `string`

Candidate state. Initially pending; later reads can report merged or discarded. Values: `pending`, `merged`, `discarded`.

**taskId** `string` *required*

**songId** `string` *required*

**task** `string` *required*

Values: `extract`.

Budget headers use six-decimal USDC atomic units. See [session payments](https://docs.rawchunks.space/dev/guides/payments.md#track-or-end-a-session).

## Errors

Failed JSON responses contain an `error` string. Check the HTTP status before reading a successful result. See [job handling](https://docs.rawchunks.space/dev/guides/jobs.md) for interrupted or uncertain submissions.

| Status | Meaning |
| - | - |
| `400` | Invalid request. |
| `401` | Invalid or expired session token. |
| `402` | Payment required or insufficient session budget. |
| `403` | Account does not match resource. |
| `404` | Resource not found. |
| `409` | Resource conflict; reload state or open an editable version. |
| `500` | Request failed. |

```bash cURL theme={"theme":{"light":"github-dark","dark":"github-dark"}}
curl --fail-with-body -X POST "$RAWCHUNKS_API/api/editing/isolate" \
  -H "Authorization: Bearer $SESSION_TOKEN" \
  -H "x-network-id: $NETWORK" \
  -H "x-session-user-address: $USER_ADDRESS" \
  -H "Content-Type: application/json" \
  --data "$(jq -nc --arg user "$USER_ADDRESS" --arg song "$SONG_ID" '{
  "songId": $song,
  "userAddress": $user,
  "stemType": "all"
}')"
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.