Hi,
I’m wondering if it’s possible to retrieve the sources used for generating responses via the OpenAI API, similar to how ChatGPT displays citations when providing information. Is there a way to access or extract these sources directly through the API?
It’s only possible via Assistants API as part of message annotations - in this case it can cite the file/document where the response comes from. See here.
There is no ability for chat completions API to reliably provide the same (at the time of this writing ).
It is more likely you are talking about internet links instead of uploaded document links.
ChatGPT can report on the source links it used, including web links in the output to the URL, because it has an internet search tool, and can link to web sites. It actually had a look at the web and noted where good search results and its information was from.
The API AI can only answer from pretrained knowledge. It doesn’t understand how or why it produces particular knowledge in language completion patterns.
You might not even be giving an application that has internet access.