Possible to upload pdfs via openai api?

ChatGPT premium users are able to upload pdfs through the UI and essentially ‘chat with pdf’ but I am curious if it’s possible to upload the pdf via the api? I am trying to work on a cli tool for uploading math texts and getting answers etc? Please advise.

For retrieval specifically, this doc shows how to upload files using the python SDK. https://platform.openai.com/docs/assistants/tools/uploading-files-for-retrieval

1 Like