Save TTS output to S3 Bucket?

I have used other third party AI API where you start an image generation, it gives you a taks/job id. You can then query using that ID. The API will have completed and will save the output generation to my S3 Bucket. I then query the status and the API sends me the path to the generated output.

This works well as it allows me control the querying and not have wait while the API finished the task.

Is there a way to use this method with OpenAI image and TTS generation e.g.

  1. Request a Text to Speech generation from openai
  2. openai starts your task and send you a task id immediately
  3. after every 3 seconds i then query the API using CURL (or similar) for status update using the task id
  4. upon success the API sends me the path to the .mp3 file on their server OR my S3 bucket
  5. I then download the mp3 file
1 Like