Generate Song (v5)
- The API supports both streaming and synchronous responses
Endpoints
- POST
/v5/generate/song/streaming- streaming - POST
/v5/generate/song/sync- synchronous
Request Parameters
| Parameter | Type | Description | Required | Default Value |
|---|---|---|---|---|
prompt | string | Text prompt describing the desired song. | Yes | N/A |
lyrics | string | Lyrics for the song (generated if not provided). | No | N/A |
duration | integer | Duration of the generated song in seconds. | No | 30 |
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.
| Parameter | Type | Description |
|---|---|---|
isComplete | bool | Indicates if the streaming response is complete. |
status | string | Current status of the extension process. |
chunkIndex | integer | Index of the current chunk in the streaming sequence. |
message_id | string | Unique identifier for the extension request. |
stream_url | string | URL to access the generated audio stream when ready. |
version | integer | Version of the generated content. |
album_art | string | URL of the album art associated with the generated content. |
song_name | string | Name of the generated track. |
progress | integer | Progress percentage of the generation process. 0-100 |
streaming_ready | bool | Indicates if audio is ready for streaming. |
version | integer | Version number of the generated audio. |
audio_url | string | URL of the generated audio file. |
error | string | Error message if any issues occurred during processing. |
operation | string | Type of operation being performed (e.g., “extend_song”). |
Stages of Streaming Response
Initialization
sent immediately after the request is receivedisComplete, status, chunkIndex
Validation
validates the request and bills the usermessage_id, isComplete, status, album_art, song_name, chunkIndex
Streaming
begins generating the content and streams updatesmessage_id, isComplete, status, album_art, song_name, chunkIndex
Processing & Running
provides progress updates during generationmessage_id, isComplete, chunkIndex, status, album_art, song_name, progress
Streaming Ready
indicates that the stream url is ready and can be used for playbackmessage_id, isComplete, status, chunkIndex, stream_url, version, streaming_ready, album_art, song_name
🛈 Note: Two versions of the generated content are created per request (version 1 and version 2).
Completed Generation
indicates that the generation is completemessage_id, isComplete, chunkIndex, status, album_art, song_name, progress, audio_url
Uploading
indicates that the generated content is being uploaded for further processingmessage_id, isComplete, status, version, chunkIndex
Final Completed Response
provides the final details of the generated content including lyrics sectionsmessage_id, isComplete, status, version, lyrics_sections, chunkIndex

