[GH-ISSUE #15124] issue: API returns "405 Method Not Allowed" on /v1/chat/completions #33005

Closed
opened 2026-04-25 06:51:21 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @chisel900 on GitHub (Jun 18, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/15124

Check Existing Issues

  • I have searched the existing issues and discussions.
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

v0.6.15

Ollama Version (if applicable)

v0.9.1

Operating System

Windows 11 pro

Browser (if applicable)

any

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

Expected Behavior

I am running the latest OpenWebUI container on Docker for Windows 11, with Ollama running as a native Windows application.

The Web UI works perfectly.
The Ollama API URL is set in the admin settings to http://host.docker.internal:11434.
When I send a POST request to /v1/chat/completions with a valid Bearer Token API Key, the server responds with a 405 Method Not Allowed error.
This happens both from a Python script and from a direct curl command. The curl command and its output are attached below.

Actual Behavior

Note: Unnecessary use of -X or --request, POST is already inferred.

  • Trying 192.168.1.25:3000...
  • Connected to 192.168.1.25 (192.168.1.25) port 3000
  • using HTTP/1.x

POST /v1/chat/completions HTTP/1.1
Host: 192.168.1.25:3000
User-Agent: curl/8.13.0
Accept: /
Content-Type: application/json
Authorization: Bearer sk-****** MY KEY ******
Content-Length: 99

  • upload completely sent off: 99 bytes
    < HTTP/1.1 405 Method Not Allowed
    < date: Wed, 18 Jun 2025 14:08:59 GMT
    < server: uvicorn
    < content-length: 31
    < content-type: application/json
    < x-process-time: 0

Steps to Reproduce

curl -v -X POST http://192.168.1.25:3000/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer ****MY API KEY ***" -d "{"model": "llama3:latest", "messages": [{"role": "user", "content": "This is a direct API test."}]}"

Logs & Screenshots

Image

Additional Information

No response

Originally created by @chisel900 on GitHub (Jun 18, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/15124 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version v0.6.15 ### Ollama Version (if applicable) v0.9.1 ### Operating System Windows 11 pro ### Browser (if applicable) any ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### Expected Behavior I am running the latest OpenWebUI container on Docker for Windows 11, with Ollama running as a native Windows application. The Web UI works perfectly. The Ollama API URL is set in the admin settings to http://host.docker.internal:11434. When I send a POST request to /v1/chat/completions with a valid Bearer Token API Key, the server responds with a 405 Method Not Allowed error. This happens both from a Python script and from a direct curl command. The curl command and its output are attached below. ### Actual Behavior Note: Unnecessary use of -X or --request, POST is already inferred. * Trying 192.168.1.25:3000... * Connected to 192.168.1.25 (192.168.1.25) port 3000 * using HTTP/1.x > POST /v1/chat/completions HTTP/1.1 > Host: 192.168.1.25:3000 > User-Agent: curl/8.13.0 > Accept: */* > Content-Type: application/json > Authorization: Bearer sk-****** MY KEY ****** > Content-Length: 99 > * upload completely sent off: 99 bytes < HTTP/1.1 405 Method Not Allowed < date: Wed, 18 Jun 2025 14:08:59 GMT < server: uvicorn < content-length: 31 < content-type: application/json < x-process-time: 0 ### Steps to Reproduce curl -v -X POST http://192.168.1.25:3000/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer ****MY API KEY ***" -d "{\"model\": \"llama3:latest\", \"messages\": [{\"role\": \"user\", \"content\": \"This is a direct API test.\"}]}" ### Logs & Screenshots ![Image](https://github.com/user-attachments/assets/113663e2-39f2-453a-a897-0ab91e25a164) ### Additional Information _No response_
GiteaMirror added the bug label 2026-04-25 06:51:21 -05:00
Author
Owner

@tjbck commented on GitHub (Jun 18, 2025):

/v1/chat/completion is not a valid endpoint,/api/chat/completion is probably what you're after.

<!-- gh-comment-id:2984568483 --> @tjbck commented on GitHub (Jun 18, 2025): `/v1/chat/completion` is not a valid endpoint,`/api/chat/completion` is probably what you're after.
Author
Owner

@chisel900 commented on GitHub (Jun 18, 2025):

Tried that one as well and get "Method not allowed" .....
Image

<!-- gh-comment-id:2984597695 --> @chisel900 commented on GitHub (Jun 18, 2025): Tried that one as well and get "Method not allowed" ..... ![Image](https://github.com/user-attachments/assets/0870111b-4459-4c38-b758-69d1a12cbb1f)
Author
Owner

@DarkSession commented on GitHub (Jun 22, 2025):

Tried that one as well and get "Method not allowed" ..... Image

The endpoint is wrong. It's /api/chat/completions (with an s at the end).

<!-- gh-comment-id:2994007661 --> @DarkSession commented on GitHub (Jun 22, 2025): > Tried that one as well and get "Method not allowed" ..... ![Image](https://github.com/user-attachments/assets/0870111b-4459-4c38-b758-69d1a12cbb1f) The endpoint is wrong. It's /api/chat/completion**s** (with an s at the end).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#33005