Skip to main content

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.
ParameterTypeRequired?Description
userIdstring✅ RequiredUser ID requesting the operation.
projectIdstring✅ RequiredProject ID for organizing generations.
promptstring✅ RequiredPrompt describing the song you want to generate (e.g., “A happy upbeat pop song about summer”).
lyricsstring⚠️ OptionalLyrics for the song. If not provided, lyrics will be automatically generated from the prompt.
durationinteger⚠️ OptionalDuration in seconds. Default: 30.
modelstring⚠️ OptionalAI model to use. Default: mureka-7.5.
parametersobject⚠️ OptionalAdditional parameters for advanced customization.
Note: If lyrics is not provided, the system will automatically generate lyrics based on your prompt. Providing both prompt and lyrics gives you more control over the final output.

Endpoints

This API provides two endpoints:
  1. Streaming Endpoint (/v5/generate/song-gen): Returns real-time progress updates via Server-Sent Events (SSE)
  2. Synchronous Endpoint (/v5/generate/song-gen/sync): Waits for completion and returns the final result

Request Body

{
  "userId": "string",
  "projectId": "string",
  "prompt": "string",
  "lyrics": "string",
  "duration": 30,
  "model": "mureka-7.5",
  "parameters": {}
}

Code Samples

import requests

url = "https://api.soundverse.ai/v5/generate/song-gen"
headers = {
    "Authorization": "Bearer your_api_key_here",
    "Content-Type": "application/json"
}
payload = {
    "userId": "your_user_id",
    "projectId": "your_project_id",
    "prompt": "A happy upbeat pop song about summer days",
    "lyrics": "Verse 1: Walking down the beach, feeling the sun...",
    "duration": 30,
    "model": "mureka-7.5"
}

response = requests.post(url, json=payload, headers=headers, stream=True)

# Process streaming response
for line in response.iter_lines():
    if line:
        data = json.loads(line.decode('utf-8'))
        print(data)

Response

{
  "content": "Starting song generation...",
  "isComplete": false,
  "chunkIndex": 1,
  "tokens": 10,
  "totalTokens": 10,
  "task_id": null,
  "status": null,
  "album_art": null,
  "song_name": null,
  "error": false
}
Streaming chunks continue until isComplete: true:
{
  "content": "Song generation completed successfully!",
  "isComplete": true,
  "chunkIndex": 5,
  "tokens": 150,
  "totalTokens": 500,
  "task_id": "123456789",
  "status": "COMPLETED",
  "album_art": "https://storage.soundverse.ai/.../album_art.png",
  "song_name": "Summer Days",
  "audio_url": "https://storage.soundverse.ai/.../song.mp3",
  "error": false
}

Response Fields

FieldTypeDescription
successbooleanWhether the request was successful (synchronous endpoint only).
messageIdstringUnique identifier for the generation request.
audio_urlstringDirect URL to download/stream the generated audio.
album_artstringURL to the generated album artwork.
song_namestringName/title of the generated song.
statusstringStatus of the generation (e.g., “COMPLETED”, “PROCESSING”).
contentstringProgress message (streaming endpoint only).
isCompletebooleanWhether generation is complete (streaming endpoint only).
chunkIndexintegerCurrent chunk index (streaming endpoint only).
task_idstringTask ID from the generation service (streaming endpoint only).

Sample Output

Synchronous Response:
{
  "success": true,
  "messageId": "6937bbb3d86e0fd7b969dbf1",
  "audio_url": "https://storage.soundverse.ai/x-one/69344de79f665b78cb97f347/userData/audios/song_1765054186.mp3",
  "album_art": "https://storage.soundverse.ai/x-one/69344de79f665b78cb97f347/userData/album-arts/album_art_1765054186.webp",
  "song_name": "Summer Days",
  "status": "COMPLETED"
}
Streaming Response (Final Chunk):
{
  "content": "✅ Song generation completed successfully!",
  "isComplete": true,
  "chunkIndex": 5,
  "tokens": 150,
  "totalTokens": 500,
  "task_id": "123456789",
  "status": "COMPLETED",
  "album_art": "https://storage.soundverse.ai/x-one/69344de79f665b78cb97f347/userData/album-arts/album_art_1765054186.webp",
  "song_name": "Summer Days",
  "audio_url": "https://storage.soundverse.ai/x-one/69344de79f665b78cb97f347/userData/audios/song_1765054186.mp3",
  "error": false
}

Possible Errors

  • Rate Limit Exceeded:
{
  "success": false,
  "message": "Rate limits have been passed for the user."
}
  • Insufficient Balance:
{
  "success": false,
  "message": "Insufficient balance for this operation."
}
  • Invalid Prompt:
{
  "detail": "Invalid or empty prompt provided"
}
  • NSFW Content Detected:
{
  "success": false,
  "message": "NSFW words detected. Please try again with different lyrics."
}

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 your prompt.
  • Duration: The duration parameter 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.