Diffusion V2
Billing Rules
Each generate requestion returns 1 task id, and each task id can be used to query 2 songs and 2 cover images.
Each generate requestion costs $0.025
Basic Configuration
Base URL: https://api.foxaihub.com/api/v2/diffusion
Headers Parameters
{
"api-key": "Your API Key",
}
Submit the songs generation task
Endpoint: /task
Method: POST
Content-Type: application/json
HTTP Body, you can generate songs via Prompt or Compose
- Prompt
- Compose
- Compose Instrumental
- Extend
{
"topic":"celtic folk song, timeless soul with deep emotion and powerful vocals, female singer",
"instrumental": "true" // or false
}
title
can be empty
{
"title": "optional",
"conditions": [
{
"lyrics": "[Verse 1]\nIn waves of starlit magic\nMy heart turns so tragic\nYou say you love another\nWhile my mind turns static\nTell me what you need\nAs thoughts turn sporadic\nThis love fades faster than the titanic\n\n[Chorus]\nI float through endless melodies\nPast echoes of \"I'm sorry\"\nI just want another last chance\n\n[Verse 2]\nIn this ethereal haze, why am I alone?\nI just wanna be loved, drift with someone to hold\nMemories shimmer bright when I called on the phone\nBut now the calls you answer are his and not my own\n\n[Chorus]\nI float through endless melodies\nLost in this sweet romance\nPast echoes of \"I'm sorry\"\nI just want another last chance",
"strength": 0.5,
"condition_start": 0,
"condition_end": 1
},
{
"prompt": "dream,dream pop, pop",
"strength": 0.5,
"condition_start": 0,
"condition_end": 1
}
]
}
title
can be empty
{
"title": "optional",
"conditions": [
{
"lyrics": "[Instrumental]",
"strength": 0.5,
"condition_start": 0,
"condition_end": 1
},
{
"prompt": "dream,dream pop, pop",
"strength": 0.5,
"condition_start": 0,
"condition_end": 1
}
]
}
{
"title": "optional",
"conditions": [
{
"lyrics": "[Instrumental]",
"strength": 0.5,
"condition_start": 0,
"condition_end": 1
},
{
"prompt": "celtic folk song, timeless soul with deep emotion and powerful vocals, female singer",
"strength": 0.5,
"condition_start": 0,
"condition_end": 1
}
],
"morph": {
"riff_id": "b758f4ca-9d31-4d78-b46c-ea76ee09b983",
"transform": "extend",
"crop_end_at": 90.15723666816987,
"normalized_lyrics_strength": 0.7,
"normalized_sound_prompt_strength": 0.7,
"normalized_weirdness": 0.5,
"duration": 173.42056
}
}
Morph Parameters
Parameter | Type | Description |
---|---|---|
riff_id | string | The unique identifier of the source song that you want to extend or transform, not the task id, its from riff, you can find it in data field, when the status is "completed" |
duration | number | The duration of this riff id song in seconds |
transform | string | The transformation type, currently only supports "extend" |
crop_end_at | number | The timestamp (in seconds) where to end cropping the original song |
normalized_lyrics_strength | number | Controls how strongly the lyrics influence the generated music (0.0 to 1.0), Recommended to set as 0.7 |
normalized_sound_prompt_strength | number | Controls how strongly the sound prompt influences the generated music (0.0 to 1.0) Recommended to set as 0.7 |
normalized_weirdness | number | Controls the creativity/uniqueness of the generated music (0.0 to 1.0) Recommended to set as 0.5 |
if your params is no problem, it always response this
{
"success": true,
"task_id": "0196bd75-edf7-7000-841c-c24752207636"
}
Query Results
Endpoint: /task?ids=
You can query not more than 25 task ids at once, split theme by comma, like this
/task?ids=0196bd6d-57a4-7000-96c6-f74ee7998e5f,0196bd6d-acc0-7000-81ae-a56d8b0631b6
Method: GET
HTTP Response
- struction
- queued
- completed
- failed
Here is response data struction
[
{
"status": "pending",
"task_id": "0196bdae-7fa9-7000-b8d7-987519774a05",
"gen_params": {
"topic": "a good song",
"instrumental": "false"
},
"data": {},
"created_at": "2025-05-11T04:50:51.000Z"
}
]
[
{
"status": "queued",
"task_id": "0196bd6d-57a4-7000-96c6-f74ee7998e5f",
"gen_params": {
"topic": "celtic folk song, timeless soul with deep emotion and powerful vocals, female singer",
"instrumental": "true"
},
"data": [
"c1f6747a-49ba-4f16-9e51-08cae7bd134e",
"0c7dcdb2-0a2a-4eb3-aaf2-dec1bf77b655"
],
"created_at": "2025-05-11T03:39:41.000Z"
},
{
"status": "queued",
"task_id": "0196bd6d-acc0-7000-81ae-a56d8b0631b6",
"gen_params": {
"title": "optional",
"conditions": [
{
"lyrics": "[Verse 1]\nIn waves of starlit magic\nMy heart turns so tragic\nYou say you love another\nWhile my mind turns static\nTell me what you need\nAs thoughts turn sporadic\nThis love fades faster than the titanic\n\n[Chorus]\nI float through endless melodies\nPast echoes of \"I'm sorry\"\nI just want another last chance\n\n[Verse 2]\nIn this ethereal haze, why am I alone?\nI just wanna be loved, drift with someone to hold\nMemories shimmer bright when I called on the phone\nBut now the calls you answer are his and not my own\n\n[Chorus]\nI float through endless melodies\nLost in this sweet romance\nPast echoes of \"I'm sorry\"\nI just want another last chance",
"strength": 0.5,
"condition_end": 1,
"condition_start": 0
},
{
"prompt": "dream,dream pop, pop",
"strength": 0.5,
"condition_end": 1,
"condition_start": 0
}
]
},
"data": [
"1d27b3d1-d3b8-49eb-a267-7c282aa8b4c2",
"71c20fda-aec3-4fca-83d9-f836ce6814eb"
],
"created_at": "2025-05-11T03:40:03.000Z"
}
]
Once the status
= completed
, you can find the result in the data
field.
[
{
"status": "completed",
"task_id": "0196bd6d-57a4-7000-96c6-f74ee7998e5f",
"gen_params": {
"topic": "celtic folk song, timeless soul with deep emotion and powerful vocals, female singer",
"instrumental": "true"
},
"data": [
{
"id": "c1f6747a-49ba-4f16-9e51-08cae7bd134e",
"sound": "Celtic folk, haunting female vocals, acoustic instruments, ethereal harmonies",
"title": "Hidden",
"topic": "celtic folk song, timeless soul with deep emotion and powerful vocals, female singer",
"lyrics": "[Instrumental]",
"can_use": true,
"privacy": "unlisted",
"group_id": "",
"image_id": "c1f6747a-49ba-4f16-9e51-08cae7bd134e",
"audio_b64": null,
"audio_url": "https://storage.googleapis.com/corpusant-app-public/riffs/edd3980f-3553-418b-8792-26f37406febd/audio/c1f6747a-49ba-4f16-9e51-08cae7bd134e.m4a",
"author_id": "edd3980f-3553-418b-8792-26f37406febd",
"image_b64": null,
"image_url": "https://storage.googleapis.com/corpusant-app-public/riffs/edd3980f-3553-418b-8792-26f37406febd/image/c1f6747a-49ba-4f16-9e51-08cae7bd134e.jpg",
"transform": null,
"conditions": [
{
"t_end": 0,
"lyrics": "[Instrumental]",
"prompt": null,
"t_start": 1,
"strength": 0.5,
"vibe_input": null,
"condition_end": 1,
"condition_start": 0
},
{
"t_end": 0,
"lyrics": null,
"prompt": "Celtic folk, haunting female vocals, acoustic instruments, ethereal harmonies",
"t_start": 1,
"strength": 0.5,
"vibe_input": null,
"condition_end": 1,
"condition_start": 0
}
],
"created_at": "2025-05-11T03:40:56.837963Z",
"duration_s": 178.19596371882085,
"play_count": 0,
"is_favorite": false,
"favorite_count": 0,
"image_override": null,
"parent_riff_id": null,
"audio_upload_id": null,
"audio_variation": null,
"remix_parent_id": null,
"simple_waveform": null,
"allow_public_use": true,
"lyrics_timestamped": {
"words": [
{
"end": 87.04,
"text": "[Instrumental]",
"start": 0.64,
"line_index": 0,
"index_range": null,
"wav2vec2_format": null
}
]
},
"model_display_name": "FUZZ-1.0"
},
{
"id": "0c7dcdb2-0a2a-4eb3-aaf2-dec1bf77b655",
"sound": "Celtic folk, ethereal female vocals, traditional instruments, haunting melodies",
"title": "Wise Paths",
"topic": "celtic folk song, timeless soul with deep emotion and powerful vocals, female singer",
"lyrics": "[Instrumental]",
"can_use": true,
"privacy": "unlisted",
"group_id": "",
"image_id": "0c7dcdb2-0a2a-4eb3-aaf2-dec1bf77b655",
"audio_b64": null,
"audio_url": "https://storage.googleapis.com/corpusant-app-public/riffs/edd3980f-3553-418b-8792-26f37406febd/audio/0c7dcdb2-0a2a-4eb3-aaf2-dec1bf77b655.m4a",
"author_id": "edd3980f-3553-418b-8792-26f37406febd",
"image_b64": null,
"image_url": "https://storage.googleapis.com/corpusant-app-public/riffs/edd3980f-3553-418b-8792-26f37406febd/image/0c7dcdb2-0a2a-4eb3-aaf2-dec1bf77b655.jpg",
"transform": null,
"conditions": [
{
"t_end": 0,
"lyrics": "[Instrumental]",
"prompt": null,
"t_start": 1,
"strength": 0.5,
"vibe_input": null,
"condition_end": 1,
"condition_start": 0
},
{
"t_end": 0,
"lyrics": null,
"prompt": "Celtic folk, ethereal female vocals, traditional instruments, haunting melodies",
"t_start": 1,
"strength": 0.5,
"vibe_input": null,
"condition_end": 1,
"condition_start": 0
}
],
"created_at": "2025-05-11T03:40:55.580164Z",
"duration_s": 223.78607709750568,
"play_count": 0,
"is_favorite": false,
"favorite_count": 0,
"image_override": null,
"parent_riff_id": null,
"audio_upload_id": null,
"audio_variation": null,
"remix_parent_id": null,
"simple_waveform": null,
"allow_public_use": true,
"lyrics_timestamped": {
"words": [
{
"end": 79.36,
"text": "[Instrumental]",
"start": 0.64,
"line_index": 0,
"index_range": null,
"wav2vec2_format": null
}
]
},
"model_display_name": "FUZZ-1.0"
}
],
"created_at": "2025-05-11T03:39:41.000Z"
}
]
if task failed, the status
= failed
and ['data']['reason'] will give a reason of failure.
[
{
"status": "failed",
"task_id": "0196bdae-7fa9-7000-b8d7-987519774a05",
"gen_params": {
"topic": "fuck you , shit.",
"instrumental": "false"
},
"data": {
"data": {},
"reason": "moderation",
"is_flagged": true,
"musician_replacement_data": null
},
"created_at": "2025-05-11T04:50:51.000Z"
}
]
field
status
, enum type,pending
,processing
,queued
,completed
,failed
Use case
- we use the following params to generate a instrumental song firstly, with lyrics is also good.
{
"title": "optional",
"conditions": [
{
"lyrics": "[Instrumental]",
"strength": 0.5,
"condition_start": 0,
"condition_end": 1
},
{
"prompt": "celtic folk song, timeless soul with deep emotion and powerful vocals, female singer",
"strength": 0.5,
"condition_start": 0,
"condition_end": 1
}
]
}
we will get response like this
{
"success": true,
"task_id": "0196be8a-6e4f-7000-922d-0114a5e91ae6"
}
- Query the result by the
task_id
Once the status
equal completed
, you will get response like this
[
{
"status": "completed",
"task_id": "0196be8a-6e4f-7000-922d-0114a5e91ae6",
"gen_params": {
"topic": "celtic folk song, timeless soul with deep emotion and powerful vocals, female singer",
"instrumental": "true"
},
"data": [
{
"id": "b758f4ca-9d31-4d78-b46c-ea76ee09b983",
"sound": "Celtic folk, ethereal vocals, harp, fiddle, acoustic richness",
"title": "Celestial",
"topic": "celtic folk song, timeless soul with deep emotion and powerful vocals, female singer",
"lyrics": "[Instrumental]",
"can_use": true,
"privacy": "unlisted",
"group_id": "",
"image_id": "b758f4ca-9d31-4d78-b46c-ea76ee09b983",
"audio_b64": null,
"audio_url": "https://storage.googleapis.com/corpusant-app-public/riffs/1f186794-2ed2-4c98-9496-6bd7230795e5/audio/b758f4ca-9d31-4d78-b46c-ea76ee09b983.m4a",
"author_id": "1f186794-2ed2-4c98-9496-6bd7230795e5",
"image_b64": null,
"image_url": "https://storage.googleapis.com/corpusant-app-public/riffs/1f186794-2ed2-4c98-9496-6bd7230795e5/image/b758f4ca-9d31-4d78-b46c-ea76ee09b983.jpg",
"transform": null,
"conditions": [
{
"t_end": 0,
"lyrics": "[Instrumental]",
"prompt": null,
"t_start": 1,
"strength": 0.5,
"vibe_input": null,
"condition_end": 1,
"condition_start": 0
},
{
"t_end": 0,
"lyrics": null,
"prompt": "Celtic folk, ethereal vocals, harp, fiddle, acoustic richness",
"t_start": 1,
"strength": 0.5,
"vibe_input": null,
"condition_end": 1,
"condition_start": 0
}
],
"created_at": "2025-05-11T08:52:21.455020Z",
"duration_s": 173.42056689342402,
"play_count": 0,
"is_favorite": false,
"favorite_count": 0,
"image_override": null,
"parent_riff_id": null,
"audio_upload_id": null,
"audio_variation": null,
"remix_parent_id": null,
"simple_waveform": null,
"allow_public_use": true,
"lyrics_timestamped": {
"words": [
{
"end": 229.76,
"text": "[Instrumental]",
"start": 5.12,
"line_index": 0,
"index_range": null,
"wav2vec2_format": null
}
]
},
"model_display_name": "FUZZ-1.0"
},
{
"id": "8ca2be5f-5121-4ce3-b866-9313eb211b4d",
"sound": "Celtic soul fusion, ethereal vocals, traditional folk instruments, gospel-influenced harmonies",
"title": "Vivid Spirit",
"topic": "celtic folk song, timeless soul with deep emotion and powerful vocals, female singer",
"lyrics": "[Instrumental]",
"can_use": true,
"privacy": "unlisted",
"group_id": "",
"image_id": "8ca2be5f-5121-4ce3-b866-9313eb211b4d",
"audio_b64": null,
"audio_url": "https://storage.googleapis.com/corpusant-app-public/riffs/1f186794-2ed2-4c98-9496-6bd7230795e5/audio/8ca2be5f-5121-4ce3-b866-9313eb211b4d.m4a",
"author_id": "1f186794-2ed2-4c98-9496-6bd7230795e5",
"image_b64": null,
"image_url": "https://storage.googleapis.com/corpusant-app-public/riffs/1f186794-2ed2-4c98-9496-6bd7230795e5/image/8ca2be5f-5121-4ce3-b866-9313eb211b4d.jpg",
"transform": null,
"conditions": [
{
"t_end": 0,
"lyrics": "[Instrumental]",
"prompt": null,
"t_start": 1,
"strength": 0.5,
"vibe_input": null,
"condition_end": 1,
"condition_start": 0
},
{
"t_end": 0,
"lyrics": null,
"prompt": "Celtic soul fusion, ethereal vocals, traditional folk instruments, gospel-influenced harmonies",
"t_start": 1,
"strength": 0.5,
"vibe_input": null,
"condition_end": 1,
"condition_start": 0
}
],
"created_at": "2025-05-11T08:52:21.161221Z",
"duration_s": 224.56360544217688,
"play_count": 0,
"is_favorite": false,
"favorite_count": 0,
"image_override": null,
"parent_riff_id": null,
"audio_upload_id": null,
"audio_variation": null,
"remix_parent_id": null,
"simple_waveform": null,
"allow_public_use": true,
"lyrics_timestamped": {
"words": [
{
"end": 219.52,
"text": "[Instrumental]",
"start": 1.92,
"line_index": 0,
"index_range": null,
"wav2vec2_format": null
}
]
},
"model_display_name": "FUZZ-1.0"
}
],
"created_at": "2025-05-11T08:51:05.000Z"
}
]
we can find two ids in data
array, it's ids from riff. It's also song ids.
- if you want to extend the first song, please use song id, not task id.
Maintain the conditions
unchanged.
But if it is music with lyrics. Please provide the complete lyrics after modifications.
As for the parameters of the morph
field, please refer to the documentation in the Extend tab.
{
"title": "optional",
"conditions": [
{
"lyrics": "[Instrumental]",
"strength": 0.5,
"condition_start": 0,
"condition_end": 1
},
{
"prompt": "celtic folk song, timeless soul with deep emotion and powerful vocals, female singer",
"strength": 0.5,
"condition_start": 0,
"condition_end": 1
}
],
"morph": {
"riff_id": "b758f4ca-9d31-4d78-b46c-ea76ee09b983",
"transform": "extend",
"crop_end_at": 90.15723666816987,
"normalized_lyrics_strength": 0.7,
"normalized_sound_prompt_strength": 0.7,
"normalized_weirdness": 0.5,
"duration": 173.42056
}
}
- After submission, we will obtain a new task ID, and then use it to check the results according to the task ID.