Skip to main content

Generate Music

POST 

/api/v1/generate

Generate music with or without lyrics using AI models.

Usage Guide

  • This endpoint creates music based on your text prompt
  • Multiple variations will be generated for each request
  • You can control detail level with custom mode and instrumental settings

Parameter Details

  • In Custom Mode (customMode: true):

    • If instrumental: true: style and title are required
    • If instrumental: false: style, prompt, and title are required
    • prompt length limit: 3000 characters
    • style length limit: 200 characters
    • title length limit: 80 characters
  • In Non-custom Mode (customMode: false):

    • Only prompt is required regardless of instrumental setting
    • prompt length limit: 400 characters
    • Other parameters should be left empty

Developer Notes

  • Recommendation for new users: Start with customMode: false for simpler usage
  • Generated files are retained for 14 days
  • Callback process has three stages: text (text generation), first (first track complete), complete (all tracks complete)

Request

Responses

Request successful

Callbacks

POST 

{request.body#/callBackUrl}

System will call this callback when audio generation is complete.

Callback Example

{
"code": 200,
"msg": "All generated successfully.",
"data": {
"callbackType": "complete",
"task_id": "2fac****9f72",
"data": [
{
"id": "8551****662c",
"audio_url": "https://example.cn/****.mp3",
"stream_audio_url": "https://example.cn/****",
"image_url": "https://example.cn/****.jpeg",
"prompt": "[Verse] Night city lights shining bright",
"model_name": "chirp-v3-5",
"title": "Iron Man",
"tags": "electrifying, rock",
"createTime": "2025-01-01 00:00:00",
"duration": 198.44
},
{
"id": "bd15****1873",
"audio_url": "https://example.cn/****.mp3",
"stream_audio_url": "https://example.cn/****",
"image_url": "https://example.cn/****.jpeg",
"prompt": "[Verse] Night city lights shining bright",
"model_name": "chirp-v3-5",
"title": "Iron Man",
"tags": "electrifying, rock",
"createTime": "2025-01-01 00:00:00",
"duration": 228.28
}
]
}
}

Callbacks Responses

Callback received successfully