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

# Prepare a song with Songwriter

> Fill a musical draft from text, an image, a hum or speech.

Send a brief to `POST /api/vibe/`. You can combine `prompt`, `image` and `audio`. Images accept URLs or data URLs; recordings accept data URLs or base64. [Request fields](https://docs.rawchunks.space/dev/endpoints/vibe/run.md).

Use the [paid request headers](https://docs.rawchunks.space/dev/guides/payments.md). Songwriter returns NDJSON, so read the response stream rather than calling `response.json()`.

## Fill your form as events arrive

Reuse the [NDJSON reader](https://docs.rawchunks.space/dev/guides/jobs.md#generation-edit-and-voice-streams). Dispatch each event by `type`:

| Event | Client action |
| - | - |
| `field` | Set the control named by `field` to `value`. |
| `lyrics_start` | Clear the lyric buffer. |
| `lyrics_delta` | Append `delta`. |
| `cover_start` | Show artwork preparation. |
| `cover` | Store `imageUrl`. |
| `songwriter_ready` | Enable review and audio generation. |
| `done` | Close the full preparation state. |
| `status` | Show `step`. |
| `error` | Show `message` and preserve the draft received so far. |

Songwriter can set title, production prompt, instrumental choice, vocal language, tags, BPM, key/scale and duration. Instrumental drafts skip vocal lyric writing. Artwork can finish after `songwriter_ready`.

## Generate the reviewed draft

Pass the reviewed fields to [music generation](https://docs.rawchunks.space/dev/guides/generate/music.md). Add `creatorAddress`, `modelVariant`, voice selection and selling terms from your product. Songwriter prepares the musical form; the audio request chooses Fast or Master and submits a separate paid job.

## Use individual actions

The [Vibe endpoints](https://docs.rawchunks.space/dev/endpoints/vibe/audio.md) also expose audio and image interpretation, lyric writing, cover creation, libraries and normalization. Use them when your UI needs one part of the preparation flow.

The [App walkthrough](https://docs.rawchunks.space/app/vibe.md) shows the current Studio controls. [Songwriter architecture](https://docs.rawchunks.space/ai-ml/songwriter.md) explains models and processing.


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