The 404 response indicates the server is reachable, but the /tts route does not exist at 127.0.0.1:9874. In other words, the address you filled in is not the GPT-SoVITS API service or the API version does not match the route actually exposed.
Troubleshooting steps:
- Confirm which script you started: start
api.py for v1 API or api_v2.py for v2. If the "api_v2" checkbox in the software's GPT-SoVITS settings is inconsistent with the script you started, /tts returns 404. Make them match, or test with the other option. - Confirm that the port is the API port and not the WebUI port. GPT-SoVITS WebUI usually uses port 7860, and api.py usually uses port 9880.
9874 is likely a WebUI or a non-API service. If you changed the API port, fill in the actual API port you set. - Open
http://127.0.0.1:9874/ in a browser: if you see the Gradio WebUI page, that confirms the address points to the WebUI and not the API. - Your version is v3.78, which is old. If the problem persists after the above, upgrade to the latest version and retry.
If none of the above solves the problem, provide the terminal output of the GPT-SoVITS API process when the request was made (the request log printed by api.py), and the last 30 lines of the error information from the logs/ folder in the software installation directory.
Please refer to the related documentation: