HTTP 500 Errors in TTS API

I’ve been using “tts-1-hd” via API for months now. It worked fine w/o any errors (I’m in tier 5). About 2 weeks ago, I startet to see some HTTP 500 errors, and now I estimate that 10 % of my requests result in HTTP 500 aka ‘internal server error’. My code has not changed, so I assume the problem is on OpenAI side. Any ideas or comments?

50x codes, especially 500 are notoriously difficult to handle as they usually are a catch-all net for unexpected issues.

Considering that there isn’t a massive uptick of similar complaints I would focus on what you’re sending and how.

  1. Are you using the official OpenAI library?
  2. Are you sending audio from random people
  3. Does this audio have variance in its format?
  4. Can you share your code?
1 Like

I’m using the following Java API client: com.theokanning.openai-gpt3-java:service:0.18.1

I do not send any audio, I send text and expect the tts API (text-to-speech) to return audio.

Ah, sorry. I misread.

An initial issue I’m seeing is that the repository is no longer maintained.

:warning: Notice: This project is no longer maintained and has been archived as of June 6th, 2024. Thank you to everyone who has contributed and supported this project. While the repository will remain available in its current state, no further updates or support will be provided. Please feel free to fork and modify the code as needed.

Recent, but still an issue. OpenAI is constantly updating their services and API.

Although I don’t see any specific issues raised regarding the TTS endpoint I would immediately recommend changing to a more maintained library. This one seems to have a lot of failure points.

There is one that is maintained by a fellow user of this forum (who comes and visits and could probably provide you insights in the future)

If you decide to stay with your current library (understandable) what kind of language are you sending & how large is it? Maybe someone more comfortable with the TTS endpoint could chime in, as I have absolutely no experience with it.

2 Likes

I use TTS with 8 different languages and every request is one paragraph of speech. But I do not think that the problem is related to language or text size, because when I retry the identical request, it succeeds.

Intermittent issues are the worst. Especially when using a client library.
It could entirely be OpenAI’s issue. If it is, there’s nothing we can do about. They have their own internal logging tools to catch these issues and inspect. In almost all cases these types of global issues are caught, and silently worked on.

I’d like to really stretch out the thought of it being a client issue. At the very least it’s something that can be immediately changed.

Going back to my previous post. The current library that you are using is no longer maintained, and also seems to have a lot of failure points as a result of bad programming practices. I highly, highly, HIGHLY recommend moving to another library, or even just writing the code yourself. There WILL be a time in the future where the endpoint is updated and your code will be broken.

For testing I would recommend gathering a decent amount of these TTS prompts, and then use the built-in Java class HttpClient to run these using the same paradigm that you currently have. This eliminates any silly issues raised by the library, and truthfully, in a lot of cases these libraries really don’t abstract much away that’s worthwhile (If you are using only a single endpoint)

https://docs.oracle.com/en%2Fjava%2Fjavase%2F11%2Fdocs%2Fapi%2F%2F/java.net.http/java/net/http/HttpClient.html

There is both sync and async example that are less than 10 lines of code.

It would be very worthwhile to try this out and see if the 500 errors persist.

1 Like

Thank you for the link to sashirestela/simple-openai. I will migrate to that library to be safe in the future. But still I don’t think it’s a client-side problem because after some retries, my requests succeed.

tts-1-hd seems to be back to normal, thank you OpenAI team :slight_smile: