Skip to main content

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 received
fields sent: isComplete, status, chunkIndex
Validation
validates the request and bills the user
message_id can be used to track the request using the /status/generation/ endpoint
fields sent: message_id, isComplete, status, album_art, song_name, chunkIndex
Streaming
begins generating the content and streams updates
fields sent: message_id, isComplete, status, album_art, song_name, chunkIndex
Processing & Running
provides progress updates during generation
fields sent: message_id, isComplete, chunkIndex, status, album_art, song_name, progress
Streaming Ready
indicates that the stream url is ready and can be used for playback
fields sent: message_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 complete
fields sent: message_id, isComplete, chunkIndex, status, album_art, song_name, progress, audio_url
Uploading
indicates that the generated content is being uploaded for further processing
fields sent: message_id, isComplete, status, version, chunkIndex
Final Completed Response
provides the final details of the generated content including lyrics sections
fields sent: message_id, isComplete, status, version, lyrics_sections, chunkIndex

Synchronous Response

Sample Synchronous Output

Possible Errors

Rate Limit Exceeded:
Insufficient Balance:
Invalid Prompt:
NSFW Content Detected:
Service Unavailable: