Describe the bug
Attempting to call the API
`fetch("http://---.--.---.--:8880/v1/audio/speech", {
headers: {
'Content-Type': 'application/json', // REQUIRED for FastAPI to see your JSON body
'Accept': 'application/json', // Helps ensure you get JSON back, not raw audio
},
method: "POST",
body: JSON.stringify({
"model": "kokoro",
"input": "Hello from Javascript.",
"voice": "af_bella",
"stream": false, // MUST be false to get a download link
"return_download_link": true
})
})
.then(res => res.json()) // Parse as JSON instead of text
.then(data => {
console.log("API Response:", data);
if (data.download_link) {
// Option 1: Just show the link in the console
alert("Download Link: " + data.download_link);
// Option 2: Create a clickable link on the page
const link = document.createElement('a');
link.href = data.download_link;
link.innerText = "Click here to download your WAV file";
document.body.appendChild(link);
} else {
console.error("Link not found in response. Check server logs.");
}
})
.catch(err => console.error("Fetch Error:", err));
`
i get a error response
Fetch Error: SyntaxError: Unexpected token 'I', "ID3������""... is not valid JSON (anonymous) @ VM69:34 Promise.catch (anonymous) @ VM69:34
Branch / Deployment used
Using GPU docker in Unraid Kokoro TTS API 1.0.0 OAS 3.1
Operating System
Unraid7.2.4, docker version: latest.
Nvidia GPU Nvidia Driver Version: 595.58.03
Open Source Kernel Module: No
Installed GPU(s):
0:NVIDIA GeForce GTX 1660 Ti
07:00.0
GPU-131d7e98-bc16-c9a1-d5f7-2e85a1eefa1e
Additional context
Add any other context about the problem here.
Describe the bug
Attempting to call the API
`fetch("http://---.--.---.--:8880/v1/audio/speech", {
headers: {
'Content-Type': 'application/json', // REQUIRED for FastAPI to see your JSON body
'Accept': 'application/json', // Helps ensure you get JSON back, not raw audio
},
method: "POST",
body: JSON.stringify({
"model": "kokoro",
"input": "Hello from Javascript.",
"voice": "af_bella",
"stream": false, // MUST be false to get a download link
"return_download_link": true
})
})
.then(res => res.json()) // Parse as JSON instead of text
.then(data => {
console.log("API Response:", data);
if (data.download_link) {
// Option 1: Just show the link in the console
alert("Download Link: " + data.download_link);
} else {
console.error("Link not found in response. Check server logs.");
}
})
.catch(err => console.error("Fetch Error:", err));
`
i get a error response
Fetch Error: SyntaxError: Unexpected token 'I', "ID3������""... is not valid JSON (anonymous) @ VM69:34 Promise.catch (anonymous) @ VM69:34Branch / Deployment used
Using GPU docker in Unraid Kokoro TTS API 1.0.0 OAS 3.1
Operating System
Unraid7.2.4, docker version: latest.
Nvidia GPU Nvidia Driver Version: 595.58.03
Open Source Kernel Module: No
Installed GPU(s):
0:NVIDIA GeForce GTX 1660 Ti
07:00.0
GPU-131d7e98-bc16-c9a1-d5f7-2e85a1eefa1e
Additional context
Add any other context about the problem here.