Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Try submitting a request to api/generate with make_instrumental set to false. Mine still returns an instrumental with no lyrics.
Expected behavior
Setting the make_instrumental to false should return a song with lyrics
Screenshots
I have content-type set to application/json
Here is my code (it's in Swift):
func generateSunoAPI(prompt: String, completion: @escaping (_ response: Array<SunoAPIAudioResponse>?, _ error: Error?) -> Void) {
let body: [String: Any] = ["prompt": "\(prompt)", "make_instrumental": "false", "wait_audio": "true"]
let bodyData = try? JSONSerialization.data(withJSONObject: body)
Task {
do {
var request = URLRequest(url: endpointUrl!)
request.setValue("application/json; charset=utf-8", forHTTPHeaderField: "Content-Type")
request.setValue("application/json; charset=utf-8", forHTTPHeaderField: "Accept")
request.httpMethod = "POST"
request.timeoutInterval = 120
request.httpBody = bodyData
let (data, response) = try await URLSession.shared.data(for: request)
guard let httpResponse = response as? HTTPURLResponse, (200...299).contains(httpResponse.statusCode) else {
completion(nil, NetworkError.badStatus)
return
}
let responseData = try JSONDecoder().decode(Array<SunoAPIAudioResponse>.self, from: data)
print("SUNO GENERATE RESPONSE DATA")
print(responseData)
completion(responseData, nil)
} catch {
print("There was an error generating suno API in generateSunoAPI")
completion(nil, error)
}
}
}
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior: Try submitting a request to
api/generate
withmake_instrumental
set tofalse
. Mine still returns an instrumental with no lyrics.Expected behavior Setting the
make_instrumental
tofalse
should return a song with lyricsScreenshots
I have
content-type
set toapplication/json
Here is my code (it's in Swift):