{
  "openapi": "3.1.0",  
  "info": {
    "title": "Musicgpt API",
    "version": "1.0.0",
    "description": "API for retrieving conversion details by ID."
  },
  "servers": [
    {
      "url": "https://api.musicgpt.com/api/public",
      "description": "Production server"
    }
  ],
  "paths": {
    "/v1/byId": {
      "get": {
        "summary": "Get Conversion by ID",
        "description": "Retrieve details of a conversion using `task_id` or `conversion_id`.",
        "parameters": [
          {
            "name": "conversionType",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": ["MUSIC_AI", "TEXT_TO_SPEECH", "VOICE_CONVERSION", "EXTRACTION", "COVER", "STEMS_SEPARATION", "VOCAL_EXTRACTION", "DENOISING", "DEECHO", "DEREVERB", "SOUND_GENERATOR", "AUDIO_TRANSCRIPTION", "AUDIO_SPEED_CHANGER", "AUDIO_MASTERING", "AUDIO_CUTTER", "REMIX","FILE_CONVERT","KEY_BPM_EXTRACTION","AUDIO_TO_MIDI","EXTEND","INPAINT","SING_OVER_INSTRUMENTAL","LYRICS_GENERATOR" ]                  
            },
            "description": "The type of Conversion you want to get your details from.",
            "example": "MUSIC_AI"
          },
          {
            "name": "task_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Task ID associated with the conversion. \n **Note:** You must provide either `task_id` or `conversion_id`, but not both.",
            "example": "12345678-abcd-1234-efgh-567890abcdef"
          },
          {
            "name": "conversion_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Conversion ID to fetch details. \n **Note:** You must provide either `task_id` or `conversion_id`, but not both.",
            "example": "87654321-dcba-4321-hgfe-098765fedcba" 
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved conversion details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean" },
                    "conversion": {
                      "type": "object",
                      "properties": {
                        "task_id": { "type": "string" },
                        "feature": { "type": "string" },
                        "status": { "type": "string" },
                        "message": { "type": "string" },
                        "webhook_url": { "type": "string" },
                        "createdAt": { "type": "string" },
                        "updatedAt": { "type": "string" },
                        "conversion_id_1": { "type": "string" },
                        "conversion_id_2": { "type": "string" },
                        "title_1": { "type": "string" },
                        "lyrics_1": { "type": "string" },
                        "sounds_1": { "type": "string" },
                        "conversion_path_1": { "type": "string" },
                        "album_cover_path": { "type": "string" },
                        "lyrics_timestamped_1": { "type": "string" },
                        "conversion_duration_1": { "type": "number", "format": "float" },
                        "conversion_path_wav_1": { "type": "string" },
                        "is_streaming_request": { "type": "boolean" },
                        "album_cover_thumbnail": { "type": "string" },
                        "is_streaming_available": { "type": "boolean" },
                        "generation_completed_at": { "type": "string" },
                        "title_2": { "type": "string" },
                        "lyrics_2": { "type": "string" },
                        "sounds_2": { "type": "string" },
                        "conversion_path_2": { "type": "string" },
                        "lyrics_timestamped_2": { "type": "string" },
                        "conversion_duration_2": { "type": "number", "format": "float" },
                        "conversion_path_wav_2": { "type": "string" }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "conversion": {
                    "task_id": "15b6437f-e3af-5b5d-b2f4-14cb141f313a",
                    "feature": "MUSIC_AI",
                    "status": "COMPLETED",
                    "message": "Audio conversion completed",
                    "webhook_url": "https://example.com/webhook",
                    "createdAt": "2026-08-17T17:07:40.557077+00:00",
                    "updatedAt": "2026-08-17T17:11:35.746277+00:00",
                    "conversion_id_1": "5400f093-4321-56ab-84df-6630f448ff52",
                    "conversion_id_2": "ac5e80ee-504c-58c4-b028-265effb05ff7",
                    "title_1": "Sugar Cup",
                    "lyrics_1": "..",
                    "sounds_1": "",
                    "conversion_path_1": "https://cdn1.musicgpt.com/conversions/api/standard/5400f093-4321-56ab-84df-6630f448ff52/5400f093-4321-56ab-84df-6630f448ff52.mp3",
                    "album_cover_path": "https://cdn1.musicgpt.com/img-gen-pipeline/api/15b6437f-e3af-5b5d-b2f4-14cb141f313a.jpg",
                    "lyrics_timestamped_1": "...",
                    "conversion_duration_1": 208.28,
                    "conversion_path_wav_1": "https://cdn1.musicgpt.com/conversions/api/hq/5400f093-4321-56ab-84df-6630f448ff52/5400f093-4321-56ab-84df-6630f448ff52.wav",
                    "is_streaming_request": true,
                    "album_cover_thumbnail": "https://cdn1.musicgpt.com/img-gen-pipeline/api/15b6437f-e3af-5b5d-b2f4-14cb141f313a_thumb.jpg",
                    "is_streaming_available": true,
                    "generation_completed_at": "2026-08-17 17:11:27.054 +0000",
                    "title_2": "Sugar Cup",
                    "lyrics_2": "...",
                    "sounds_2": "",
                    "conversion_path_2": "https://cdn1.musicgpt.com/conversions/api/standard/ac5e80ee-504c-58c4-b028-265effb05ff7/ac5e80ee-504c-58c4-b028-265effb05ff7.mp3",
                    "lyrics_timestamped_2": "...",
                    "conversion_duration_2": 247.84,
                    "conversion_path_wav_2": "https://cdn1.musicgpt.com/conversions/api/hq/ac5e80ee-504c-58c4-b028-265effb05ff7/ac5e80ee-504c-58c4-b028-265effb05ff7.wav"
                  }
                }
              }
            }
          },
          "422": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "UNPROCESSABLE_CONTENT",
              "message": ""
            }
          }
        }
      }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    
    "/v1/searchVoices": {
      "get": {
        "summary": "Get Voices by Name",
        "description": "Search for voices to get their voice ID by their names using a query string.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The search string to filter voices by name"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 20
            },
            "description": "Maximum number of voices per page"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0
            },
            "description": "Page number for pagination"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "voices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "voice_id": {
                            "type": "string"
                          },
                          "voice_name": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "total": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "voices": [
                    {
                      "voice_id": "JustinBieber",
                      "voice_name": "Justin Bieber"
                    }
                  ],
                  "limit": 20,
                  "page": 0,
                  "total": 2
                }
              }
            }
          },
          "500": {
  "description": "Internal Server Error",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "error_code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "example": {
        "success": false,
        "error_code": "INTERNAL_SERVER_ERROR",
        "message": ""
      }
    }
  }
}
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/v1/getAllVoices": {
      "get": {
        "summary": "Get All Voices",
        "description": "Fetch all available voices with their IDs.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 20
            },
            "description": "Maximum number of voices per page"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0
            },
            "description": "Page number for pagination"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "voices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "voice_id": {
                            "type": "string"
                          },
                          "voice_name": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "total": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "voices": [
                    {
                      "voice_id": "00126f62-1f31-434a-abc6-a5e958a737e3",
                      "voice_name": "Joji"
                    },
                    {
                      "voice_id": "0031cf05-6d3d-4c15-9115-d8236590b957",
                      "voice_name": "Amy Winehouse"
                    }
                  ],
                  "limit": 20,
                  "page": 0,
                  "total": 3108
                }
              }
            }
          },
          "500": {
  "description": "Internal Server Error",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "error_code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "example": {
        "success": false,
        "error_code": "INTERNAL_SERVER_ERROR",
        "message": ""
      }
    }
  }
}
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/v1/MusicAI": {
      "post": {
        "summary": "Generate Custom Music",
        "description": "Create music powered by AI using just a prompt, lyrics, or a defined music style.",
        "deprecated": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "prompt": {
                    "type": "string",
                    "description": "A natural language prompt for music generation. Keep it under 1000 characters. Be clear and descriptive for better results.",
                    "example": "A happy, upbeat song about summer"
                  },
                  "music_style": {
                    "type": "string",
                    "description": "Style of music to generate (e.g., Rock, Pop)",
                    "example": ""
                  },
                  "lyrics": {
                    "type": "string",
                    "description": "Custom lyrics for the generated music"
                  },
                  "title": {
                    "type": "string",
                    "description": "Title of the generated music track",
                    "example": "My Generated Track"
                  },
                  "make_instrumental": {
                    "type": "boolean",
                    "description": "Whether to make the music instrumental",
                    "default": false
                  },
                  "vocal_only": {
                    "type": "boolean",
                    "description": "Whether to generate only vocals of output audio",
                    "default": false
                  },
                  "gender": {
                    "type": "string",
                    "description": "Gender of the voice model",
                    "example": ""
                  },
                  "voice_id": {
                    "type": "string",
                    "description": "Voice model to convert generated audio"
                  },
                  
                  "generate_album_cover": {
                    "type": "boolean",
                    "description": "Whether to generate an album cover for the generated audio",
                    "default": true
                  },
                  "webhook_url": {
                    "type": "string",
                    "description": "URL for callback upon completion",
                    "example": "https://example.com/my-webhook"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "task_id": {
                      "type": "string"
                    },
                    "conversion_id_1": {
                      "type": "string"
                    },
                    "conversion_id_2": {
                      "type": "string"
                    },
                    "eta": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Message published to queue",
                  "task_id": "4fc2cdba-005d-4d14-a208-5fb02a2809da",
                  "conversion_id_1": "05092d5c-f8b1-4c96-a4a3-45bc00de6268",
                  "conversion_id_2": "52fcd3b6-3925-41ed-b4c6-aee17a29e40b",
                  "eta": 154
                }
              }
            }
          },
          "402": {
  "description": "Payment Required",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "error_code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "example": {
        "success": false,
        "error_code": "INSUFFICIENT_CREDITS",
        "message": ""
      }
    }
  }
},
"422": {
  "description": "Unprocessable Entity",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "error_code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "example": {
        "success": false,
        "error_code": "UNPROCESSABLE_CONTENT",
        "message": ""
      }
    }
  }
},
"500": {
  "description": "Internal Server Error",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "error_code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "example": {
        "success": false,
        "error_code": "INTERNAL_SERVER_ERROR",
        "message": ""
      }
    }
  }
}
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/v2/MusicAI": {
      "post": {
        "summary": "Generate Custom Music",
        "description": "Create music powered by AI using just a prompt, lyrics, or a defined music style.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "prompt": {
                    "type": "string",
                    "description": "A natural language prompt for music generation. Keep it under 1000 characters. Be clear and descriptive for better results.",
                    "example": "A happy, upbeat song about summer"
                  },
                  "music_style": {
                    "type": "string",
                    "description": "Style of music to generate (e.g., Rock, Pop)",
                    "example": ""
                  },
                  "lyrics": {
                    "type": "string",
                    "description": "Custom lyrics for the generated music"
                  },
                  "make_instrumental": {
                    "type": "boolean",
                    "description": "Whether to make the music instrumental",
                    "default": false
                  },
                  "vocal_only": {
                    "type": "boolean",
                    "description": "Whether to generate only vocals of output audio",
                    "default": false
                  },
                  "title": {
                    "type": "string",
                    "description": "Title of the generated music track",
                    "example": "My Generated Track"
                  },
                  "gender": {
                    "type": "string",
                    "description": "Gender of the voice model",
                    "example": ""
                  },
                   "voice_id": {
                    "type": "string",
                    "description": "Voice model to convert generated audio",
                    "example": ""
              
                  },
                  "generate_album_cover": {
                    "type": "boolean",
                    "description": "Whether to generate an album cover for the generated audio",
                    "default": false
                  },
                  "lyrics_timestamps": {
                    "type": "boolean",
                    "description": "Whether to generate timestamps for the lyrics",
                    "default": false
                  },
                  "model": {
                    "type": "string",
                    "description": "Model version to use for generation",
                    "example": "v7",
                    "enum": [
                      "v6",
                      "v6-pro",
                      "v7",
                      "v7-pro"
                    ]
                  },
                  "webhook_url": {
                    "type": "string",
                    "description": "URL for callback upon completion",
                    "example": "https://example.com/my-webhook"
                  }
                  
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "task_id": {
                      "type": "string"
                    },
                    "conversion_id_1": {
                      "type": "string"
                    },
                    "conversion_id_2": {
                      "type": "string"
                    },
                    "eta": {
                      "type": "integer"
                    },
                    "is_flagged": {
                      "type": "boolean"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "credit_estimate": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Message published to queue",
                  "task_id": "50c04348-7077-5ffd-a407-55f031db20ef",
                  "eta": 154,
                  "conversion_id_1": "5a2c6385-e2e1-5531-a530-aab3ff040a3c",
                  "conversion_id_2": "e3c65d75-d1fd-549c-9e63-4b303a01cd23",
                  "is_flagged": false,
                  "reason": "",
                  "credit_estimate": 0.06
                }
              }
            }
          },
          "402": {
  "description": "Payment Required",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "error_code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "example": {
        "success": false,
        "error_code": "INSUFFICIENT_CREDITS",
        "message": ""
      }
    }
  }
},
"422": {
  "description": "Unprocessable Entity",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "error_code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "example": {
        "success": false,
        "error_code": "UNPROCESSABLE_CONTENT",
        "message": ""
      }
    }
  }
},
"500": {
  "description": "Internal Server Error",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "error_code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "example": {
        "success": false,
        "error_code": "INTERNAL_SERVER_ERROR",
        "message": ""
      }
    }
  }
}
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
"/v1/VoiceChanger": {
  "post": {
    "summary": "Convert voice from audio file or URL",
    "description": "Convert the voice from an audio file or URL to a different voice.",
    "requestBody": {
      "required": true,
      "content": {
        "multipart/form-data": {
          "schema": {
            "type": "object",
            "properties": {
              "audio_url": {
                "type": "string",
                "description": "Input audio URL (supported format: YouTube URL)."
              },
              "audio_file": {
                "type": "string",
                "format": "binary",
                "description": "Audio file to upload"
              },
              "voice_id": {
                "type": "string",
                "description": "Voice model ID"
               
              },
              "remove_background": {
                "type": "integer",
                "description": "1 to remove background noise, 0 to keep",
                "default": 0,
                "enum": [0, 1]
              },
              "pitch": {
                "type": "integer",
                "description": "Pitch adjustment (-12 to +12)",
                "default": 0,
                "minimum": -12,
                "maximum": 12
              },
              "webhook_url": {
                "type": "string",
                "description": "Callback URL",
                "example": "https://example.com/callback"
              }
            },
            "required": ["voice_id"],
            "anyOf": [
              { "required": ["audio_url"] },
              { "required": ["audio_file"] }
            ]
          }
        }
      }
    },
    "responses": {
      "200": {
  "description": "Successfully initiated task",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean" },
          "task_id": { "type": "string" },
          "conversion_id": { "type": "string" },
          "eta": { "type": "integer" },
          "credit_estimate": { "type": "number" },
          "message": { "type": "string" },
          "status": { "type": "string" }
        },
        "example": {
          "success": true,
          "task_id": "fdcca59e-9788-43fc-9ee6-e9983064c432",
          "conversion_id": "3b8dd3e8-104a-4a2f-86ba-3ed722f5190a",
          "eta": 16,
          "credit_estimate": 1.07,
          "message": "",
          "status": "IN_QUEUE"
        }
      }
    }
  }
},
      "402": {
        "description": "Payment Required",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INSUFFICIENT_CREDITS",
              "message": ""
            }
          }
        }
      },
      "422": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "UNPROCESSABLE_CONTENT",
              "message": ""
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INTERNAL_SERVER_ERROR",
              "message": ""
            }
          }
        }
      }
    },
    "security": [
      {
        "ApiKeyAuth": []
      }
    ],
    "x-codeSamples": 
    [
  {
    "lang": "Python",
    "source": "import requests\n\nurl = \"https://api.musicgpt.com/api/public/v1/VoiceChanger\"\n\nheaders = {\n    \"Authorization\": \"<API_KEY>\"\n}\n\ndata = {\n    \"voice_id\": \"<VOICE_ID>\",\n    \"remove_background\": 1,\n    \"pitch\": 0,\n    \"webhook_url\": \"https://example.com/my-webhook\"\n}\n\n# Option 1: audio_url\ndata[\"audio_url\"] = \"<YOUR_AUDIO_URL>\"\nresponse = requests.post(url, headers=headers, data=data)\n\n# Option 2: File Upload\n# with open(\"song.mp3\", \"rb\") as f:\n#     files = {\"audio_file\": f}\n#     response = requests.post(url, headers=headers, data=data, files=files)\n\nprint(response.json())"
  }
]
  }
},  
"/v1/Cover": {
  "post": {
    "summary": "Convert audio to cover song",
    "description": "Convert an audio file or URL into a cover song using a different voice.",
    "requestBody": {
      "required": true,
      "content": {
        "multipart/form-data": {
          "schema": {
            "type": "object",
            "properties": {
              "audio_url": {
                "type": "string",
                "description": "Input audio URL (supported format: YouTube URL)."
              
              },
              "audio_file": {
                "type": "string",
                "format": "binary",
                "description": "Audio file to upload and process. Either audio_file or audio_url must be provided."
              },
              "voice_id": {
                "type": "string",
                "description": "The ID of the voice model to use for voice transformation."
             
              },
              "pitch": {
                "type": "integer",
                "description": "Pitch adjustment for the voice. Range from -12 to 12. Default: 0",
                "default": 0,
                "minimum": -12,
                "maximum": 12
              },
              "webhook_url": {
                "type": "string",
                "description": "A URL where the result will be sent once processing is completed.",
                "example": "https://example.com/callback"
              }
            },
            "required": ["voice_id"] ,
            "anyOf": [
              { "required": ["audio_url"] },
              { "required": ["audio_file"] }
            ]
          }
        }
      }
    },
    "responses": {
      "200": {
  "description": "Successfully initiated task",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean" },
          "task_id": { "type": "string" },
          "conversion_id": { "type": "string" },
          "eta": { "type": "integer" },
          "credit_estimate": { "type": "number" },
          "message": { "type": "string" },
          "status": { "type": "string" }
        },
        "example": {
          "success": true,
          "task_id": "3d137437-4911-4669-b639-9e5701107c25",
          "conversion_id": "b764b4f6-a842-42dd-a55b-818eb8251dc7",
          "eta": 71,
          "credit_estimate": 1.27,
          "message": "Message published to queue",
          "status": "IN_QUEUE"
        }
      }
    }
  }
},
      "402": {
        "description": "Payment Required",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INSUFFICIENT_CREDITS",
              "message": ""
            }
          }
        }
      },
      "422": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "UNPROCESSABLE_CONTENT",
              "message": ""
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INTERNAL_SERVER_ERROR",
              "message": ""
            }
          }
        }
      }
    },
    "security": [
      {
        "ApiKeyAuth": []
      }
    ],
    "x-codeSamples": [
  {
    "lang": "Python",
    "source": "import requests\n\nurl = \"https://api.musicgpt.com/api/public/v1/Cover\"\n\nheaders = {\n    \"Authorization\": \"<API_KEY>\"\n}\n\ndata = {\n    \"voice_id\": \"e0bb585f-b798-4bac-ac4e-de7fff38f9d7\",\n    \"pitch\": 0,\n    \"webhook_url\": \"https://example.com/my-webhook\"\n}\n\n# Option 1: audio_url\ndata[\"audio_url\"] = \"<YOUR_AUDIO_URL>\"\nresponse = requests.post(url, headers=headers, data=data)\n\n# Option 2: File Upload\n# with open(\"song.mp3\", \"rb\") as f:\n#     files = {\"audio_file\": f}\n#     response = requests.post(url, headers=headers, data=data, files=files)\n\nprint(response.json())"
  }
]
  }
},

"/v1/TextToSpeech": {
  "post": {
    "summary": "Convert text to speech using a specified voice",
    "description": "Synthesize speech from text with voice and gender customization, plus optional webhook callback.  \nGive priority to the sample audio first, then to the voice ID, and lastly to gender.",
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string",
                "description": "Text to convert to speech",
                "example": "Hello, this is a sample text to speech conversion."
              },
              "voice_id": {
                "type": "string",
                "description": "Voice model ID",
                "example": "e1cb7380-e3db-433a-b186-a996d7545986"
              },
              "gender": {
                "type": "string",
                "description": "Gender preference for the voice (e.g., \"male\", \"female\")",
                "example": ""
              },
              "sample_audio_url":{
                "type":"string",
                "description":"An audio URL containing a voice sample of the target speaker without music or overlapping voices. Recommended over voice_id for better output quality.",
                "example":"<YOUR_AUDIO_URL>"
              },
              "webhook_url": {
                "type": "string",
                "description": "Callback URL for async processing",
                "example": "https://example.com/my-webhook"

              }
            },
            "required": ["text"],
            "anyOf": [
                { "required": ["sample_audio_url"] },
                { "required": ["voice_id"] }
              ]
          }
        }
      }
    },
    "responses": {
      "200": {
        "description": "Successfully initiated task",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": { "type": "boolean" },
                "task_id": { "type": "string" },
                "conversion_id": { "type": "string" },
                "eta": {
                  "type": "integer",
                  "description": "Estimated processing time in seconds"
                },
                "credit_estimate": { "type": "number", "format": "float" },
                "message": { "type": "string" },
                "status": { "type": "string" }
              }
            },
            "example": {
              "success": true,
              "task_id": "0a65cbb6-2ab8-4949-9ee0-0e8c138ac2cf",
              "conversion_id": "6542baa6-d61f-4d90-b832-ed929d9c0996",
              "eta": 17,
              "credit_estimate": 0.68,
              "message": "",
              "status": "IN_QUEUE"
            }
          }
        }
      },
      "402": {
  "description": "Payment Required",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "error_code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "example": {
        "success": false,
        "error_code": "INSUFFICIENT_CREDITS",
        "message": ""
      }
    }
  }
},
"422": {
  "description": "Unprocessable Entity",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "error_code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "example": {
        "success": false,
        "error_code": "UNPROCESSABLE_CONTENT",
        "message": ""
      }
    }
  }
},
"500": {
  "description": "Internal Server Error",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "error_code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "example": {
        "success": false,
        "error_code": "INTERNAL_SERVER_ERROR",
        "message": ""
      }
    }
  }
}
    },
    "security": [
      {
        "ApiKeyAuth": []
      }
    ]
  }
}, 
"/v2/Extraction": {
    "post": {
      "summary": "Extract stems from an audio file or URL",
      "description": "Process an audio file to extract specified stems (vocals, instrumental, or other components) with optional preprocessing. Supports file upload or URL with webhook callback.",
      "requestBody": {
        "required": true,
        "content": {
          "multipart/form-data": {
            "schema": {
              "type": "object",
              "properties": {
                "audio_url": {
                  "type": "string",
                  "description": "Input audio URL (supported format: YouTube URL)."
                },
                "audio_file": {
                  "type": "string",
                  "format": "binary",
                  "description": "Audio file to upload and process."
                },
                "stems": {
                  "type": "string",
                  "default": "[]",
                  "description": "JSON string list of required output stems. Available options: vocals, instrumental, male_vocal, female_vocal, lead_vocal, back_vocal, bass, drums, guitar, piano, keys, strings, winds, rhythm_guitar, solo_guitar, acoustic_guitar, electric_guitar, kick_drum, snare_drum, toms, hi_hat, ride, crash.",
                  "example": "[\"vocals\", \"drums\"]"
                },
                "preprocessing_options": {
                  "type": "string",
                  "default": "[]",
                  "description": "JSON string list of preprocessing steps. Available options: Denoise, Deecho, Dereverb.",
                  "example": "[\"Denoise\", \"Dereverb\"]"
                },
                "eco_mode": {
                  "type": "boolean",
                  "default": false,
                  "description": "Enable eco mode for faster parallel extraction."
                },
                "webhook_url": {
                  "type": "string",
                  "description": "Callback URL for async processing.",
                  "example": "http://webhook.musicgpt.com"
                }
              },
              "anyOf": [
                { "required": ["audio_url"] },
                { "required": ["audio_file"] }
              ]
            }
          }
        }
      },
      "responses": {
        "200": {
          "description": "Successfully initiated stem extraction",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "success": { "type": "boolean" },
                  "task_id": { "type": "string" },
                  "conversion_id": { "type": "string" },
                  "eta": { "type": "integer" },
                  "credit_estimate": { "type": "number" },
                  "message": { "type": "string" },
                  "status": { "type": "string" }
                },
                "example": {
                  "success": true,
                  "task_id": "98bb0a78-854b-4ca7-a145-834c1ac73901",
                  "conversion_id": "7c38aa60-e0c8-4113-983a-f2c6d4e6d257",
                  "eta": 57,
                  "credit_estimate": 0.09,
                  "message": "Message published to queue",
                  "status": "IN_QUEUE"
                }
              }
            }
          }
        },
        "402": {
        "description": "Payment Required",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INSUFFICIENT_CREDITS",
              "message": ""
            }
          }
        }
      },
      "422": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "UNPROCESSABLE_CONTENT",
              "message": ""
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INTERNAL_SERVER_ERROR",
              "message": ""
            }
          }
        }
      }
    },
      "security": [
        {
          "ApiKeyAuth": []
        }
      ],
      "x-codeSamples": [
  {
    "lang": "Python",
    "source": "import requests\nimport json\n\nurl = \"https://api.musicgpt.com/api/public/v2/Extraction\"\n\nheaders = {\n    \"Authorization\": \"<API_KEY>\"\n}\n\ndata = {\n    \"stems\": json.dumps([\"vocals\", \"drums\"]),\n    \"preprocessing_options\": json.dumps([\"Denoise\"]),\n    \"webhook_url\": \"https://example.com/my-webhook\"\n}\n\n# Option 1: audio_url\ndata[\"audio_url\"] = \"<YOUR_AUDIO_URL>\"\nresponse = requests.post(url, headers=headers, data=data)\n\n# Option 2: File Upload\n# with open(\"song.mp3\", \"rb\") as f:\n#     files = {\"audio_file\": f}\n#     response = requests.post(url, headers=headers, data=data, files=files)\n\nprint(response.json())"
  }
]
    }
  },
"/v1/deecho": {
  "post": {
    "summary": "Remove echo from an audio file or URL",
    "description": "Initiate an echo removal task using either an audio URL or file upload with optional webhook callback.",
    "requestBody": {
      "required": true,
      "content": {
        "multipart/form-data": {
          "schema": {
            "type": "object",
            "properties": {
              "audio_url": {
                "type": "string",
                "description": "Input audio URL (supported format: YouTube URL)."
              },
              "audio_file": {
                "type": "string",
                "format": "binary",
                "description": "Audio file to upload and process directly."
              },
              "webhook_url": {
                "type": "string",
                "description": "Callback URL for async processing results.",
                "example": "http://your-webhook-url.com/callback"
              }
            },
            "anyOf": [
              { "required": ["audio_url"] },
              { "required": ["audio_file"] }
            ]
          }
        }
      }
    },
    "responses": {
      "200": {
  "description": "Successfully initiated task",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean" },
          "task_id": { "type": "string" },
          "conversion_id": { "type": "string" },
          "eta": { "type": "integer" },
          "credit_estimate": { "type": "number" },
          "message": { "type": "string" },
          "status": { "type": "string" }
        },
        "example": {
          "success": true,
          "task_id": "3d137437-4911-4669-b639-9e5701107c25",
          "conversion_id": "b764b4f6-a842-42dd-a55b-818eb8251dc7",
          "eta": 51,
          "credit_estimate": 0.03,
          "message": "Message published to queue",
          "status": "IN_QUEUE"
        }
      }
    }
  }
},
      "402": {
        "description": "Payment Required",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INSUFFICIENT_CREDITS",
              "message": ""
            }
          }
        }
      },
      "422": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "UNPROCESSABLE_CONTENT",
              "message": ""
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INTERNAL_SERVER_ERROR",
              "message": ""
            }
          }
        }
      }
    },
    "security": [
      { "ApiKeyAuth": [] }
    ],
    "x-codeSamples": [
  {
    "lang": "Python",
    "source": "import requests\n\nurl = \"https://api.musicgpt.com/api/public/v1/deecho\"\n\nheaders = {\n    \"Authorization\": \"<API_KEY>\"\n}\n\ndata = {\n    \"webhook_url\": \"https://example.com/my-webhook\"\n}\n\n# Option 1: audio_url\ndata[\"audio_url\"] = \"<YOUR_AUDIO_URL>\"\nresponse = requests.post(url, headers=headers, data=data)\n\n# Option 2: File Upload\n# with open(\"song.mp3\", \"rb\") as f:\n#     files = {\"audio_file\": f}\n#     response = requests.post(url, headers=headers, data=data, files=files)\n\nprint(response.json())"
  }
]
  }
},
 "/v1/denoise": {
  "post": {
    "summary": "Removes noise from an audio file or URL",
    "description": "Initiate a noise removal task using either an audio URL or file upload with optional webhook callback.",
    "requestBody": {
      "required": true,
      "content": {
        "multipart/form-data": {
          "schema": {
            "type": "object",
            "properties": {
              "audio_url": {
                "type": "string",
                "description": "Input audio URL (supported format: YouTube URL)."
              },
              "audio_file": {
                "type": "string",
                "format": "binary",
                "description": "Audio file to upload and process directly."
              },
              "webhook_url": {
                "type": "string",
                "description": "Callback URL for async processing results.",
                "example": "http://your-webhook-url.com/callback"
              }
            },
            "anyOf": [
              { "required": ["audio_url"] },
              { "required": ["audio_file"] }
            ]
          }
        }
      }
    },
    "responses": {
      "200": {
  "description": "Successfully initiated task",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean" },
          "task_id": { "type": "string" },
          "conversion_id": { "type": "string" },
          "eta": { "type": "integer" },
          "credit_estimate": { "type": "number" },
          "message": { "type": "string" },
          "status": { "type": "string" }
        },
        "example": {
          "success": true,
          "task_id": "3d137437-4911-4669-b639-9e5701107c25",
          "conversion_id": "b764b4f6-a842-42dd-a55b-818eb8251dc7",
          "eta": 71,
          "credit_estimate": 0.03,
          "message": "Message published to queue",
          "status": "IN_QUEUE"
        }
      }
    }
  }
},
      "402": {
        "description": "Payment Required",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INSUFFICIENT_CREDITS",
              "message": ""
            }
          }
        }
      },
      "422": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "UNPROCESSABLE_CONTENT",
              "message": ""
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INTERNAL_SERVER_ERROR",
              "message": ""
            }
          }
        }
      }
    },
    "security": [
      { "ApiKeyAuth": [] }
    ],
    "x-codeSamples": [
  {
    "lang": "Python",
    "source": "import requests\n\nurl = \"https://api.musicgpt.com/api/public/v1/denoise\"\n\nheaders = {\n    \"Authorization\": \"<API_KEY>\"\n}\n\ndata = {\n    \"webhook_url\": \"https://example.com/my-webhook\"\n}\n\n# Option 1: audio_url\ndata[\"audio_url\"] = \"<YOUR_AUDIO_URL>\"\nresponse = requests.post(url, headers=headers, data=data)\n\n# Option 2: File Upload\n# with open(\"song.mp3\", \"rb\") as f:\n#     files = {\"audio_file\": f}\n#     response = requests.post(url, headers=headers, data=data, files=files)\n\nprint(response.json())"
  }
]
  }
},
"/v1/dereverb": {
  "post": {
    "summary": "Removes reverberation from an audio file or URL",
    "description": "Initiate a reverberation removal task using either an audio URL or file upload with optional webhook callback.",
    "requestBody": {
      "required": true,
      "content": {
        "multipart/form-data": {
          "schema": {
            "type": "object",
            "properties": {
              "audio_url": {
                "type": "string",
                "description": "Input audio URL (supported format: YouTube URL)."
              },
              "audio_file": {
                "type": "string",
                "format": "binary",
                "description": "Audio file to upload and process directly."
              },
              "webhook_url": {
                "type": "string",
                "description": "Callback URL for async processing results.",
                "example": "http://your-webhook-url.com/callback"
              }
            },
            "anyOf": [
              { "required": ["audio_url"] },
              { "required": ["audio_file"] }
            ]
          }
        }
      }
    },
    "responses": {
      "200": {
  "description": "Successfully initiated task",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean" },
          "task_id": { "type": "string" },
          "conversion_id": { "type": "string" },
          "eta": { "type": "integer" },
          "credit_estimate": { "type": "number" },
          "message": { "type": "string" },
          "status": { "type": "string" }
        },
        "example": {
          "success": true,
          "task_id": "e99d00bb-2ddf-4279-a15e-6e22801ee575",
          "conversion_id": "fbcf0c40-a33d-40aa-8c1d-7bb6f9df0b0f",
          "eta": 40,
          "credit_estimate": 0.48,
          "message": "Message published to queue",
          "status": "IN_QUEUE"
        }
      }
    }
  }
},
      "402": {
        "description": "Payment Required",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INSUFFICIENT_CREDITS",
              "message": ""
            }
          }
        }
      },
      "422": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "UNPROCESSABLE_CONTENT",
              "message": ""
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INTERNAL_SERVER_ERROR",
              "message": ""
            }
          }
        }
      }
    },
    "security": [
      { "ApiKeyAuth": [] }
    ],
  "x-codeSamples": [
  {
    "lang": "Python",
    "source": "import requests\n\nurl = \"https://api.musicgpt.com/api/public/v1/dereverb\"\n\nheaders = {\n    \"Authorization\": \"<API_KEY>\"\n}\n\ndata = {\n    \"webhook_url\": \"https://example.com/my-webhook\"\n}\n\n# Option 1: audio_url\ndata[\"audio_url\"] = \"<YOUR_AUDIO_URL>\"\nresponse = requests.post(url, headers=headers, data=data)\n\n# Option 2: File Upload\n# with open(\"song.mp3\", \"rb\") as f:\n#     files = {\"audio_file\": f}\n#     response = requests.post(url, headers=headers, data=data, files=files)\n\nprint(response.json())"
  }
]
  }
},
"/v1/extract_key_bpm": {
  "post": {
    "summary": "Extract Key, BPM, and Key Changes from Audio",
    "description": "Processes an audio file to extract key changes, dominant key, and BPM (Beats Per Minute).",
    "requestBody": {
      "required": true,
      "content": {
        "multipart/form-data": {
          "schema": {
            "type": "object",
            "properties": {
              "audio_url": {
                "type": "string",
                "description": "Input audio URL (supported format: YouTube URL)."
              },
              "audio_file": {
                "type": "string",
                "format": "binary",
                "description": "Audio file to upload and process directly."
              },
              "webhook_url": {
                "type": "string",
                "description": "Callback URL for async processing results.",
                "example": "http://your-webhook-url.com/callback"
              }
            },
            "anyOf": [
              { "required": ["audio_url"] },
              { "required": ["audio_file"] }
            ]
          }
        }
      }
    },
    "responses": {
      "200": {
  "description": "Successfully initiated task",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean" },
          "task_id": { "type": "string" },
          "conversion_id": { "type": "string" },
          "eta": { "type": "integer" },
          "credit_estimate": { "type": "number" },
          "message": { "type": "string" },
          "status": { "type": "string" }
        },
        "example": {
          "success": true,
          "task_id": "e99d00bb-2ddf-4279-a15e-6e22801ee575",
          "conversion_id": "fbcf0c40-a33d-40aa-8c1d-7bb6f9df0b0f",
          "eta": 40,
          "credit_estimate": 0.48,
          "message": "Message published to queue",
          "status": "IN_QUEUE"
        }
      }
    }
  }
},
      "402": {
        "description": "Payment Required",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INSUFFICIENT_CREDITS",
              "message": ""
            }
          }
        }
      },
      "422": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "UNPROCESSABLE_CONTENT",
              "message": ""
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INTERNAL_SERVER_ERROR",
              "message": ""
            }
          }
        }
      }
    },
    "security": [
      { "ApiKeyAuth": [] }
    ],
  "x-codeSamples": [
  {
    "lang": "Python",
    "source": "import requests\n\nurl = \"https://api.musicgpt.com/api/public/v1/extract_key_bpm\"\n\nheaders = {\n    \"Authorization\": \"<API_KEY>\"\n}\n\ndata = {\n    \"webhook_url\": \"https://example.com/my-webhook\"\n}\n\n# Option 1: audio_url\ndata[\"audio_url\"] = \"<YOUR_AUDIO_URL>\"\nresponse = requests.post(url, headers=headers, data=data)\n\n# Option 2: File Upload\n# with open(\"song.mp3\", \"rb\") as f:\n#     files = {\"audio_file\": f}\n#     response = requests.post(url, headers=headers, data=data, files=files)\n\nprint(response.json())"
  }
]
  }
},          
"/v1/audio_transcribe": {
  "post": {
    "summary": "Transcribe Audio to Text",
    "description": "Processes an audio file to generate a transcription of the spoken content with support for language detection, translation, and multiple output formats.",
    "requestBody": {
      "required": true,
      "content": {
        "multipart/form-data": {
          "schema": {
            "type": "object",
            "properties": {
              "audio_url": {
                "type": "string",
                "description": "Input audio URL (supported format: YouTube URL)."
              },
              "audio_file": {
                "type": "string",
                "format": "binary",
                "description": "Audio file to upload and process directly."
              },
              "language": {
                "type": "string",
                "description": "Language spoken in the audio (empty for auto-detection).",
                "example": "en"
              },
              "translate": {
                "type": "boolean",
                "description": "Whether to translate the transcription to English.",
                "example": false
              },
              "transcription_format": {
                "type": "string",
                "description": "Format of the transcribed output.",
                "enum": ["plain_text", "formatted_text", "srt", "vtt"],
                "example": "plain_text"
              },
              "translation_format": {
                "type": "string",
                "description": "Format of the translated output (currently unused).",
                "enum": ["plain_text", "formatted_text", "srt", "vtt"],
                "example": "plain_text"
              },
              "word_timestamps": {
                "type": "boolean",
                "description": "Whether to include word-level timestamps.",
                "example": false
              },
              "webhook_url": {
                "type": "string",
                "description": "Callback URL for async processing results.",
                "example": "http://your-webhook-url.com/callback"
              }
            },
            "anyOf": [
              { "required": ["audio_url"] },
              { "required": ["audio_file"] }
            ]
          }
        }
      }
    },
    "responses": {
      "200": {
  "description": "Successfully initiated task",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean" },
          "task_id": { "type": "string" },
          "conversion_id": { "type": "string" },
          "eta": { "type": "integer" },
          "credit_estimate": { "type": "number" },
          "message": { "type": "string" },
          "status": { "type": "string" }
        },
        "example": {
          "success": true,
          "task_id": "cade1dea-a9fb-49d3-a5b2-52f786ea5ad3",
          "conversion_id": "1c5a2543-5b99-499c-8bb4-28424497e60f",
          "eta": 46,
          "credit_estimate": 0.04,
          "message": "",
          "status": "IN_QUEUE"
        }
      }
    }
  }
},
      "402": {
        "description": "Payment Required",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INSUFFICIENT_CREDITS",
              "message": ""
            }
          }
        }
      },
      "422": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "UNPROCESSABLE_CONTENT",
              "message": ""
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INTERNAL_SERVER_ERROR",
              "message": ""
            }
          }
        }
      }
    },
    "security": [
      { "ApiKeyAuth": [] }
    ],
    "x-codeSamples": [
  {
    "lang": "Python",
    "source": "import requests\n\nurl = \"https://api.musicgpt.com/api/public/v1/audio_transcribe\"\nheaders = {\"Authorization\": \"<API_KEY>\"}\n\npayload = {\n    \"language\": \"en\",\n    \"translate\": True,\n    \"transcription_format\": \"plain_text\",\n    \"word_timestamps\": True\n}\n\n# Option 1: audio_url\npayload[\"audio_url\"] = \"<YOUR_AUDIO_URL>\"\nresponse = requests.post(url, headers=headers, data=payload)\n\n# Option 2: File Upload\n# with open(\"audio.mp3\", \"rb\") as f:\n#     files = {\"audio_file\": f}\n#     response = requests.post(url, headers=headers, data=payload, files=files)\n\nprint(response.json())"
  }
]
  }
},
"/v1/sound_generator": {
  "post": {
    "summary": "Generate Sound Based on Given Prompt",
    "description": "Creates an audio file based on a textual prompt. The generation process is asynchronous and returns a task ID for tracking.",
    "requestBody": {
      "required": true,
      "content": {
        "application/x-www-form-urlencoded": {
          "schema": {
            "type": "object",
            "properties": {
              "prompt": {
                "type": "string",
                "maxLength": 300,
                "description": "Text prompt guiding the sound generation. Maximum 300 characters.",
                "example": "Generate a soothing ambient soundscape."
              },
              "generate_album_cover": {
                    "type": "boolean",
                    "description": "Whether to generate an album cover for the generated audio",
                    "default": false
                  },
              "webhook_url": {
                "type": "string",
                "description": "Callback URL for async processing results.",
                "example": "http://your-webhook-url.com/callback"
              },
              "audio_length": {
                "type": "integer",
                "description": "Desired duration of generated audio in seconds, from 5 to 120.",
                "minimum": 5,
                "maximum": 120,
                "example": 30
              }
          
            },
            "required": ["prompt"]
          }
        }
      }
    },
    "responses": {
      "200": {
        "description": "Successfully initiated task",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": { "type": "boolean" },
                "task_id": { "type": "string" },
                "conversion_id": { "type": "string" },
                "eta": {
                  "type": "integer",
                  "description": "Estimated processing time in seconds"
                },
                "credit_estimate": { "type": "number", "format": "float" },
                "message": { "type": "string" },
                "status": { "type": "string" }
              }
            },
            "example": {
              "success": true,
              "task_id": "26c9aaf8-f292-4c66-992b-7f3c7dfe85fe",
              "conversion_id": "31b6c4a2-e5e2-44ab-baf1-93ffa4c8a7b7",
              "eta": 84,
              "credit_estimate": 0.011,
              "message": "",
              "status": "IN_QUEUE"
            }
          }
        }
      },
      "402": {
        "description": "Payment Required",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INSUFFICIENT_CREDITS",
              "message": ""
            }
          }
        }
      },
      "422": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "UNPROCESSABLE_CONTENT",
              "message": ""
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INTERNAL_SERVER_ERROR",
              "message": ""
            }
          }
        }
      }
    },
    "security": [
      { "ApiKeyAuth": [] }
    ]
  }
},
"/v1/audio_mastering": {
  "post": {
    "summary": "Master an audio file using a reference track",
    "description": "Processes an input audio file to match the mastering characteristics of a reference track.",
    "requestBody": {
      "required": true,
      "content": {
        "multipart/form-data": {
          "schema": {
            "type": "object",
            "properties": {
              "audio_url": {
                "type": "string",
                "description": "Input audio URL (supported format: YouTube URL)."
              },
              "audio_file": {
                "type": "string",
                "format": "binary",
                "description": "Input audio file to upload directly."
              },
              "reference_audio_url": {
                "type": "string",
                "description": "URL of the reference audio file to match."
              },
              "reference_audio_file": {
                "type": "string",
                "format": "binary",
                "description": "Reference audio file to upload directly."
              },
              "output_extension": {
                "type": "string",
                "enum": ["mp3", "wav", "flac", "ogg", "aac", "webm"],
                "description": "Desired output file format.",
                "example": "wav"
              },
              "webhook_url": {
                "type": "string",
                "description": "Callback URL to receive async result.",
                "example": "http://your-webhook-url.com/callback"
              }
            },
            "anyOf": [
              { "required": ["audio_url","reference_audio_url"] },
              { "required": ["audio_file","reference_audio_file"] }   
            ]
          
          }
        }
      }
    },
    "responses": {
        "200": {
  "description": "Successfully initiated task",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean" },
          "task_id": { "type": "string" },
          "conversion_id": { "type": "string" },
          "eta": { "type": "integer" },
          "credit_estimate": { "type": "number" },
          "message": { "type": "string" },
          "status": { "type": "string" }
        },
        "example": {
          "success": true,
          "task_id": "e99d00bb-2ddf-4279-a15e-6e22801ee575",
          "conversion_id": "fbcf0c40-a33d-40aa-8c1d-7bb6f9df0b0f",
          "eta": 40,
          "credit_estimate": 0.48,
          "message": "Message published to queue",
          "status": "IN_QUEUE"
        }
      }
    }
  }
},
      "402": {
        "description": "Payment Required",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INSUFFICIENT_CREDITS",
              "message": ""
            }
          }
        }
      },
      "422": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "UNPROCESSABLE_CONTENT",
              "message": ""
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INTERNAL_SERVER_ERROR",
              "message": ""
            }
          }
        }
      }
    },
    "security": [
      { "ApiKeyAuth": [] }
    ],
 "x-codeSamples": [
  {
    "lang": "Python",
    "source": "import requests\n\nurl = \"https://api.musicgpt.com/api/public/v1/audio_mastering\"\n\nheaders = {\n    \"Authorization\": \"<API_KEY>\"\n}\n\ndata = {\n    \"output_extension\": \"wav\",\n    \"webhook_url\": \"https://example.com/my-webhook\"\n}\n\n# Option 1: audio URLs\ndata[\"audio_url\"] = \"<YOUR_AUDIO_URL>\"\ndata[\"reference_audio_url\"] = \"<YOUR_REFERENCE_AUDIO_URL>\"\nresponse = requests.post(url, headers=headers, data=data)\n\n# Option 2: File Upload\n# with open(\"song.mp3\", \"rb\") as audio, open(\"reference.mp3\", \"rb\") as reference:\n#     files = {\n#         \"audio_file\": audio,\n#         \"reference_audio_file\": reference\n#     }\n#     response = requests.post(url, headers=headers, data=data, files=files)\n\nprint(response.json())"
  }
]
  }
},
"/v1/audio_cutter": {
  "post": {
    "summary": "Cut an audio file between specified timestamps",
    "description": "Trims an audio file using the specified start and end times.",
    "requestBody": {
      "required": true,
      "content": {
        "multipart/form-data": {
          "schema": {
            "type": "object",
            "properties": {
              "audio_url": {
                "type": "string",
                "description": "Input audio URL (supported format: YouTube URL)."
              },
              "audio_file": {
                "type": "string",
                "format": "binary",
                "description": "Audio file to upload and process directly."
              },
              "start_time": {
                "type": "number",
                "format": "float",
                "description": "Start time in milliseconds.",
                "example": 10500
              },
              "end_time": {
                "type": "number",
                "format": "float",
                "description": "End time in milliseconds.",
                "example": 45000
              },
              "output_extension": {
                "type": "string",
                "enum": ["mp3", "wav", "flac", "ogg", "aac", "webm"],
                "description": "Desired output format.",
                "example": "mp3"
              },
              "webhook_url": {
                "type": "string",
                "description": "Callback URL for async processing results.",
                "example": "http://your-webhook-url.com/callback"
              }
            },
            "required": ["start_time", "end_time"],
            "anyOf": [
              { "required": ["audio_url"] },
              { "required": ["audio_file"] }
            ]
          }
        }
      }
    },
    "responses": {
      "200": {
  "description": "Successfully initiated task",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean" },
          "task_id": { "type": "string" },
          "conversion_id": { "type": "string" },
          "eta": { "type": "integer" },
          "credit_estimate": { "type": "number" },
          "message": { "type": "string" },
          "status": { "type": "string" }
        },
        "example": {
          "success": true,
          "task_id": "b0ac9d46-64d7-4843-af48-a0b6effe3666",
          "conversion_id": "fe19945b-d466-4183-b559-5d264bddd492",
          "eta": 66,
          "credit_estimate": 0.015,
          "message": "Message published to queue",
          "status": "IN_QUEUE"
        }
      }
    }
  }
},
      "402": {
        "description": "Payment Required",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INSUFFICIENT_CREDITS",
              "message": ""
            }
          }
        }
      },
      "422": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "UNPROCESSABLE_CONTENT",
              "message": ""
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INTERNAL_SERVER_ERROR",
              "message": ""
            }
          }
        }
      }
    },
    "security": [
      { "ApiKeyAuth": [] }
    ],
    "x-codeSamples": [
  {
    "lang": "Python",
    "source": "import requests\n\nurl = \"https://api.musicgpt.com/api/public/v1/audio_cutter\"\nheaders = {\"Authorization\": \"<API_KEY>\"}\n\npayload = {\n    \"start_time\": 10500,\n    \"end_time\": 45000,\n    \"output_extension\": \"mp3\"\n}\n\n# Option 1: audio_url\npayload[\"audio_url\"] = \"<YOUR_AUDIO_URL>\"\nresponse = requests.post(url, headers=headers, data=payload)\n\n# Option 2: File Upload\n# with open(\"input_audio.mp3\", \"rb\") as f:\n#     files = {\"audio_file\": f}\n#     response = requests.post(url, headers=headers, data=payload, files=files)\n\nprint(response.json())"
  }
  
]
  }
},
"/v1/audio_speed_changer": {
  "post": {
    "summary": "Change the speed of an audio file",
    "description": "Processes an audio file to change its playback speed based on a speed factor.",
    "requestBody": {
      "required": true,
      "content": {
        "multipart/form-data": {
          "schema": {
            "type": "object",
            "properties": {
              "audio_url": {
                "type": "string",
                "description": "Input audio URL (supported format: YouTube URL)."
              },
              "audio_file": {
                "type": "string",
                "format": "binary",
                "description": "Audio file to upload and process directly."
              },
              "speed_change_factor": {
                "type": "number",
                "description": "Factor to change the audio speed (min: 0.25, max: 4.0)",
                "minimum": 0.25,
                "maximum": 4.0,
                "example": 1.5
              },
              "output_extension": {
                "type": "string",
                "enum": ["mp3", "wav", "flac", "ogg", "aac", "webm"],
                "description": "Desired output format.",
                "example": "mp3"
              },
              "webhook_url": {
                "type": "string",
                "description": "Callback URL for async processing results.",
                "example": "http://your-webhook-url.com/callback"
              }
            },
            "required": ["speed_change_factor"],
            "anyOf": [
              { "required": ["audio_url"] },
              { "required": ["audio_file"] }
            ]
          }
        }
      }
    },
    "responses": {
      "200": {
  "description": "Successfully initiated task",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean" },
          "task_id": { "type": "string" },
          "conversion_id": { "type": "string" },
          "eta": { "type": "integer" },
          "credit_estimate": { "type": "number" },
          "message": { "type": "string" },
          "status": { "type": "string" }
        },
        "example": {
          "success": true,
          "task_id": "b0ac9d46-64d7-4843-af48-a0b6effe3666",
          "conversion_id": "fe19945b-d466-4183-b559-5d264bddd492",
          "eta": 66,
          "credit_estimate": 0.15,
          "message": "Message published to queue",
          "status": "IN_QUEUE"
        }
      }
    }
  }
},
      "402": {
        "description": "Payment Required",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INSUFFICIENT_CREDITS",
              "message": ""
            }
          }
        }
      },
      "422": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "UNPROCESSABLE_CONTENT",
              "message": ""
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INTERNAL_SERVER_ERROR",
              "message": ""
            }
          }
        }
      }
    },
    "security": [
      { "ApiKeyAuth": [] }
    ],
    "x-codeSamples": [
  {
    "lang": "Python",
    "source": "import requests\n\nurl = \"https://api.musicgpt.com/api/public/v1/audio_speed_changer\"\nheaders = {\"Authorization\": \"<API_KEY>\"}\n\npayload = {\n    \"speed_change_factor\": 1.5,\n    \"output_extension\": \"mp3\"\n}\n\n# Option 1: audio_url\npayload[\"audio_url\"] = \"<YOUR_AUDIO_URL>\"\nresponse = requests.post(url, headers=headers, data=payload)\n\n# Option 2: File Upload\n# with open(\"input_audio.mp3\", \"rb\") as f:\n#     files = {\"audio_file\": f}\n#     response = requests.post(url, headers=headers, data=payload, files=files)\n\nprint(response.json())"
  }
]
  }
},
"/v1/audio_to_midi": {
  "post": {
    "summary": "Convert Audio to MIDI",
    "description": "Processes an audio file and converts it into a MIDI file. Optionally generates a sonified .wav and/or a CSV of note events. This request is handled asynchronously.",
    "requestBody": {
      "required": true,
      "content": {
        "multipart/form-data": {
          "schema": {
            "type": "object",
            "properties": {
              "audio_url": {
                "type": "string",
                "description": "Input audio URL (supported format: YouTube URL)."
              },
              "audio_file": {
                "type": "string",
                "format": "binary",
                "description": "Audio file to upload and process directly."
              },
              "sonify_midi": {
                "type": "boolean",
                "default": true,
                "description": "If true, generates a .wav file that sonifies the MIDI output."
              },
              "save_note_events": {
                "type": "boolean",
                "default": true,
                "description": "If true, saves predicted note events as a CSV file."
              },
              "webhook_url": {
                "type": "string",
                "description": "Callback URL to receive conversion results.",
                "example": "https://your-webhook-url.com/callback"
              }
            },
            "anyOf": [
              { "required": ["audio_url"] },
              { "required": ["audio_file"] }
            ]
          }
        }
      }
    },
    "responses": {
      "200": {
  "description": "Successfully initiated task",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean" },
          "task_id": { "type": "string" },
          "conversion_id": { "type": "string" },
          "eta": { "type": "integer" },
          "credit_estimate": { "type": "number" },
          "message": { "type": "string" },
          "status": { "type": "string" }
        },
        "example": {
          "success": true,
          "task_id": "cf34f4e0-3273-41e4-95e5-05dc745b9852",
          "conversion_id": "0b0b59e5-4c71-49ec-8ca5-5cd05142d5ab",
          "eta": 37,
          "credit_estimate": 0.016,
          "message": "Message published to queue",
          "status": "IN_QUEUE"
        }
      }
    }
  }
},
      "402": {
        "description": "Payment Required",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INSUFFICIENT_CREDITS",
              "message": ""
            }
          }
        }
      },
      "422": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "UNPROCESSABLE_CONTENT",
              "message": ""
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INTERNAL_SERVER_ERROR",
              "message": ""
            }
          }
        }
      }
    },
    "security": [
      { "ApiKeyAuth": [] }
    ],
    "x-codeSamples": [
      {
        "lang": "Python",
        "source": "import requests\n\nurl = \"https://api.musicgpt.com/api/public/v1/audio_to_midi\"\nheaders = {\"Authorization\": \"<API_KEY>\"}\n\npayload = {\n    \"sonify_midi\": True,\n    \"save_note_events\": True,\n    \"webhook_url\": \"https://your-webhook-url.com/callback\"\n}\n\n# Option 1: audio_url\npayload[\"audio_url\"] = \"<YOUR_AUDIO_URL>\"\nresponse = requests.post(url, headers=headers, data=payload)\n\n# Option 2: File Upload\n# with open(\"audio.wav\", \"rb\") as f:\n#     files = {\"audio_file\": f}\n#     response = requests.post(url, headers=headers, data=payload, files=files)\n\nprint(response.json())"
      }
    ]
  }
},
"/v1/Remix": {
  "post": {
    "summary": "Remix Audio Using Prompt and Optional Lyrics",
    "description": "This endpoint allows users to remix an input audio file or URL using a descriptive prompt, optional lyrics, and a gender selection for vocal tone.",
    "requestBody": {
      "required": true,
      "content": {
        "multipart/form-data": {
          "schema": {
            "type": "object",
            "properties": {
              "audio_file": {
                "type": "string",
                "format": "binary",
                "description": "Uploaded audio file to be remixed."
              },
              "audio_url": {
                "type": "string",
                "description": "Input audio URL (supported format: YouTube URL)."
              },
              "prompt": {
                "type": "string",
                "description": "Describes how the audio should be transformed.",
                "example": "Make it sound like Lo-fi with chill beats"
              },
              "lyrics": {
                "type": "string",
                "description": "Optional lyrics to guide vocal generation.",
                "example": "It's a brand new day",
                "maxLength": 5000
              },
              "title": {
                    "type": "string",
                    "description": "Title of the generated music track"
              },
              "gender": {
                "type": "string",
                "description": "Voice style if vocal content is generated.",
                "enum": ["male", "female", "neutral"],
                "example": ""
              },
               "generate_album_cover": {
                    "type": "boolean",
                    "description": "Whether to generate an album cover for the generated audio",
                    "default": false
                  },
                "lyrics_timestamps": {
                "type": "boolean",
                "description": "Whether to generate timestamps for the lyrics",
                "default": false
              },
              "webhook_url": {
                "type": "string",
                "description": "Callback URL for async processing results.",
                "example": "https://example.com/my-webhook"
              }
            },
            "required": ["prompt"],
            "anyOf": [              
              { "required": ["audio_url"] },
              { "required": ["audio_file"] }
            ]
          }
        }
      }
    },
    "responses": {
      "200": {
          "description": "Successful response",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "success": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "task_id": {
                    "type": "string"
                  },
                  "conversion_id_1": {
                    "type": "string"
                  },
                  "conversion_id_2": {
                    "type": "string"
                  },
                  "is_flagged": {
                    "type": "boolean"
                  },
                  "reason": {
                    "type": "string"
                  },
                  "eta": {
                    "type": "integer"
                  },
                  "status": {
                    "type": "string"
                  },
                  "credit_estimate": {
                    "type": "number"
                  },
                  "error_message": {
                    "type": "string"
                  },
                  "error_message_detail": {
                    "type": "string"
                  },
                  "missing_input_fields": {
                    "type": "string"
                  },
                  "predicted_user_intent": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "success": true,
                "message": "Remix request submitted successfully",
                "task_id": "2e70b1bc-0af7-45b2-bca5-5d951bd6a8fb",
                "conversion_id_1": "64a38c01-d5b9-4ffa-99d1-e38d957e7048",
                "conversion_id_2": "d12445e4-2605-4c4b-98a0-82efb36ad512",
                "is_flagged": false,
                "reason": "",
                "eta": 300,
                "status": "IN_QUEUE",
                "credit_estimate": 0.1,
                "error_message": "",
                "error_message_detail": "",
                "missing_input_fields": "",
                "predicted_user_intent": ""
              }
            }
          }
        },
      "402": {
        "description": "Payment Required",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INSUFFICIENT_CREDITS",
              "message": ""
            }
          }
        }
      },
      "422": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "UNPROCESSABLE_CONTENT",
              "message": ""
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INTERNAL_SERVER_ERROR",
              "message": ""
            }
          }
        }
      }
    },
    "security": [
      { "ApiKeyAuth": [] }
    ],
    "x-codeSamples": [
      {
        "lang": "Python",
        "source": "import requests\n\nurl = \"https://api.musicgpt.com/api/public/v1/Remix\"\nheaders = {\"Authorization\": \"<API_KEY>\"}\ndata = {\n  \"prompt\": \"Make it sound like Lo-fi with chill beats\",\n  \"lyrics\": \"It's a brand new day\",\n  \"gender\": \"\",\n  \"title\": \"My Generated Track\",\n  \"generate_album_cover\": false,\n  \"lyrics_timestamp\": false,\n  \"webhook_url\": \"https://example.com/my-webhook\"\n}\n\n# Option 1: audio_url\nfiles = {}\ndata[\"audio_url\"] = \"<YOUR_AUDIO_URL>\"\nresponse = requests.post(url, headers=headers, data=data, files=files)\n\n# Option 2: File Upload\n# with open(\"song.mp3\", \"rb\") as f:\n#    files = {\"audio_file\": f}\n#    response = requests.post(url, headers=headers, data=data, files=files)\n\nprint(response.json())"
      }
    ]
  }
},
"/v1/extend": {
  "post": {
    "summary": "Extend Audio Using Prompt and Optional Lyrics",
    "description": "This endpoint allows users to extend an existing audio file or stream by appending new audio content after a specific timestamp. The new audio is generated using a prompt (e.g., describing the desired sound) and optional lyrics.",
    "requestBody": {
      "required": true,
      "content": {
        "multipart/form-data": {
          "schema": {
            "type": "object",
            "properties": {
              "audio_file": {
                "type": "string",
                "format": "binary",
                "description": "Uploaded audio file to be extended."
              },
              "audio_url": {
                "type": "string",
                "description": "Input audio URL (supported format: YouTube URL)."
              },
              "extend_after": {
                "type": "number",
                "format": "float",
                "description": "Time in seconds after which to start the extension.",
                "example": 35.0
              },
              "prompt": {
                "type": "string",
                "description": "Describes how the extended section should sound.",
                "example": "Add a calming piano outro"
              },
              "lyrics": {
                "type": "string",
                "description": "Original lyrics of song",
                "example": "Let the journey fade away",
                "maxLength": 3000
              },
              "lyrics_section_to_extend":{
                "type": "string",
                "description": "Lyrics to be used for the extended portion(optional, max 3000 characters).",
                "maxLength": 3000
              },
              "gender": {
                "type": "string",
                "description": "Voice style if vocal content is generated.",
                "enum": ["male", "female", "neutral"],
                "example": ""
              },
              "title": {
                    "type": "string",
                    "description": "Title of the generated music track"
              },
              "num_outputs": {
                      "type": "number",
                      "format":"integer",
                      "description" : "The number of outputs to generate (1 or 2 only):default is 2."
              },
              "generate_album_cover": {
                    "type": "boolean",
                    "description": "Whether to generate an album cover for the generated audio",
                    "default": false
                  },
              "lyrics_timestamps": {
                "type": "boolean",
                "description": "Whether to generate timestamps for the lyrics",
                "default": false
              },
              "webhook_url": {
                "type": "string",
                "description": "Callback URL for async processing results.",
                "example": "https://example.com/webhook"
              }
            },
            "required": ["extend_after"],
            "anyOf": [
              { "required": ["audio_url"] },
              { "required": ["audio_file"] }
              
            ]
          }
        }
      }
    },
    "responses": {
      "200": {
  "description": "Successfully initiated extend task",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean" },
          "message": { "type": "string" },
          "task_id": { "type": "string" },
          "conversion_id_1": { "type": "string" },
          "conversion_id_2": { "type": "string" },
          "is_flagged": { "type": "boolean" },
          "reason": { "type": "string" },
          "eta": {
            "type": "integer",
            "description": "Estimated processing time in seconds"
          },
          "status": { "type": "string" },
          "credit_estimate": { "type": "number", "format": "float" },
          "error_message": { "type": "string" },
          "error_message_detail": { "type": "string" },
          "missing_input_fields": { "type": "string" },
          "predicted_user_intent": { "type": "string" }
        }
      },
      "example": {
        "success": true,
        "message": "Extend request submitted successfully",
        "task_id": "a39f781f-e87e-4cbd-b923-aebf4aa451e6",
        "conversion_id_1": "f4ecf063-6ddd-43df-bc81-9eccea5b5042",
        "conversion_id_2": "49e99636-2ae7-4b5f-a907-e85a8fae95ad",
        "is_flagged": false,
        "reason": "",
        "eta": 199,
        "status": "IN_QUEUE",
        "credit_estimate": 0.12,
        "error_message": "",
        "error_message_detail": "",
        "missing_input_fields": "",
        "predicted_user_intent": ""
      }
    }
  }
},
      "402": {
        "description": "Payment Required",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INSUFFICIENT_CREDITS",
              "message": ""
            }
          }
        }
      },
      "422": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "UNPROCESSABLE_CONTENT",
              "message": ""
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INTERNAL_SERVER_ERROR",
              "message": ""
            }
          }
        }
      }
    },
    "security": [
      { "ApiKeyAuth": [] }
    ],
    "x-codeSamples": [
      {
        "lang": "Python",
        "source": "import requests\n\nurl = \"https://api.musicgpt.com/api/public/v1/extend\"\nheaders = {\"Authorization\": \"<API_KEY>\"}\ndata = {\n  \"extend_after\": 35.0,\n  \"prompt\": \"Add a calming piano outro\",\n  \"lyrics\": \"Let the journey fade away\",\n  \"gender\": \"\", \n  \"lyrics_section_to_extend\": \"New_lyrics\",\n  \"num_outputs\": 1,\n  \"title\": \"My Generated Track\",\n  \"generate_album_cover\": false,\n  \"lyrics_timestamps\": false, \n  \"webhook_url\": \"https://example.com/webhook\"\n}\n\n# Option 1: audio_url\ndata[\"audio_url\"] = \"<YOUR_AUDIO_URL>\"\nresponse = requests.post(url, headers=headers, data=data)\n\n# Option 2: File Upload\n# with open(\"song.mp3\", \"rb\") as f:\n#     files = {\"audio_file\": f}\n#     response = requests.post(url, headers=headers, data=data, files=files)\nprint(response.json())"
      }
    ]
  }
},
"/v1/inpaint": {
  "post": {
    "summary": "Inpaint an Audio Segment",
    "description": "This endpoint allows users to replace a specific time segment of an audio clip using a textual prompt and optional lyrics. The inpainting operation blends new audio content into the selected range, guided by user-defined style and voice preferences.  \n\nTo use the inpaint feature, upload a song and specify the lyrics you want to replace in the field **'lyrics_section_to_replace'**. For best results, also provide the complete song lyrics in the **lyrics**.",
    "requestBody": {
      "required": true,
      "content": {
        "multipart/form-data": {
          "schema": {
            "type": "object",
            "properties": {
              "audio_file": {
                "type": "string",
                "format": "binary",
                "description": "Uploaded input audio file."
              },
              "audio_url": {
                "type": "string",
                "description": "Input audio URL (supported format: YouTube URL)."
              },
              "prompt": {
                "type": "string",
                "description": "A description of how the replacement should sound.",
                "example": "Replace this part with an opera-style vocal."
              },
              "replace_start_at": {
                "type": "number",
                "format": "float",
                "description": "Time in seconds to start replacing audio.",
                "example": 12.5
              },
              "replace_end_at": {
                "type": "number",
                "format": "float",
                "description": "Time in seconds to stop replacing audio.",
                "example": 20.0
              },
              "lyrics": {
                "type": "string",
                "description": "Lyrics to be used for inpainting.",
                "example": "This is where my story begins"
 
              },
              "lyrics_section_to_replace":{
                "type": "string",
                "description":"Lyrics to be used for the replaced portion(optional, max 3000 characters)",
                "maxLength": 3000
              },
              "gender": {
                "type": "string",
                "description": "Voice style for the inpainted segment.",
                "enum": ["male", "female", "neutral"],
                "example": ""
              },
              "num_outputs": {
                      "type": "number",
                      "format":"integer",
                      "description" : "The number of outputs to generate (1 or 2 only):default is 2."
              },
              "title": {
                    "type": "string",
                    "description": "Title of the generated music track"
              },
              "generate_album_cover": {
                    "type": "boolean",
                    "description": "Whether to generate an album cover for the generated audio",
                    "default": false
                  },
              "lyrics_timestamps": {
                "type": "boolean",
                "description": "Whether to generate timestamps for the lyrics",
                "default": false
              },
              "webhook_url": {
                "type": "string",
                "description": "Callback URL for async processing results.",
                "example": "https://example.com/webhook"
              }
            },
            "required": ["prompt", "replace_start_at", "replace_end_at"],
            "anyOf": [
              { "required": ["audio_url"] },
              { "required": ["audio_file"] }
            ]
          }
        }
      }
    },
    "responses": {
      "200": {
  "description": "Successfully initiated inpaint task",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean" },
          "message": { "type": "string" },
          "task_id": { "type": "string" },
          "conversion_id_1": { "type": "string" },
          "conversion_id_2": { "type": "string" },
          "is_flagged": { "type": "boolean" },
          "reason": { "type": "string" },
          "eta": { "type": "integer"   },
          "status": { "type": "string" },
          "credit_estimate": { "type": "number", "format": "float" },
          "error_message": { "type": "string" },
          "error_message_detail": { "type": "string" },
          "missing_input_fields": { "type": "string" },
          "predicted_user_intent": { "type": "string" }
        }
      },
      "example": {
        "success": true,
        "message": "Inpaint request submitted successfully",
        "task_id": "070093dd-f1e9-4d7e-a6b3-ab6ecd237e38",
        "conversion_id_1": "7cac10af-9007-449f-b3ab-f60b05d23309",
        "conversion_id_2": "e85848c9-8feb-4cd8-85ef-456651a697b5",
        "is_flagged": false,
        "reason": "",
        "eta": 123,
        "status": "IN_QUEUE",
        "credit_estimate": 0.12,
        "error_message": "",
        "error_message_detail": "",
        "missing_input_fields": "",
        "predicted_user_intent": ""
      }
    }
  }
},
      "402": {
        "description": "Payment Required",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INSUFFICIENT_CREDITS",
              "message": ""
            }
          }
        }
      },
      "422": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "UNPROCESSABLE_CONTENT",
              "message": ""
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INTERNAL_SERVER_ERROR",
              "message": ""
            }
          }
        }
      }
    },
    "security": [
      { "ApiKeyAuth": [] }
    ],
    "x-codeSamples": [
      {
        "lang": "Python",
        "source": "import requests\n\nurl = \"https://api.musicgpt.com/api/public/v1/inpaint\"\nheaders = {\"Authorization\": \"<API_KEY>\"}\ndata = {\n  \"prompt\": \"Add a soft guitar solo here\",\n  \"replace_start_at\": 12.5,\n  \"replace_end_at\": 20.0,\n  \"lyrics\": \"This is where my story begins\",\n  \"lyrics_section_to_replace\": \"New lyrics\",\n  \"gender\": \"\",\n  \"num_outputs\": 2,\n  \"title\": \"My Generated Track\",\n  \"generate_album_cover\": false,\n  \"lyrics_timestamps\": false, \n  \"webhook_url\": \"https://example.com/webhook\"\n}\n\n# Option 1: audio_url\ndata[\"audio_url\"] = \"<YOUR_AUDIO_URL>\"\nresponse = requests.post(url, headers=headers, data=data)\n\n# Option 2: File Upload\n# with open(\"song.mp3\", \"rb\") as f:\n#     files = {\"audio_file\": f}\n#     response = requests.post(url, headers=headers, data=data, files=files)\n\n print(response.json())"
      }
    ]
  }
},
"/v1/sing_over_instrumental": {
  "post": {
    "summary": "Sing Over Instrumental Using Prompt and Lyrics",
    "description": "This endpoint allows users to sing over an instrumental audio track using a text prompt and lyrics. It supports either a file upload or a URL to the input audio and generates a vocal overlay based on the provided lyrics and style.",
    "requestBody": {
      "required": true,
      "content": {
        "multipart/form-data": {
          "schema": {

            "type": "object",
            "properties": {
              "audio_file": {
                "type": "string",
                "format": "binary",
                "description": "Uploaded instrumental audio file."
              },
              "audio_url": {
                "type": "string",
                "description": "Input audio URL (supported format: YouTube URL)."
              },
              "prompt": {
                "type": "string",
                "description": "Description of the singing style, tone, or genre.",
                "example": "Sing emotional vocals over a soft piano instrumental."
              },
              "lyrics": {
                "type": "string",
                "description": "The lyrics to be sung over the instrumental.",
                "example": "Never mind I'll find someone like you...",
                "maxLength": 5000
                
              },
              "gender": {
                "type": "string",
                "description": "Voice gender to guide generation.",
                "enum": ["male", "female", "neutral"],
                "example": ""
              },
              "title": {
                    "type": "string",
                    "description": "Title of the generated music track"
                  },
              "generate_album_cover": {
                    "type": "boolean",
                    "description": "Whether to generate an album cover for the generated audio",
                    "default": false
                  },
              "lyrics_timestamps": {
                "type": "boolean",
                "description": "Whether to generate timestamps for the lyrics", 
                "default": false
              },
              "webhook_url": {
                "type": "string",
                "description": "Callback URL to receive status updates or final audio result.",
                "example": "https://yourdomain.com/webhook"
              }
            },
            "required": ["prompt", "lyrics"],
            "anyOf": [
              { "required": ["audio_url"] },
              { "required": ["audio_file"] }
            ]
          }
        }
      }
    },
    "responses": {
      "200": {
  "description": "Successfully initiated Sing Over Instrumental task",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean" },
          "message": { "type": "string" },
          "task_id": { "type": "string" },
          "conversion_id_1": { "type": "string" },
          "conversion_id_2": { "type": "string" },
          "is_flagged": { "type": "boolean" },
          "reason": { "type": "string" },
          "eta": {
            "type": "integer",
            "description": "Estimated processing time in seconds"
          },
          "status": { "type": "string" },
          "credit_estimate": { "type": "number", "format": "float" },
          "error_message": { "type": "string" },
          "error_message_detail": { "type": "string" },
          "missing_input_fields": { "type": "string" },
          "predicted_user_intent": { "type": "string" }
        }
      },
      "example": {
        "success": true,
        "message": "Sing Over Instrumental request submitted successfully",
        "task_id": "653c5108-c827-4568-9671-9259fd6b44cc",
        "conversion_id_1": "1d712957-00d9-493a-a6aa-8497ccaea9bc",
        "conversion_id_2": "7d6fa7a2-292c-4a95-8bda-df8ccce44bef",
        "is_flagged": false,
        "reason": "",
        "eta": 258,
        "status": "IN_QUEUE",
        "credit_estimate": 0.1,
        "error_message": "",
        "error_message_detail": "",
        "missing_input_fields": "",
        "predicted_user_intent": ""
      }
    }
  }
},
      "402": {
        "description": "Payment Required",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INSUFFICIENT_CREDITS",
              "message": ""
            }
          }
        }
      },
      "422": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "UNPROCESSABLE_CONTENT",
              "message": ""
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INTERNAL_SERVER_ERROR",
              "message": ""
            }
          }
        }
      }
    },
    "security": [
      { "ApiKeyAuth": [] }
    ],
    "x-codeSamples": [
      {
        "lang": "Python",
        "source": "import requests\n\nurl = \"https://api.musicgpt.com/api/public/v1/sing_over_instrumental\"\nheaders = {\"Authorization\": \"<API_KEY>\"}\ndata = {\n  \"prompt\": \"Sing emotional vocals over a soft piano instrumental.\",\n  \"lyrics\": \"Never mind I'll find someone like you...\",\n  \"gender\": \"\",\n  \"title\": \"My Generated Track\",\n  \"generate_album_cover\": false,\n  \"lyrics_timestamps\": false,\n  \"webhook_url\": \"https://yourdomain.com/webhook\"\n}\n\n# Option 1: Use audio_url\ndata[\"audio_url\"] = \"<YOUR_AUDIO_URL>\"\nresponse = requests.post(url, headers=headers, data=data)\n\n# Option 2: Upload file\n# with open(\"audio.mp3\", \"rb\") as f:\n#     files = {\"audio_file\": f}\n#     response = requests.post(url, headers=headers, data=data, files=files)\n\n print(response.json())"
      }
    ]
  }
},

"/v1/file_convert": {
  "post": {
    "summary": "Convert audio file to different format",
    "description": "Initiate a file conversion task using either an audio URL or file upload with optional format parameters and webhook callback.",
    "requestBody": {
      "required": true,
      "content": {
        "multipart/form-data": {
          "schema": {
            "type": "object",
            "properties": {
              "audio_url": {
                "type": "string",
                "description": "Input audio URL (supported format: YouTube URL)."
              },
              "audio_file": {
                "type": "string",
                "format": "binary",
                "description": "Audio file to upload and convert directly"
              },
              "target_format": {
                "type": "string",
                "description": "Target format for conversion",
                "enum": ["mp3", "wav", "flac", "ogg", "aac", "webm"],
                "example": "wav"
              },
              "target_sr": {
                "type": "integer",
                "description": "Target sample rate in Hz (optional) - can be any of [8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000, 192000]",
                "enum": [8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000, 192000],
                "default": 44100,
                "example": 44100
              },
              "target_bit_depth": {
                "type": "integer",
                "description": "Target bit depth (16, 24, or 32)",
                "enum": [16, 24, 32],
                "example": 24
              },
              "webhook_url": {
                "type": "string",
                "description": "Callback URL for async processing results",
                "example": "https://your-webhook-url.com/callback"
              }
            },
            "required": ["target_format"],
            "anyOf": [
              { "required": ["audio_url"] },
              { "required": ["audio_file"] }
            ]
          }
        }
      }
    },
    "responses": {
      "200": {
  "description": "Successfully initiated task",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean" },
          "task_id": { "type": "string" },
          "conversion_id": { "type": "string" },
          "eta": { "type": "integer" },
          "credit_estimate": { "type": "number" },
          "message": { "type": "string" },
          "status": { "type": "string" }
        },
        "example": {
          "success": true,
          "task_id": "7024eac0-02e2-4811-96e3-7031f007f97f",
          "conversion_id": "a1286a84-d886-47d9-a717-77af15894cb9",
          "eta": -1,
          "credit_estimate": 19.833,
          "message": "",
          "status": "IN_QUEUE"
        }
      }
    }
  }
},
      "402": {
        "description": "Payment Required",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INSUFFICIENT_CREDITS",
              "message": ""
            }
          }
        }
      },
      "422": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "UNPROCESSABLE_CONTENT",
              "message": ""
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INTERNAL_SERVER_ERROR",
              "message": ""
            }
          }
        }
      }
    },
    "security": [
      { "ApiKeyAuth": [] }
    ],
 "x-codeSamples": [
  {
    "lang": "Python",
    "source": "import requests\n\nurl = \"https://api.musicgpt.com/api/public/v1/file_convert\"\n\nheaders = {\n    \"Authorization\": \"<API_KEY>\"\n}\n\ndata = {\n    \"target_format\": \"wav\",\n    \"target_sr\": 44100,\n    \"webhook_url\": \"https://example.com/my-webhook\"\n}\n\n# Option 1: audio_url\ndata[\"audio_url\"] = \"<YOUR_AUDIO_URL>\"\nresponse = requests.post(url, headers=headers, data=data)\n\n# Option 2: File Upload\n# with open(\"song.mp3\", \"rb\") as f:\n#     files = {\"audio_file\": f}\n#     response = requests.post(url, headers=headers, data=data, files=files)\n\nprint(response.json())"
  }
]
  }
},
"/v1/prompt_to_lyrics": {
  "get": {
    "summary": "Convert Prompt to Lyrics",
    "description": "This endpoint takes a natural language prompt (e.g., a theme, vibe, or idea) and generates original lyrics based on it. If the prompt has been used before, a variation may be returned. It also estimates the credit cost of generation.",
    "parameters": [
      {
        "name": "prompt",
        "in": "query",
        "required": true,
        "description": "The theme or idea you'd like lyrics generated for.",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1000,
          "example": "A hopeful song about starting over"
        }
      }
    ],
    "responses": {
      "200": {
        "description": "Lyrics generated successfully",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": { "type": "boolean" },
                "task_id": { "type": "string" },
                "title": { "type": "string" },
                "music_style": { "type": "string" },
                "message": { "type": "string" },
                "lyrics": { "type": "string" },
                "conversion_id": { "type": "string" },
                "credit_estimate": { "type": "number", "format": "float" }
              },
              "example": {
                "success": true,
                "task_id": "0caa0bc2-d05a-414a-a730-a78e8e7f0b31",
                "message": "Lyrics Generated Successfully",
                "title": null,
                "music_style": null,
                "conversion_id": null,
                "lyrics": "[Verse 1]\nYou left ...",
                "credit_estimate": 0.005
              }
            }
          }
        }
      },
      "402": {
        "description": "Payment Required",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INSUFFICIENT_CREDITS",
              "message": ""
            }
          }
        }
      },
      "422": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "UNPROCESSABLE_CONTENT",
              "message": ""
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INTERNAL_SERVER_ERROR",
              "message": ""
            }
          }
        }
      }
    },
    "security": [
      { "ApiKeyAuth": [] }
    ]
  }
},

"/v1/image_generator": {
  "post": {
    "summary": "Generate Image Based on Given Prompt",
    "description": "Creates an AI-generated image from a text prompt and optional style settings. The generation process is asynchronous and returns a task ID for tracking.",
    "requestBody": {
      "required": true,
      "content": {
        "application/x-www-form-urlencoded": {
          "schema": {
            "type": "object",
            "properties": {
              "style_preset": {
                "type": "string",
                "description": "Preset style for image generation.",
                "default": "standard",
                "example": "Anime"
              },
              "prompt": {
                "type": "string",
                "description": "Text prompt guiding the image generation.",
                "example": "A futuristic cyberpunk city at sunset with flying cars."
              },
              "height": {
                "type": "integer",
                "description": "Image height in pixels. Must be a multiple of 16.",
                "default": 960,
                "example": 960
              },
              "width": {
                "type": "integer",
                "description": "Image width in pixels. Must be a multiple of 16.",
                "default": 544,
                "example": 544
              },
              "seed": {
                "type": "integer",
                "description": "Deterministic generation seed. Randomized if omitted.",
                "example": 12345
              },
              "webhook_url": {
                "type": "string",
                "description": "Callback URL for asynchronous processing results.",
                "example": "https://your-webhook-url.com/callback"
              }
            }
          }
        }
      }
    },
    "responses": {
      "200": {
        "description": "Successfully initiated image generation",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "task_id": {
                  "type": "string"
                },
                "conversion_id": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "eta": {
                  "type": "integer"
                },
                "credit_estimate": {
                  "type": "number",
                  "format": "float"
                },
                "message": {
                  "type": "string"
                }
              },
              "example": {
                "success": true,
                "task_id": "imggen789",
                "conversion_id": "conv456",
                "status": "IN_QUEUE",
                "eta": 45,
                "credit_estimate": 0.5,
                "message": "Successfully published to queue"
              }
            }
          }
        }
      },
      "402": {
        "description": "Payment Required",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INSUFFICIENT_CREDITS",
              "message": ""
            }
          }
        }
      },
      "422": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "UNPROCESSABLE_CONTENT",
              "message": ""
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INTERNAL_SERVER_ERROR",
              "message": ""
            }
          }
        }
      }
    },
    "security": [
      {
        "ApiKeyAuth": []
      }
    ]
  }
},

"/v1/image_to_song": {
    "post": {
      "summary": "Generate a Song from an Image",
      "description": "Generate a song from an image by analyzing it and creating music based on visual content. The process can optionally include custom lyrics, voice conversion, and various musical parameters.",
      "requestBody": {
        "required": true,
        "content": {
          "multipart/form-data": {
            "schema": {
              "type": "object",
              "properties": {
                "image_file": {
                  "type": "string",
                  "format": "binary",
                  "description": "Image file to upload and analyze. Supported formats: JPEG, PNG, GIF, BMP, WEBP."
                },
                "image_url": {
                  "type": "string",
                  "description": "URL of the image to analyze. Either this or image_file must be provided."
                },
                "prompt": {
                  "type": "string",
                  "description": "Additional prompt to guide the song generation from the image.",
                  "maxLength": 1000,
                  "example": "Generate a relaxing acoustic track inspired by this scene."
                },
                "lyrics": {
                  "type": "string",
                  "description": "Custom lyrics to include in the generated audio.",
                  "maxLength": 5000,
                  "example": "Let the colors of the sunset fill your heart."
                },
                "negative_tags": {
                  "type": "string",
                  "description": "Tags or themes to avoid in the song.",
                  "example": "no heavy metal, avoid loud drums"
                },
                "make_instrumental": {
                  "type": "boolean",
                  "description": "Generate instrumental output only. Lyrics will be ignored.",
                  "default": false
                },
                "vocal_only": {
                  "type": "boolean",
                  "description": "Generate vocal-only output.",
                  "default": false
                },
                "key": {
                  "type": "string",
                  "description": "Musical key for the song.",
                  "example": "C major"
                },
                "bpm": {
                  "type": "integer",
                  "description": "Beats per minute for the song tempo. Defaults to 0 (auto-selected).",
                  "default": 0
                },
                "webhook_url": {
                  "type": "string",
                  "description": "Optional callback URL for async processing results.",
                  "example": "https://example.com/webhook"
                },
                "voice_id": {
                  "type": "string",
                  "description": "Voice ID for converting the generated audio. Cannot be used with vocal_only mode."
                }
              },
              "anyOf": [
                { "required": ["image_file"] },
                { "required": ["image_url"] }
              ]
            }
          }
        }
      },
      "responses": {
        "200": {
          "description": "Successfully initiated image-to-song task",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "success": { "type": "boolean" },
                  "message": { "type": "string" },
                  "task_id": { "type": "string" },
                  "conversion_id_1": { "type": "string" },
                  "conversion_id_2": { "type": "string" },
                  "eta": { "type": "integer", "description": "Estimated processing time in seconds" },
                  "credit_estimate": { "type": "number", "format": "float" }
                },
                "example": {
                  "success": true,
                  "message": "Message Published To Queue",
                  "task_id": "task_12345",
                  "conversion_id_1": "conv_12345",
                  "conversion_id_2": "conv_54321",
                  "eta": 300,
                  "credit_estimate": 150.5
                }
              }
            }
          }
        },
        "402": {
        "description": "Payment Required",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INSUFFICIENT_CREDITS",
              "message": ""
            }
          }
        }
      },
      "422": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "UNPROCESSABLE_CONTENT",
              "message": ""
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error_code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error_code": "INTERNAL_SERVER_ERROR",
              "message": ""
            }
          }
        }
      }
    },
      "security": [
        { "ApiKeyAuth": [] }
      ],
      "x-codeSamples": [
        {
          "lang": "Python",
          "source": "import requests\n\nurl = \"https://api.musicgpt.com/api/public/v1/image_to_song\"\nheaders = {\"Authorization\": \"<API_KEY>\"}\ndata = {\n    \"image_url\": \"<YOUR_AUDIO_URL>\",\n    \"prompt\": \"Generate a relaxing acoustic track inspired by this scene.\",\n    \"lyrics\": \"Let the colors of the sunset fill your heart.\",\n    \"make_instrumental\": False,\n    \"vocal_only\": False,\n    \"key\": \"C major\",\n    \"bpm\": 120,\n    \"webhook_url\": \"https://example.com/webhook\",\n    \"voice_id\": \"voice_123\"\n}\n\n# Option 1: Using image URL\nresponse = requests.post(url, headers=headers, data=data)\nprint(response.json())\n\n# Option 2: Uploading a local image file\n# with open(\"image.png\", \"rb\") as f:\n#     files = {\"image_file\": f}\n#     response = requests.post(url, headers=headers, data=data, files=files)\n#     print(response.json())"
        }
      ]
    }
  }

  





},
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization"
      }
    }
  }
}

