Generate Song (v7)
- The API supports both streaming and synchronous responses.
- Every streaming response begins with a
job_createdevent containing ajob_id, allowing you to safely disconnect and poll/v7/statusfor the result.
Endpoints
-
/v7/generate/song- streaming -
/v7/generate/song/sync- synchronous
Request Parameters
At least one ofpromptor an audio URL (reference_url,instrumental_url,vocal_url,melody_url) must be provided.
| Parameter | Type | Description | Required | Constraints |
|---|---|---|---|---|
prompt | string | Text prompt describing the desired song. | Conditional | Max 1024 chars |
lyrics | string | Lyrics for the song. Generated automatically if not provided. | No | — |
reference_url | string | URL of reference audio to guide the style of the generation. | Conditional | Max 10 MB |
instrumental_url | string | URL of instrumental audio to incorporate into the song. | Conditional | Max 10 MB |
vocal_url | string | URL of vocal audio to incorporate into the song. | Conditional | Max 10 MB |
melody_url | string | URL of melody audio to guide the melodic direction of the generation. | Conditional | Max 10 MB |
Example Request
Code Examples - Streaming
Code Examples - Synchronous
Streaming Response
Fields
🛈 The fields below are used in the chunks sent by SSE during the streaming process. Not all fields appear in every chunk — see the stage breakdown below.
| Parameter | Type | Description |
|---|---|---|
type | string | Event type. "job_created" on the first chunk only. |
job_id | string | Persistent job identifier. Use this to poll /v7/status if you disconnect. |
message_id | string | Unique identifier for the generation request. |
isComplete | bool | true only on the final chunk of the stream. |
status | string | Current status. One of: validated, streaming, uploading, completed, failed. |
chunkIndex | integer | Index of the current chunk in the streaming sequence. |
operation | string | Operation type. "song_generate" (prompt only) or "song_with_reference" (audio URLs). |
content | string | Human-readable description of the current stage. |
album_art | string | URL of the generated album art. |
song_name | string | Name of the generated track. |
version | integer | Version number of the audio output (1 or 2). |
task_id | string | Internal task identifier for the generation job. |
stream_url | string | Proxy URL for previewing audio before the final upload is complete. |
streaming_ready | bool | true when the preview stream URL is ready for playback. |
audio_url | string | Final URL of the uploaded audio file. |
audio_id | string | Database ID of the generated audio asset. |
audio_ready | bool | true when the final audio file is available for download. |
duration | float | Duration of the generated audio in seconds. |
bpm | integer | Beats per minute of the generated track. |
lyrics_sections | array | Structured lyrics broken into labelled sections with timestamps. |
tokens | integer | Tokens consumed by this chunk. |
totalTokens | integer | Total tokens consumed for the request so far. |
total_versions | integer | Total number of audio versions generated. Sent in the final completed chunk. |
error | bool | true if this chunk represents an error. |
detail | string | Error detail message when error is true. |
Stages of Streaming Response
Job Created
always the very first chunk; guaranteesjob_id is available before any processing begins
Savefields sent:job_idimmediately — if your connection drops, you can resume tracking via/v7/status.
type, job_id, message_id, status, isComplete, chunkIndex
Validated
request has been validated and billing authorised; song name and album art are assignedmessage_id, status, isComplete, album_art, song_name, operation, content, chunkIndex
Streaming
audio generation is in progress; sent once per version when the preview stream becomes availablemessage_id, status, isComplete, version, task_id, stream_url, streaming_ready, content, chunkIndex
🛈 Two versions are generated per request (version: 1andversion: 2). A separate streaming chunk is sent for each version.
Uploading
generated audio is being uploaded to permanent storagemessage_id, status, isComplete, version, content, chunkIndex
Completed (per version)
final audio file is ready; includes the permanent URL and metadata for that versionmessage_id, status, isComplete, version, audio_url, audio_id, audio_ready, duration, bpm, lyrics_sections, tokens, totalTokens, content, chunkIndex
Completed (final)
stream termination; confirms all versions are donemessage_id, status, isComplete, operation, total_versions, album_art, song_name, content, chunkIndex

