Automating Download of Batch Output from OpenAI API

I am using gspread and pandas with OpenAI’s API to automate a process. I’m utilizing the batch method since it is 50% cheaper. I confirmed it worked because I could download and view the file from the batches menu in OpenAI’s batch interface.

However, I want to automate this process and am having trouble downloading the output as a .txt file using my code. I couldn’t find the necessary information in the API documentation, except for this guide, which I couldn’t get to work.

Can anyone provide guidance on how to achieve this?

What error are you getting?

What’s your code like?

Welcome to the OpenAI Dev Community Forum!