> ## 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.

# Save a voice from a song

> Save and prepare vocals from an owned song.

The song must have audio and belong to your account. Poll or follow events for preparation status. [Saved voices](/dev/guides/generate/voices).

## Headers and parameters

<ParamField header="Authorization" type="string" required>
  `Bearer $SESSION_TOKEN`. Use the complete token from your active [Rawchunks session](/dev/guides/payments).
</ParamField>

<ParamField header="x-session-user-address" type="string" required>
  Selected account address. Required for owner-scoped reads and writes. It identifies the account; your product must authenticate its own users.
</ParamField>

<ParamField header="x-network-id" type="string">
  Session network in CAIP-2 form, for example eip155:8453.
</ParamField>

## JSON body

<ParamField body="songId" type="string" required>
  Opaque ID returned by the API. Minimum length: `1`.
</ParamField>

<ParamField body="creator" type="string" required>
  Wallet address for the selected account. Use the same address as the session owner. Minimum length: `10`.
</ParamField>

<ParamField body="name" type="string" />

## Response (202)

Accepted; follow the returned task.

<ResponseField name="success" type="boolean" required />

<ResponseField name="voice" type="object" required>
  <Expandable title="Properties">
    <ResponseField name="id" type="string" required />

    <ResponseField name="name" type="string" required />

    <ResponseField name="creator" type="string" required />

    <ResponseField name="sample_url" type="string | null" />

    <ResponseField name="source_song_id" type="string | null" />

    <ResponseField name="status" type="string" required>
      Values: `saved`, `extracting`, `queued`, `training`, `ready`, `error`.
    </ResponseField>

    <ResponseField name="error" type="string | null" />

    <ResponseField name="availability" type="object">
      <Expandable title="Properties">
        <ResponseField name="turbo" type="object">
          <Expandable title="Properties">
            <ResponseField name="model" type="string" />

            <ResponseField name="status" type="string">
              Check ready for the generation mode you will use.
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="sft" type="object">
          <Expandable title="Properties">
            <ResponseField name="model" type="string" />

            <ResponseField name="status" type="string">
              Check ready for the generation mode you will use.
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

Budget headers use six-decimal USDC atomic units. See [session payments](/dev/guides/payments#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](/dev/guides/jobs) 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. |

<RequestExample>
  ```bash cURL theme={null}
  curl --fail-with-body -X POST "$RAWCHUNKS_API/api/voices" \
    -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,
    "creator": $user,
    "name": "Lead voice"
  }')"
  ```
</RequestExample>

<ResponseExample>
  ```json 202 theme={null}
  {
    "success": true,
    "voice": {
      "id": "voice-example",
      "name": "Lead voice",
      "creator": "0x1111111111111111111111111111111111111111",
      "status": "saved"
    }
  }
  ```
</ResponseExample>


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