[GH-ISSUE #2711] [FEAT]: Let "/api/v1/openai/chat/completion" or another API return citations. #1741

Closed
opened 2026-02-22 18:26:19 -05:00 by yindo · 1 comment
Owner

Originally created by @GPTLocalhost on GitHub (Nov 24, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2711

What would you like to see?

A similar but different idea to the following: Can the "chat completion" API return citations?

https://github.com/Mintplex-Labs/anything-llm/issues/2430#issue-2568135204

I'm trying to integrate AnythingLLM deeper with Microsoft Word, based on this demo. The idea is to convert the citations in AnythingLLM to footnotes in Word. Currently the "/api/v1/openai/chat/completions" API returns data like the following:

{"id":"bae19b72-3f17-45c6-bf6c-2e99d994fc5e","object":"chat.completion","created":1732495215436,"model":"workspace-1","choices":[{"message":{"role":"assistant","content":" Yes, the AI Scientist is an end-to-end framework designed to automate the generation of research ideas, implementation, and the production of research papers."},"logprobs":null,"finish_reason":"stop"}]}

It is understandable that citations are not included, at least for being compatible with OpenAI's spec. My question is: Is it possible to enhance the API or provide another API for receiving the citation data, say based the returned id in the above API?

Originally created by @GPTLocalhost on GitHub (Nov 24, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2711 ### What would you like to see? A similar but different idea to the following: Can the "chat completion" API return citations? https://github.com/Mintplex-Labs/anything-llm/issues/2430#issue-2568135204 I'm trying to integrate AnythingLLM deeper with Microsoft Word, based on [this demo](https://gptlocalhost.com/demo/#anythingllm). The idea is to convert the citations in AnythingLLM to footnotes in Word. Currently the "/api/v1/openai/chat/completions" API returns data like the following: `{"id":"bae19b72-3f17-45c6-bf6c-2e99d994fc5e","object":"chat.completion","created":1732495215436,"model":"workspace-1","choices":[{"message":{"role":"assistant","content":" Yes, the AI Scientist is an end-to-end framework designed to automate the generation of research ideas, implementation, and the production of research papers."},"logprobs":null,"finish_reason":"stop"}]}` It is understandable that citations are not included, at least for being compatible with OpenAI's spec. My question is: Is it possible to enhance the API or provide another API for receiving the citation data, say based the returned id in the above API?
yindo added the enhancementfeature request labels 2026-02-22 18:26:19 -05:00
yindo closed this issue 2026-02-22 18:26:19 -05:00
Author
Owner

@timothycarambat commented on GitHub (Jul 10, 2025):

To return citations we would need that field present in the real OpenAI api since adding custom fields will break some peoples integrations since the schema responses wont match exactly. In this case you would need to rely on the other chat endpoints and not just the OpenAI ones

@timothycarambat commented on GitHub (Jul 10, 2025): To return citations we would need that field present in the real OpenAI api since adding custom fields will break some peoples integrations since the schema responses wont match exactly. In this case you would need to rely on the other chat endpoints and not just the OpenAI ones
yindo changed title from [FEAT]: Let "/api/v1/openai/chat/completion" or another API return citations. to [GH-ISSUE #2711] [FEAT]: Let "/api/v1/openai/chat/completion" or another API return citations. 2026-06-05 14:42:26 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1741