[PR #19147] [MERGED] feat: Add custom API endpoint and user info headers for Perplexity Search #25107

Closed
opened 2026-04-20 05:45:47 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/19147
Author: @Classic298
Created: 11/12/2025
Status: Merged
Merged: 11/13/2025
Merged by: @tjbck

Base: devHead: perplexity-search-compatible-litellm


📝 Commits (1)

  • 6f676ab feat: Add custom API endpoint and user info headers for Perplexity Search (#31)

📊 Changes

5 files changed (+49 additions, -1 deletions)

View changed files

📝 backend/open_webui/config.py (+6 -0)
📝 backend/open_webui/main.py (+2 -0)
📝 backend/open_webui/retrieval/web/perplexity_search.py (+13 -1)
📝 backend/open_webui/routers/retrieval.py (+8 -0)
📝 src/lib/components/admin/Settings/WebSearch.svelte (+20 -0)

📄 Description

  • Target branch: Verify that the pull request targets the dev branch. Not targeting the dev branch will lead to immediate closure of the PR.
  • Description: Provide a concise description of the changes made in this pull request down below.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: If necessary, update relevant documentation Open WebUI Docs like environment variables, the tutorials, or other documentation sources.
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
  • Testing: Perform manual tests to verify the implemented fix/feature works as intended AND does not break any other functionality. Take this as an opportunity to make screenshots of the feature/fix and include it in the PR description.
  • Agentic AI Code: Confirm this Pull Request is not written by any AI Agent or has at least gone through additional human review AND manual testing. If any AI Agent is the co-author of this PR, it may lead to immediate closure of the PR.
  • Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
  • Title Prefix: To clearly categorize this pull request, prefix the pull request title using one of the following:
    • feat: Introduces a new feature or enhancement to the codebase

Changelog Entry

Description

This PR adds support for configurable custom API endpoints and user info header forwarding for the Perplexity Search API integration. Users can now specify any custom API endpoint instead of being locked to the hardcoded default, and user information (name, ID, email, role) is automatically forwarded in request headers when available.

Added

  • New PERPLEXITY_SEARCH_API_URL configuration variable with default value https://api.perplexity.ai/search
  • Admin UI input field for customizing the Perplexity Search API endpoint
  • User info header forwarding (X-OpenWebUI-User-Name, X-OpenWebUI-User-Id, X-OpenWebUI-User-Email, X-OpenWebUI-User-Role) to Perplexity Search API requests
  • Support for custom/self-hosted Perplexity-compatible API endpoints (like LiteLLM's new /search endpoint)

Additional Information

Maintains full backward compatibility - existing deployments continue using https://api.perplexity.ai/search by default

Follows the same pattern as other configurable search engines (searxng, external, etc.)

User header forwarding is conditional and only activates when user context is available

Screenshots or Videos

  • [Attach any relevant screenshots or videos demonstrating the changes]

Contributor License Agreement

By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.

Note

Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/19147 **Author:** [@Classic298](https://github.com/Classic298) **Created:** 11/12/2025 **Status:** ✅ Merged **Merged:** 11/13/2025 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `perplexity-search-compatible-litellm` --- ### 📝 Commits (1) - [`6f676ab`](https://github.com/open-webui/open-webui/commit/6f676abfbe9d56de3a11ab539ae2af164946c130) feat: Add custom API endpoint and user info headers for Perplexity Search (#31) ### 📊 Changes **5 files changed** (+49 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/config.py` (+6 -0) 📝 `backend/open_webui/main.py` (+2 -0) 📝 `backend/open_webui/retrieval/web/perplexity_search.py` (+13 -1) 📝 `backend/open_webui/routers/retrieval.py` (+8 -0) 📝 `src/lib/components/admin/Settings/WebSearch.svelte` (+20 -0) </details> ### 📄 Description - [x] **Target branch:** Verify that the pull request targets the `dev` branch. **Not targeting the `dev` branch will lead to immediate closure of the PR.** - [x] **Description:** Provide a concise description of the changes made in this pull request down below. - [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [x] **Documentation:** If necessary, update relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs) like environment variables, the tutorials, or other documentation sources. - [x] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? - [x] **Testing:** Perform manual tests to **verify the implemented fix/feature works as intended AND does not break any other functionality**. Take this as an opportunity to **make screenshots of the feature/fix and include it in the PR description**. - [x] **Agentic AI Code:** Confirm this Pull Request is **not written by any AI Agent** or has at least **gone through additional human review AND manual testing**. If any AI Agent is the co-author of this PR, it may lead to immediate closure of the PR. - [x] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards? - [x] **Title Prefix:** To clearly categorize this pull request, prefix the pull request title using one of the following: - **feat**: Introduces a new feature or enhancement to the codebase # Changelog Entry ### Description This PR adds support for configurable custom API endpoints and user info header forwarding for the Perplexity Search API integration. Users can now specify any custom API endpoint instead of being locked to the hardcoded default, and user information (name, ID, email, role) is automatically forwarded in request headers when available. ### Added - New PERPLEXITY_SEARCH_API_URL configuration variable with default value https://api.perplexity.ai/search - Admin UI input field for customizing the Perplexity Search API endpoint - User info header forwarding (X-OpenWebUI-User-Name, X-OpenWebUI-User-Id, X-OpenWebUI-User-Email, X-OpenWebUI-User-Role) to Perplexity Search API requests - Support for custom/self-hosted Perplexity-compatible API endpoints (like LiteLLM's new /search endpoint) --- ### Additional Information Maintains full backward compatibility - existing deployments continue using https://api.perplexity.ai/search by default Follows the same pattern as other configurable search engines (searxng, external, etc.) User header forwarding is conditional and only activates when user context is available ### Screenshots or Videos - [Attach any relevant screenshots or videos demonstrating the changes] ### Contributor License Agreement By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. > [!NOTE] > Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 05:45:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#25107