Upload pdf file via api and ask for certain information from it

Hello,

I’m trying to use chat GPT for below purpose.

  • Upload the pdf file to ChatGPT via API
  • Get a response
  • ask multiple question with that response as source
    ( here we aiming for not to upload the source pdf file each time for each question)

as per documentation, could you please help me with where to have the file name that needs to be uploaded

curl https://api.openai.com/v1/files
-H “Authorization: Bearer $OPENAI_API_KEY”
-F purpose=“fine-tune”
-F file=“@mydata.jsonl

Thanks.