Who tried to use an API to train and ask a PDF document?

I want to use an API to train a PDF and chat with. It seems that chatpdf didn’t open their APIs yet to do that. Anyone tried other APIs ?

I believe there are several in the Plugins store, you can just search for PDF.

I want an API access which can be used from my own website.