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

# Flow Music Upload

> Import your own audio as a Flow Music clip. $0.015 per request.

`flow-music-upload` imports a public audio file as a Flow Music clip, so you can extend, replace, cover, split, download, or render it.

| Property | Value |
| - | - |
| Model ID | `flow-music-upload` |
| Endpoint | `POST /v1/music/generations` (asynchronous task) |
| Group | Flow Music |
| Input | One public audio URL |
| Result | One clip in `result.tracks` |
| Price | \$0.015 per request (1.5 credits) |

Confirm live rates on the [SnapGen models page](https://snapgen.org/models). Failed tasks are not charged.

<ParamField body="model" type="string" required>
  Set to `flow-music-upload`.
</ParamField>

<ParamField body="audio_url" type="string" required>
  Public `http` or `https` URL of the audio, with a common audio extension such as `.mp3` or `.wav`.
</ParamField>

<ParamField body="webhook" type="string">
  Optional public `https` URL that receives one signed event when the task finishes. See [Task webhooks](/api-reference/webhooks).
</ParamField>

<ParamField body="webhook_secret" type="string">
  Required with `webhook`: 16 to 256 characters, used to sign the delivery.
</ParamField>

## Request

```bash theme={null}
curl https://api.snapgen.org/v1/music/generations \
  -H "Authorization: Bearer $SNAPGEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flow-music-upload",
    "audio_url": "https://example.com/audio.mp3"
  }'
```

The response is HTTP `202` with a task object and a `Location: /v1/tasks/{id}` header. Poll [`GET /v1/tasks/{id}`](/api-reference/task-status) every 10 to 20 seconds until `status` is `succeeded` or `failed`.

## Result

`result.tracks[0]` is the imported clip. Pass this task's `id` as `source_task_id` to extend, replace, cover, split, download, or render it.

```json theme={null}
{
  "urls": [
    "https://cdn.example.com/music/audio.mp3"
  ],
  "tracks": [
    {
      "index": 1,
      "id": "a41aade4-993e-4d28-b56f-d97e7ef7167c",
      "audio_url": "https://cdn.example.com/music/audio.mp3"
    }
  ]
}
```

<Note>
  Result URLs are kept for about 72 hours. Download the files you want to keep.
  See [Music generation tasks](/api-reference/music-generations) for the task lifecycle, result fields, webhooks, and errors.
</Note>
