How to send PDF to extract details

Hi,

Currently I’m using docling to convert PDF to Markdown before I feed it to GPT-4.1 to extract the details into JSON format.

May I know if I can use OpenAI JavaScript API to send the PDF to OpenAI model directly and extract the details into JSON format (bypassing docling)?

Can you point me to the example or documents of how to do this?

https://platform.openai.com/docs/guides/pdf-files?api-mode=responses&lang=javascript

1 Like

Hi
When reading the example at https://platform.openai.com/docs/guides/pdf-files?api-mode=responses#base64-encoded-files,

{
  type: "input_file",
  filename: "draconomicon.pdf",
  file_data: `data:application/pdf;base64,${base64String}`,
},

Is there a documentation that describes what is the schema of this “input_file” object? The system throws error when filename is missing. So, where to see a list of mandatory properties of this object?

So, where to see a list of mandatory properties of this object?

AFAICT, what you see is what you get…

1 Like