Accessing the OpenWebUI API
-
wrote on Feb 19, 2025, 8:03 PM last edited by
My goal is to connect OpenWebUI via n8n
I tried with
App ID: http://e704da83-fe32-3032-133f-01ba96ab147b/api/models
and also https://openwebui.domain.tld/api/models
but none of them worksI use the JWT Token with:
Authorization:
Bearer YOUR_API_KEYand saddly it doesnt work.
does anybody succeed ?
-
Works for me . What failed for you? I used a API Key (NOTE: this is different from JWT token, I don't know how to use a JWT token)
-
There was a button to generate the API key. It was not already created .
After I created it, I just ran
curl -H "Authorization: Bearer YOUR_API_KEY" https://openwebui.domain.com/api/models
and it returned me some array. -
wrote on Feb 20, 2025, 12:16 PM last edited by
thanks
so it only works for me in n8n
if I use the external domain (https://openwebui.domain.com/api/models)
it does'nt work with App ID: http://e704da83-fe32-3032-133f-01ba96ab147b/api/models -
-
Staffwrote on Feb 20, 2025, 12:53 PM last edited by nebulon Feb 20, 2025, 1:49 PM
Do you have any error codes or so to share? Also just to make sure, if you run
host e704da83-fe32-3032-133f-01ba96ab147b
from a webterminal into n8n, does it resolve correctly to the openwebui container?If yes, it is also possible that openweb ui validates the hostname which in this case wouldn't be known by it. So either way using the actual domain of the app will be the correct way, also https will only work there.
-
wrote on Feb 22, 2025, 6:34 AM last edited byThis post is deleted!
-
@JOduMonT did you manage to get this solved by using the domain of the app, which would be the correct thing to do.
wrote on Mar 2, 2025, 12:15 PM last edited by@nebulon no
I have another case with a similar issue
in n8n I want to access searxng as a tool to my AI.
in the n8n container I'm able to do query via curl to my searxng via the http://containerID:8888
but inside n8n it say the service is down (refuse to connect)curiously if I use https://searxng.domain.tld it work
As Robi mentionned; does cloudron implemented a firewall internally ?
or maybe it is more a DNS issue since
journalctl -u docker
return me a bunch of DNS error:Mar 01 05:22:50 cloudron dockerd[795]: time="2025-03-01T05:22:50.303058317Z" level=error msg="[resolver] failed to query external DNS server" client-addr="udp:127.0.0.1:56347" dns-server="udp:127.0.0.53:53" error="read udp 127.0.0.1:563> Mar 01 05:23:23 cloudron dockerd[795]: time="2025-03-01T05:23:23.818259449Z" level=error msg="[resolver] failed to query external DNS server" client-addr="udp:127.0.0.1:44377" dns-server="udp:127.0.0.53:53" error="read udp 127.0.0.1:443> Mar 01 05:23:42 cloudron dockerd[795]: time="2025-03-01T05:23:42.069168113Z" level=error msg="[resolver] failed to query external DNS server" client-addr="udp:127.0.0.1:53714" dns-server="udp:127.0.0.53:53" error="read udp 127.0.0.1:537> Mar 01 05:23:59 cloudron dockerd[795]: time="2025-03-01T05:23:59.865583114Z" level=error msg="[resolver] failed to query external DNS server" client-addr="udp:127.0.0.1:39963" dns-server="udp:127.0.0.53:53" error="read udp 127.0.0.1:399> Mar 01 05:24:48 cloudron dockerd[795]: time="2025-03-01T05:24:48.532971799Z" level=error msg="[resolver] failed to query external DNS server" client-addr="udp:127.0.0.1:39152" dns-server="udp:127.0.0.53:53" error="read udp 127.0.0.1:391> Mar 01 05:25:03 cloudron dockerd[795]: time="2025-03-01T05:25:03.514238819Z" level=error msg="[resolver] failed to query external DNS server" client-addr="udp:127.0.0.1:58625" dns-server="udp:127.0.0.53:53" error="read udp 127.0.0.1:586> Mar 01 05:26:24 cloudron dockerd[795]: time="2025-03-01T05:26:24.759362556Z" level=error msg="[resolver] failed to query external DNS server" client-addr="udp:127.0.0.1:40413" dns-server="udp:127.0.0.53:53" error="read udp 127.0.0.1:404> Mar 01 05:26:39 cloudron dockerd[795]: time="2025-03-01T05:26:39.816576683Z" level=error msg="[resolver] failed to query external DNS server" client-addr="udp:127.0.0.1:55967" dns-server="udp:127.0.0.53:53" error="read udp 127.0.0.1:559>
-
So querying via container ID is not really something Cloudron works with. This is just something docker does, but that does not mean that ports are exposed on those interfaces. Also since container ids may change over time, the correct way to do this is to use the normal domain of an app.
-
So querying via container ID is not really something Cloudron works with. This is just something docker does, but that does not mean that ports are exposed on those interfaces. Also since container ids may change over time, the correct way to do this is to use the normal domain of an app.
wrote 25 days ago last edited by@nebulon understood;
it's just in my testing environment (home) I'm use to connect my container via container_name:port
without exposing the port.such as OpenWebUI connect to my Searxng because
--- services: open-webui: searxng: container_name: searxng
Now I understand this is not viable into a multi-domains, multi-services environment
Do you think something similar is possible and viable ?