Generate AI Song (v5)
This endpoint generates complete AI songs with lyrics and audio using advanced AI models. Available in both streaming and synchronous modes.Core Parameters
The parameters below define the request body for this API.
| Parameter | Type | Required? | Description |
|---|---|---|---|
userId | string | ✅ Required | User ID requesting the operation. |
projectId | string | ✅ Required | Project ID for organizing generations. |
prompt | string | ✅ Required | Prompt describing the song you want to generate (e.g., “A happy upbeat pop song about summer”). |
lyrics | string | ⚠️ Optional | Lyrics for the song. If not provided, lyrics will be automatically generated from the prompt. |
duration | integer | ⚠️ Optional | Duration in seconds. Default: 30. |
model | string | ⚠️ Optional | AI model to use. Default: mureka-7.5. |
parameters | object | ⚠️ Optional | Additional parameters for advanced customization. |
Note: Iflyricsis not provided, the system will automatically generate lyrics based on yourprompt. Providing bothpromptandlyricsgives you more control over the final output.
Endpoints
This API provides two endpoints:- Streaming Endpoint (
/v5/generate/song-gen): Returns real-time progress updates via Server-Sent Events (SSE) - Synchronous Endpoint (
/v5/generate/song-gen/sync): Waits for completion and returns the final result
Request Body
Code Samples
- Python (Streaming)
- Python (Synchronous)
- cURL (Streaming)
- cURL (Synchronous)
- JavaScript (Streaming)
- JavaScript (Synchronous)
Response
- 200 OK (Streaming)
- 200 OK (Synchronous)
- 400 Bad Request
- 500 Internal Server Error
- 504 Gateway Timeout
isComplete: true:Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Whether the request was successful (synchronous endpoint only). |
messageId | string | Unique identifier for the generation request. |
audio_url | string | Direct URL to download/stream the generated audio. |
album_art | string | URL to the generated album artwork. |
song_name | string | Name/title of the generated song. |
status | string | Status of the generation (e.g., “COMPLETED”, “PROCESSING”). |
content | string | Progress message (streaming endpoint only). |
isComplete | boolean | Whether generation is complete (streaming endpoint only). |
chunkIndex | integer | Current chunk index (streaming endpoint only). |
task_id | string | Task ID from the generation service (streaming endpoint only). |
Sample Output
Synchronous Response:Possible Errors
- Rate Limit Exceeded:
- Insufficient Balance:
- Invalid Prompt:
- NSFW Content Detected:
Notes
- Streaming vs Synchronous: Use the streaming endpoint (
/song-gen) for real-time progress updates, or the synchronous endpoint (/song-gen/sync) for a simple request-response pattern. - Lyrics Generation: If you don’t provide
lyrics, the system will automatically generate them based on yourprompt. - Duration: The
durationparameter controls the target length of the generated song in seconds. - Billing: This endpoint uses enterprise billing. Charges are deducted from your account balance based on the selected model and license type.

