#8946 OpenAI TTS: Error code: 404 - {'statusCode': 404, 'message': 'Cannot POST /api/v1/audio/speech%E2%80%8B/audio/speech', '

67.21**6 Posted at: 32 minutes ago

OpenAI TTS: Error code: 404 - {'statusCode': 404, 'message': 'Cannot POST /api/v1/audio/speech%E2%80%8B/audio/speech', 'error': 'Not Found', 'traceId': '6251df2d454f48eb0f6d9d146606b9ff'}
{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'role': 'Kim Chi', 'filename': 'F:/创业/win-pyvideotrans-v4.19/tmp/1904/1795530154.1329935-openai.wav', 'tts_type': 24}
Traceback (most recent call last):
File "videotrans\tts\_openaitts.py", line 29, in _run
File "openai\_response.py", line 629, in enter
File "openai\resources\audio\speech.py", line 107, in create
File "openai\_base_client.py", line 1332, in post
File "openai\_base_client.py", line 1105, in request
openai.NotFoundError: Error code: 404 - {'statusCode': 404, 'message': 'Cannot POST /api/v1/audio/speech%E2%80%8B/audio/speech', 'error': 'Not Found', 'traceId': '6251df2d454f48eb0f6d9d146606b9ff'}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 23, in run
File "videotrans\tts\__init__.py", line 154, in run
File "videotrans\tts\_base.py", line 98, in run
File "videotrans\tts\_base.py", line 201, in _exec
File "videotrans\tts\_base.py", line 161, in _local_mul_thread
File "videotrans\tts\_base.py", line 216, in _item_task
File "tenacity\__init__.py", line 338, in wrapped_f
File "tenacity\__init__.py", line 477, in call
File "tenacity\__init__.py", line 378, in iter
File "tenacity\__init__.py", line 400, in
File "concurrent\futures\_base.py", line 451, in result
File "concurrent\futures\_base.py", line 403, in __get_result
File "tenacity\__init__.py", line 480, in call
File "videotrans\tts\_openaitts.py", line 44, in _run
videotrans.configure.excepts.StopTask: Error code: 404 - {'statusCode': 404, 'message': 'Cannot POST /api/v1/audio/speech%E2%80%8B/audio/speech', 'error': 'Not Found', 'traceId': '6251df2d454f48eb0f6d9d146606b9ff'}


=
system:Windows-10-10.0.19044-SP0
version:v4.19
frozen:True
language:zh_CN
root_dir:F:/创业/win-pyvideotrans-v4.19

1 Replies

#1 DeepSeek reply at 31 minutes ago

问题出在「OpenAI TTS 的 API 地址填写有误」:报错 URL 里出现了 %E2%80%8B(零宽空格,即不可见字符),并且路径被拼接成了 /audio/speech/audio/speech。软件会自动在 API 地址后追加 /audio/speech,你填写的地址末尾既带了隐藏字符,又已经包含了该路径,因此返回 404。

解决步骤:

  1. 打开 菜单 → 翻译设置 → OpenAI TTS,把 API 地址输入框全部清空,不要复制粘贴,要手动重新输入。
  2. 只填写接口基础地址,不要带 /audio/speech,也不要带尾部斜杠或空格。例如使用 OpenAI 官方为 https://api.openai.com/v1;使用中转服务时按其文档填写到 /v1 为止。
  3. 确认 API Key 与地址属于同一服务商,保存后重新试听。

补充说明:

  • 该报错里的 traceId、statusCode 格式说明你使用的是第三方中转服务,请核对它的语音合成接口路径是否为标准的 /v1/audio/speech;若不是,需改用支持标准 OpenAI 格式的服务,或改用 自定义 TTS API 渠道。
  • 提示词中提到角色 Kim Chi,请确认该中转服务确实提供该音色,否则即便地址正确也会失败。
Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Dondate via ko-fi.com

Related resource