mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[GH-ISSUE #21826] feat: Add /api/completions endpoint for 100% OpenAI compatibility
#35114
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @hdnh2006 on GitHub (Feb 24, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/21826
Check Existing Issues
Verify Feature Scope
Problem Description
Hello! I see Open WebUI as an orchestator for AI governance as well and not only as a single interface. Through the API Key provided by the interface, I connect with external apps while keeping all the control.
Apps like continue use an endpoint called
/completionswhich is not the same than/chat/completions. And I get an error like this:As we could do in the past with this PR, making Open WebUI compatible with the
/embeddingsendpoint. I would like to have the same behaviour with/completionsendpoint.I see somebody did in the past a PR that was closed without any feedback. I don't think the process is so complicated, we already have a similar behaviour for "continue response" featrue:
Would you be open to a PR?
Desired Solution you'd like
The endpoint should call the
/chat/completionsendpoint using the variableDEFAULT_AUTOCOMPLETE_GENERATION_PROMPT_TEMPLATEAlternatives Considered
No response
Additional Context
We did something similar in the past with embeddings endpoint
@Classic298 commented on GitHub (Feb 24, 2026):
a /completions endpoint already exists.
You are missing the v1 from your url path it looks like.
@Classic298 commented on GitHub (Feb 24, 2026):
ah you mean only open-webui-url.com/completions?
no v1
no api?
@hdnh2006 commented on GitHub (Feb 24, 2026):
Sorry, but I can't see it in the swagger. As I say, all of them are
{something}/completionsAs you can see in the following image, there's no such
/api/completionsendpointNo, as I describe, the endpoint should keep
api. Something likehttps://open-webui-url.com/api/completions