mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 23:21:44 -05:00
[GH-ISSUE #8317] v0.5.3 (latest) HTTP 405 attempting to connect to endpoint: [BASEURL]:3000/api/v1/chat/completions [BASEURL]:3000/api/chat/completions works #102075
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 @nathan-curtis on GitHub (Jan 4, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/8317
Bug Report
Important Notes
Before submitting a bug report: Please check the Issues or Discussions section to see if a similar issue or feature request has already been posted. It's likely we're already tracking it! If you’re unsure, start a discussion post first. This will help us efficiently focus on improving the project.
Collaborate respectfully: We value a constructive attitude, so please be mindful of your communication. If negativity is part of your approach, our capacity to engage may be limited. We’re here to help if you’re open to learning and communicating positively. Remember, Open WebUI is a volunteer-driven project managed by a single maintainer and supported by contributors who also have full-time jobs. We appreciate your time and ask that you respect ours.
Contributing: If you encounter an issue, we highly encourage you to submit a pull request or fork the project. We actively work to prevent contributor burnout to maintain the quality and continuity of Open WebUI.
Bug reproducibility: If a bug cannot be reproduced with a
:mainor:devDocker setup, or a pip install with Python 3.11, it may require additional help from the community. In such cases, we will move it to the "issues" Discussions section due to our limited resources. We encourage the community to assist with these issues. Remember, it’s not that the issue doesn’t exist; we need your help!Note: Please remove the notes above when submitting your post. Thank you for your understanding and support!
Installation Method
Docker
Environment
Open WebUI Version: [e.g., v0.3.11]
Ollama (if applicable): [e.g., v0.2.0, v0.1.32-rc1]
Operating System: [e.g., Windows 10, macOS Big Sur, Ubuntu 20.04]
Browser (if applicable): [e.g., Chrome 100.0, Firefox 98.0]
Confirmation:
Expected Behavior:
using CURL f to connect to completions endpoint [BASEURL]:3000/api/v1/chat/completions yields connection.
(This is hardcoded in the Homeassistant integration I'm using, and have tried two integrations that claim to be OpenAI 'compatible' both yield same issue - both appear to be attempting to connect to same endpoint
Actual Behavior:
v0.5.3 (latest) HTTP 405 attempting to connect to endpoint: [BASEURL]:3000/api/v1/chat/completions [BASEURL]:3000/api/chat/completions works (gives 200 OK and chat response)
Description
Bug Summary:
/api/chat/completions endpoint appears to work OK
/api/v1/chat/completions does not
(/api/v1/chat/completions is unfortunately the recognized endpoint in the other integration so it's bailing on error 405)
Reproduction Details
Steps to Reproduce:
[Outline the steps to reproduce the bug. Be as detailed as possible.]
Install openwebui
install valid openAI key
use OpenAI Key to connect to Homeasssistant integration directly. (verified works direct to cloud)
use openAI key to setup openwebUI, validate chat UI access works (It does)
Enable OpenWebui API access (toggle the new endpoint controls on and off to make sure they're all OFF - OPEN for good measure)
use homeassistant integration to point at OpenWebUI API
Fails - HTTP405
Pull server logs - find it's actually connecting to: [BASEURL]:3000/api/v1/chat/completions
Should it not be enabled by default if all access controls are off?
Should it not redirect api/v1/foo > api/foo and THEN access control?
Logs and Screenshots
Docker log from server console from simulations:
INFO: ('192.168.1.128', 51052) - "WebSocket /ws/socket.io/?EIO=4&transport=websocket" [accepted]
INFO: connection open
DEBUG [open_webui.utils.middleware] form_data: {'model': 'gpt-4o-mini', 'messages': [{'role': 'user', 'content': 'this is a system connection test to API. please identify your purpose and model if known'}], 'metadata': {'user_id': '9d2eb0bb-20e0-44a8-ac3b-bcfc9fe99f5f', 'chat_id': None, 'message_id': None, 'session_id': None, 'tool_ids': None, 'files': None, 'features': None}}
DEBUG [open_webui.utils.middleware] tool_ids=None
INFO: 192.168.1.128:61980 - "POST /api/chat/completions HTTP/1.1" 200 OK
INFO: 192.168.1.128:52821 - "POST /api/v1/chat/completions HTTP/1.1" 405 Method Not Allowed
root@llama3:~/ollama-intel-gpu#
Docker log for actual service call attempt: (.12 is the HA server, .128 is my admin console running postman)
INFO: 192.168.1.12:57624 - "POST /api/v1/chat/completions HTTP/1.1" 405 Method Not Allowed
root@llama3:~/ollama-intel-gpu#
Additional Information
Extract from Intent trying to direct traffic to open-webui - note timestamp and response. (I cannot change its endpoint only base url and port)
HomeAssistant side:
init_options:
start_stage: intent
end_stage: intent
input:
text: Give me a test 05:03 local Jarvis
pipeline: 01jg7rpr2h4z9hg1p0rh7m38br
conversation_id: null
stage: done
run:
pipeline: 01jg7rpr2h4z9hg1p0rh7m38br
language: en
runner_data:
stt_binary_handler_id: null
timeout: 300
events:
data:
pipeline: 01jg7rpr2h4z9hg1p0rh7m38br
language: en
runner_data:
stt_binary_handler_id: null
timeout: 300
timestamp: "2025-01-04T11:03:27.783479+00:00"
data:
engine: 01JGR9KG6C4G0BA7Z4HDBWDRZX
language: en
intent_input: Give me a test 05:03 local Jarvis
conversation_id: null
device_id: null
prefer_local_intents: false
timestamp: "2025-01-04T11:03:27.783571+00:00"
data:
processed_locally: false
intent_output:
response:
speech:
plain:
speech: >-
Sorry, I had a problem talking to OpenAI: Error code: 405 -
{'detail': 'Method Not Allowed'}
extra_data: null
card: {}
language: en
response_type: error
data:
code: unknown
conversation_id: 01JGRFQYSQ37SHSJ8F0P32R934
timestamp: "2025-01-04T11:03:27.817044+00:00"
data: null
timestamp: "2025-01-04T11:03:27.817099+00:00"
intent:
engine: 01JGR9KG6C4G0BA7Z4HDBWDRZX
language: en
intent_input: Give me a test 05:03 local Jarvis
conversation_id: null
device_id: null
prefer_local_intents: false
done: true
processed_locally: false
intent_output:
response:
speech:
plain:
speech: >-
Sorry, I had a problem talking to OpenAI: Error code: 405 -
{'detail': 'Method Not Allowed'}
extra_data: null
card: {}
language: en
response_type: error
data:
code: unknown
conversation_id: 01JGRFQYSQ37SHSJ8F0P32R934
Please review, this is blocking any user attempting to use open-webui (v.0.5.3 and below) between HomeAssistant and OpenAI (which is a heck of a use case)
@tjbck commented on GitHub (Jan 4, 2025):
api/v1/chat/completionswas never an endpoint for Open WebUI.@nathan-curtis commented on GitHub (Jan 4, 2025):
Thx. I know how to handle it from there then
yay browser redirects...
Btw I'll bug both those projects and reference this.
@ZimaBlueee commented on GitHub (Apr 22, 2025):
@nathan-curtis I have the same problem, how did you solve it? Did you use nginx?