[GH-ISSUE #3676] Perplexity API can't be connected due to '/models' appendix #133072

Closed
opened 2026-05-24 22:12:50 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @popaurel on GitHub (Jul 6, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/3676

Bug Report

Description

Bug Summary:
Perplexity API can't be connected to Open WebUI OpenAI API due to '/models' appendix, the proper URI is: https://api.perplexity.ai/chat/completions
(without '/models' at the end, verified proper URI using curl).

Steps to Reproduce:

  1. Setup Docker Container with image: ghcr.io/open-webui/open-webui:ollama
  2. Login in Browser and open: http://localhost:3000/admin/settings/
  3. Go to Admin Panel > Settings > Connections > Add API via [+] button > create and enter your Perplexity API token and enter URL: https://api.perplexity.ai/chat/completions
  4. Click 'Verify Connection'

Expected Behavior:
'Server connection verified' message in green.

Actual Behavior:
'OpenAI Network Problem' message in red.

Environment

  • Open WebUI Version: image: ghcr.io/open-webui/open-webui:ollama
            "Labels": {
                "org.opencontainers.image.created": "2024-06-30T21:55:17.827Z",
                "org.opencontainers.image.description": "User-friendly WebUI for LLMs (Formerly Ollama WebUI)",
                "org.opencontainers.image.licenses": "MIT",
                "org.opencontainers.image.revision": "824966ad4a6b238731076021b8ad4c1e3cbe8f3f",
                "org.opencontainers.image.source": "https://github.com/open-webui/open-webui",
                "org.opencontainers.image.title": "open-webui",
                "org.opencontainers.image.url": "https://github.com/open-webui/open-webui",
                "org.opencontainers.image.version": "main-ollama"
            }
        },
        "Architecture": "arm64",
        "Os": "linux",
        "Size": 3584681126,
        "Metadata": {
            "LastTagTime": "0001-01-01T00:00:00Z"
        }
  • Ollama (if applicable): homebrew ollama version is 0.1.48

  • Operating System: macOS Sonoma 14.5

  • Browser (if applicable): Chrome Version 126.0.6478.63 (Official Build) (arm64)

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

image

2024-07-06T13:44:35.522716385Z     raise HTTPError(http_error_msg, response=self)
2024-07-06T13:44:35.522724844Z requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.perplexity.ai/chat/completions/models
2024-07-06T13:44:35.528435704Z INFO:     198.19.200.1:44196 - "GET /openai/models/4 HTTP/1.1" 500 Internal Server Error
2024-07-06T13:44:35.553592553Z INFO:apps.openai.main:get_all_models()
2024-07-06T13:44:35.996349162Z ERROR:apps.openai.main:Connection error: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url=URL('https://api.perplexity.ai/chat/completions/models')
2024-07-06T13:44:35.996997286Z ERROR:apps.openai.main:Connection error: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url=URL('https://api.perplexity.ai/chat/completions/models')
2024-07-06T13:44:35.997118077Z INFO:apps.ollama.main:get_all_models()
2024-07-06T13:44:36.009537586Z [GIN] 2024/07/06 - 13:44:36 | 200 |     7.94577ms |       127.0.0.1 | GET      "/api/tags"
Originally created by @popaurel on GitHub (Jul 6, 2024). Original GitHub issue: https://github.com/open-webui/open-webui/issues/3676 # Bug Report ## Description **Bug Summary:** Perplexity API can't be connected to Open WebUI OpenAI API due to '/models' appendix, the proper URI is: `https://api.perplexity.ai/chat/completions` (without '/models' at the end, verified proper URI using curl). **Steps to Reproduce:** 1. Setup Docker Container with image: `ghcr.io/open-webui/open-webui:ollama` 2. Login in Browser and open: http://localhost:3000/admin/settings/ 3. Go to Admin Panel > Settings > Connections > Add API via [+] button > create and enter your [Perplexity API token](https://www.perplexity.ai/settings/api) and enter URL: `https://api.perplexity.ai/chat/completions` 4. Click 'Verify Connection' **Expected Behavior:** 'Server connection verified' message in green. **Actual Behavior:** 'OpenAI Network Problem' message in red. ## Environment - **Open WebUI Version:** `image: ghcr.io/open-webui/open-webui:ollama` ``` "Labels": { "org.opencontainers.image.created": "2024-06-30T21:55:17.827Z", "org.opencontainers.image.description": "User-friendly WebUI for LLMs (Formerly Ollama WebUI)", "org.opencontainers.image.licenses": "MIT", "org.opencontainers.image.revision": "824966ad4a6b238731076021b8ad4c1e3cbe8f3f", "org.opencontainers.image.source": "https://github.com/open-webui/open-webui", "org.opencontainers.image.title": "open-webui", "org.opencontainers.image.url": "https://github.com/open-webui/open-webui", "org.opencontainers.image.version": "main-ollama" } }, "Architecture": "arm64", "Os": "linux", "Size": 3584681126, "Metadata": { "LastTagTime": "0001-01-01T00:00:00Z" } ``` - **Ollama (if applicable):** homebrew ollama version is 0.1.48 - **Operating System:** macOS Sonoma 14.5 - **Browser (if applicable):** Chrome Version 126.0.6478.63 (Official Build) (arm64) ## Reproduction Details **Confirmation:** - [x] I have read and followed all the instructions provided in the README.md. - [x] 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 ![image](https://github.com/open-webui/open-webui/assets/47039993/cefe80e1-0690-445c-9d6a-fb217b1c59b2) ``` 2024-07-06T13:44:35.522716385Z raise HTTPError(http_error_msg, response=self) 2024-07-06T13:44:35.522724844Z requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.perplexity.ai/chat/completions/models 2024-07-06T13:44:35.528435704Z INFO: 198.19.200.1:44196 - "GET /openai/models/4 HTTP/1.1" 500 Internal Server Error 2024-07-06T13:44:35.553592553Z INFO:apps.openai.main:get_all_models() 2024-07-06T13:44:35.996349162Z ERROR:apps.openai.main:Connection error: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url=URL('https://api.perplexity.ai/chat/completions/models') 2024-07-06T13:44:35.996997286Z ERROR:apps.openai.main:Connection error: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url=URL('https://api.perplexity.ai/chat/completions/models') 2024-07-06T13:44:35.997118077Z INFO:apps.ollama.main:get_all_models() 2024-07-06T13:44:36.009537586Z [GIN] 2024/07/06 - 13:44:36 | 200 | 7.94577ms | 127.0.0.1 | GET "/api/tags" ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#133072