API JSON request - Read a specific file & use contents in the response?

Tinkering with Bubble template which has an API plugin to Open AI.
Enjoying making simple tools for custom prompts, working well. Now getting a bit more adventurous and trying to see if can include URLs inside the prompts and ask Open AI to read them and modify response based on them.
In the last few days Open AI has added this feature to its chat service (allowing files to be uploaded or specific URLs can be read), but does not seem to be possible through the API?
Is there a work around for the API?
I want the prompt I send via the API to include an instruction to read from a specific URL and take into account in the response.
I’ve tested using the new GPT beta and precisely this is possible to do and a great feature. Any advice appreciated.

Hi and welcome to the Developer Forum!

With the API as standard, assuming you are not using assistants, you would read that file yourself and include it as part of the prompt, that way it’s included as context, if you are trying to find a way not to send many tokens… sorry that will not work, you need to send everything you require for each and every API call.

3 Likes