Originally created by @whateverzpy on GitHub (Jun 21, 2024).
Bug Report
Description
Bug Summary:
I am experiencing an issue with OpenWebUI where it reports an "Openai: Network Problem" when setting the OpenAI API key. The same API key works fine with curl on my local machine.
curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer sk-***************" -d '{"model": "gpt-4o","messages": [{"role": "user", "content": "Say this is a test!"}]}'
{"id":"chatcmpl-78823c3892804d50a3ec215253fb5dd4","model":"*************","object":"chat.completion","created":1718955051,"choices":[{"index":0,"message":{"role":"assistant","content":"# This is a Test!\n\nWelcome! How can I assist you with your questions or interests in Chinese modern and contemporary history today?"},"finish_reason":"stop"}],"usage":{"prompt_tokens":0,"completion_tokens":0,"total_tokens":0}}
Steps to Reproduce:
Deploy OpenAI API key on local server.
Use curl on local machine to verify API key works.
Set the same API key in OpenWebUI.
Actual Behavior:
OpenWebUI reports "Openai: Network Problem".
Environment
Open WebUI Version: 0.3.1
Operating System: Windows 11
Browser (if applicable): Edge 126.0.2592.61
Reproduction Details
Confirmation:
I have read and followed all the instructions provided in the README.md.
I am on the latest version of both Open WebUI and Ollama.
I have included the browser console logs.
I have included the Docker container logs.
Logs and Screenshots
Browser Console Logs:
Ignore the Ollama error because I'm not focusing on it.
Originally created by @whateverzpy on GitHub (Jun 21, 2024).
# Bug Report
## Description
**Bug Summary:**
I am experiencing an issue with OpenWebUI where it reports an "Openai: Network Problem" when setting the OpenAI API key. The same API key works fine with curl on my local machine.
```shell
curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer sk-***************" -d '{"model": "gpt-4o","messages": [{"role": "user", "content": "Say this is a test!"}]}'
```
```shell
{"id":"chatcmpl-78823c3892804d50a3ec215253fb5dd4","model":"*************","object":"chat.completion","created":1718955051,"choices":[{"index":0,"message":{"role":"assistant","content":"# This is a Test!\n\nWelcome! How can I assist you with your questions or interests in Chinese modern and contemporary history today?"},"finish_reason":"stop"}],"usage":{"prompt_tokens":0,"completion_tokens":0,"total_tokens":0}}
```
**Steps to Reproduce:**
1. Deploy OpenAI API key on local server.
2. Use curl on local machine to verify API key works.
3. Set the same API key in OpenWebUI.
**Actual Behavior:**
OpenWebUI reports "Openai: Network Problem".
## Environment
- **Open WebUI Version:** 0.3.1
- **Operating System:** Windows 11
- **Browser (if applicable):** Edge 126.0.2592.61
## Reproduction Details
**Confirmation:**
- [x] I have read and followed all the instructions provided in the README.md.
- [ ] I am on 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.
## Logs and Screenshots
**Browser Console Logs:**



Ignore the Ollama error because I'm not focusing on it.
**Docker Container Logs:**
```txt
2024-06-21 15:24:17 INFO:apps.openai.main:get_all_models()
2024-06-21 15:24:17 ERROR:apps.openai.main:Connection error: Cannot connect to host localhost:8000 ssl:default [Connection refused]
2024-06-21 15:24:17 INFO:apps.ollama.main:get_all_models()
2024-06-21 15:24:17 ERROR:apps.ollama.main:Connection error: Cannot connect to host host.docker.internal:11434 ssl:default [Connection refused]
2024-06-21 15:24:17 INFO: 127.0.0.1:42946 - "GET /health HTTP/1.1" 200 OK
2024-06-21 15:24:47 INFO:apps.openai.main:get_all_models()
2024-06-21 15:24:47 ERROR:apps.openai.main:Connection error: Cannot connect to host localhost:8000 ssl:default [Connection refused]
2024-06-21 15:24:47 INFO:apps.ollama.main:get_all_models()
2024-06-21 15:24:47 ERROR:apps.ollama.main:Connection error: Cannot connect to host host.docker.internal:11434 ssl:default [Connection refused]
2024-06-21 15:24:47 INFO: 127.0.0.1:51980 - "GET /health HTTP/1.1" 200 OK
2024-06-21 15:25:17 INFO:apps.openai.main:get_all_models()
2024-06-21 15:25:17 ERROR:apps.openai.main:Connection error: Cannot connect to host localhost:8000 ssl:default [Connection refused]
2024-06-21 15:25:17 INFO:apps.ollama.main:get_all_models()
2024-06-21 15:25:17 ERROR:apps.ollama.main:Connection error: Cannot connect to host host.docker.internal:11434 ssl:default [Connection refused]
2024-06-21 15:25:17 INFO: 127.0.0.1:48388 - "GET /health HTTP/1.1" 200 OK
```
## Installation Method
Docker
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @whateverzpy on GitHub (Jun 21, 2024).
Bug Report
Description
Bug Summary:
I am experiencing an issue with OpenWebUI where it reports an "Openai: Network Problem" when setting the OpenAI API key. The same API key works fine with curl on my local machine.
Steps to Reproduce:
Actual Behavior:
OpenWebUI reports "Openai: Network Problem".
Environment
Open WebUI Version: 0.3.1
Operating System: Windows 11
Browser (if applicable): Edge 126.0.2592.61
Reproduction Details
Confirmation:
Logs and Screenshots
Browser Console Logs:
Ignore the Ollama error because I'm not focusing on it.
Docker Container Logs:
Installation Method
Docker