API endpoints similar to OpenAI #2252
Replies: 1 comment
-
I'm confused with this too, I thought open-webui already have openai-compatible api. trying to search this using search engine is pure pain since it keeps pointing me https://docs.openwebui.com/tutorial/openai anyway, this is in the readme;
but when i created an api key in Settings -> Account, it doesn't seems i can use this properly. curl https://api.openai.com/v1/models \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "OpenAI-Organization: YOUR_ORG_ID" \
-H "OpenAI-Project: $PROJECT_ID" but since open-webui has no configuration for curl https://example.de/v1/models -H "Authorization: Bearer sk-9b30b****" the output: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.png" />
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta name="robots" content="noindex,nofollow" />
<link
rel="search"
type="application/opensearchdescription+xml"
title="Open WebUI"
href="/opensearch.xml"
/>
<script>
// On page load or when changing themes, best to add inline in `head` to avoid FOUC
...snip...
style="
position: absolute;
width: 6rem;
height: 6rem;
top: 46%;
left: 50%;
margin: -40px 0 0 -40px;
"
src="/logo.svg"
/>
<!-- <span style="position: absolute; bottom: 32px; left: 50%; margin: -36px 0 0 -36px">
Footer content
</span> -->
</div>
</body>
</html> this output probably just render the Open WebUI logo using it's default template css. I'm trying to figure this out since i really want to use my open-webui instance in Obsidian, with this plugin https://github.com/pfrankov/obsidian-local-gpt but i guess it's not possible, and i have to connect this plugin directly to ollama, making me have to expose it's port to my lan / tailscale network: after about half an hour trying to write this reply I just realized I might be confusing open-webui with https://lmstudio.ai/docs/local-server
I need some sleep. so I guess I'll be using LM Studio or illama.cpp for awhile until open-webui have similar supported endpoints as I needed API access more than webui for time being. edit, I finally managed to get it work. apparently I have to append
it can fetch the model list just fine. here i made a short recording while it's running. It's pretty wonky but it prove that it'll works. recording.mp4my open-webui were behind cloudflared tunnel, so it's good to see that it'll works. edit(1): adding screenshot |
Beta Was this translation helpful? Give feedback.
-
Does this setup offer endpoints for Chat completion and embeddings similar to what OpenAI is offering? I am exploring to use the self hosted models via APIs to build a custom chatbot.
Beta Was this translation helpful? Give feedback.
All reactions