Rate limit reached for tts-1 with a single request

Is there a place where we have information about the limitations of tokens or characters per request using the tts-1 model?
I didn’t find anything about tokens or character limits, only RPM.

I ask because I’m making one single request for a long text with more than 5000 characters, and I always get the following error:

429 Rate limit reached for tts-1 on requests per min (RPM): Limit 3, Used 3, **Requested 1**. Please try again in 20s. Visit https://platform.openai.com/account/rate-limits to learn more. :eyes:

According to docs, the TTS models have limitations at the request level (RPM) but no information about TPM (tokens per minute) or characters.

So, the thrown error is confusing me. Any thoughts about that?

Rate limits are here:

https://platform.openai.com/docs/guides/rate-limits/usage-tiers?context=tier-free

Free tier has 3 RPM for tts-1 model; however your account’s limits as set are here:

https://platform.openai.com/account/limits

The API reporting you have used 3 while you have used 0 is an anomaly, however the rate isn’t strictly by-the-minute, where you wait for the next minute and it is reset.

@_j Thanks, but I Know the limits of RPM. As I said, I’m making just one request per minute and have the limits reach out. Why? I have 3 RPMs.

That’s my motivation for asking for information about tokens or characters using this TTS model.

The character limit is currently 4096.

https://platform.openai.com/docs/api-reference/audio/createSpeech#audio-createspeech-input

Not getting the right error message would be a bug.

@_j I missed this! Thank you! Yeah, it is strange. I’m investigating what I am doing wrong in not receiving the correct error. Thanks again for pointing me to the max char. :call_me_hand:

Running into the same “insufficient quota” error running the exact same code as the text-to-speech user guide :frowning: I for sure have not ran into the 3rpm limit yet because this is literally the first attempt. Have you figured out why yet?

I’m facing the same issue. My word count is way below the character limit, and I’m sure I haven’t reached the PRM as I faced the issue with my first request. I’d appreciate it if someone could share a solution to this issue if you found one.

@sy457 @hayata.sue

In my specific case, it was a logic issue of my app that I realized later.

I have a retry count in case of a problem, and the log was firing only at the end of all retries. So, at the first attempt, I’m facing the first max char validation (which fails), and I try again without showing the first error message.

That’s why I got the wrong error message (max RPM rather than max char).

const MAX_RETRIES = 5
const DELAY_IN_MS = convertTimeFromTo(2, 'seconds', 'milliseconds')

export default async function createSpeech(params) {
  let retryCount = 0
  let speechError = null

  while (retryCount < MAX_RETRIES) {
    try {
      const speech = await openai.audio.speech.create(params)
      return speech
    } catch (error) {
      speechError = error?.message
      retryCount++
      await new Promise((resolve) => setTimeout(resolve, DELAY_IN_MS))
    }
  }
  console.log('speech_error: ', speechError)

  throw apiErrors.max_attempts_openai({
    error: speechError,
    maxRetries: MAX_RETRIES,
  })
}
1 Like