Generate Song (v5)
- The API supports both streaming and synchronous responses
Endpoints
- POST
/v5/generate/song- streaming - POST
/v5/generate/song/sync- synchronous
Request Parameters
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.
Stages of Streaming Response
Initialization
sent immediately after the request is receivedisComplete, status, chunkIndex
Validation
validates the request and bills the usermessage_id can be used to track the request using the /status/generation/ endpointfields sent:
message_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

