Skip to main content

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

{
"topic":"celtic folk song, timeless soul with deep emotion and powerful vocals, female singer",
"instrumental": "true" // or false
}

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

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"
}
]

field

  • status, enum type, pending, processing, queued, completed, failed

Use case

  1. 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"
}
  1. 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.

  1. 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
}
}
  1. After submission, we will obtain a new task ID, and then use it to check the results according to the task ID.