Skip to main content

Generate Song (v7)

  • The API supports both streaming and synchronous responses.
  • Every streaming response begins with a job_created event containing a job_id, allowing you to safely disconnect and poll /v7/status for the result.

Endpoints

  • /v7/generate/song - streaming
  • /v7/generate/song/sync - synchronous

Request Parameters

At least one of prompt or an audio URL (reference_url, instrumental_url, vocal_url, melody_url) must be provided.

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.

Stages of Streaming Response

Job Created
always the very first chunk; guarantees job_id is available before any processing begins
Save job_id immediately — if your connection drops, you can resume tracking via /v7/status.
fields sent: type, job_id, message_id, status, isComplete, chunkIndex
Validated
request has been validated and billing authorised; song name and album art are assigned
fields sent: message_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 available
fields sent: message_id, status, isComplete, version, task_id, stream_url, streaming_ready, content, chunkIndex
🛈 Two versions are generated per request (version: 1 and version: 2). A separate streaming chunk is sent for each version.

Uploading
generated audio is being uploaded to permanent storage
fields sent: message_id, status, isComplete, version, content, chunkIndex
Completed (per version)
final audio file is ready; includes the permanent URL and metadata for that version
fields sent: message_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 done
fields sent: message_id, status, isComplete, operation, total_versions, album_art, song_name, content, chunkIndex

Synchronous Response

Sample Synchronous Output

Possible Errors

Missing prompt and audio URL:
Prompt too long (> 1024 characters):
Audio file too large (> 10 MB):
Rate Limit Exceeded:
Insufficient Balance:
Service Unavailable: