Stream Composed Music
Stream a composed song from a prompt or a composition plan.
Query parameters
Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models.
Headers
Your API key. This is required by most endpoints to access our API programmatically. You can view your xi-api-key using the 'Profile' tab on the website.
Your API key. This is required by most endpoints to access our API programmatically. You can view your xi-api-key using the 'Profile' tab on the website.
Request body
Example request
{
"music_prompt": {
"negative_global_styles": [
"metal",
"hip-hop",
"country"
],
"positive_global_styles": [
"pop",
"rock",
"jazz"
],
"sections": [
{
"duration_ms": 10000,
"lines": [
"Verse 1 lyrics"
],
"negative_local_styles": [
"metal",
"hip-hop",
"country"
],
"positive_local_styles": [
"pop",
"rock",
"jazz"
],
"section_name": "Verse 1"
}
]
},
"composition_plan": {
"negative_global_styles": [
"metal",
"hip-hop",
"country"
],
"positive_global_styles": [
"pop",
"rock",
"jazz"
],
"sections": [
{
"duration_ms": 10000,
"lines": [
"Verse 1 lyrics"
],
"negative_local_styles": [
"metal",
"hip-hop",
"country"
],
"positive_local_styles": [
"pop",
"rock",
"jazz"
],
"section_name": "Verse 1"
}
]
}
}Response
Streaming audio data in the format specified
Changes
Changed in 4 of the 49 revisions of this API.13
- ●
deleted the
queryrequest parameterenable_loggingrequest-parameter-removed
- ●
- ○
added the new optional
queryrequest parameterenable_loggingnew-optional-request-parameter
- ○
- ○
added the new
music_v2_5enum value to the request propertyrequest-property-enum-value-added
- ○
- ○
the
//////request property's maxLength was increased from6000to6132request-property-max-length-increased
- ○