OpenAI compatibility for pdf file

Hello folk,
I’m trying to work with PDF files using the OpenAI with Gemini API, but I’m having difficulty understanding how to properly implement this. Could someone please explain:

How to upload and process PDF files with OpenAI’s library when i visit the doc of gemini on openai i don’t see any guidance about application/pdf data

What are the best practices for extracting text and data from PDFs if i use openai with gemini api
Are there any compatibility issues between OpenAI and Gemini API when working with PDFs

I would appreciate any examples, documentation links, or code samples that could help me get started.

Hi @Ngyn_An

Welcome to the forum.

You can add files < 20MB as inlineData to your prompt and submit it to the API endpoint.

Cheers

Hi can you give an example or a document link to implement that. Appreciate

Currently, OpenAI compatibility does not support processing PDF files. You can refer to this documentation to see what file types are supported.

Thank you.

1 Like

FYI, I have raised a feature request to support the PDF file type.

Thanks

2 Likes