[GH-ISSUE #12045] feat: Implement Web Search tool in /api/chat/completions #16448

Closed
opened 2026-04-19 22:21:57 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @SuperPat45 on GitHub (Mar 25, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/12045

Check Existing Issues

  • I have searched the existing issues and discussions.

Problem Description

OpenAI has just unveiled a new Web Search tool for the /chat/completions API:
https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat

Desired Solution you'd like

It would be great if Open WebUI could provide the web_search_options parameter to the /api/chat/completions when the search feature is enabled in system preferences:

curl -X POST "https://api.openai.com/v1/chat/completions" \
    -H "Authorization: Bearer $OPENAI_API_KEY" \
    -H "Content-type: application/json" \
    -d '{
        "model": "gpt-4o-search-preview",
        "web_search_options": {
            "user_location": {
                "type": "approximate",
                "approximate": {
                    "country": "GB",
                    "city": "London",
                    "region": "London",
                }
            }
        },
        "messages": [{
            "role": "user",
            "content": "What are the best restaurants around Granary Square?"
        }]
    }'


[
  {
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "the model response is here...",
      "refusal": null,
      "annotations": [
        {
          "type": "url_citation",
          "url_citation": {
            "end_index": 985,
            "start_index": 764,
            "title": "Page title...",
            "url": "https://..."
          }
        }
      ]
    },
    "finish_reason": "stop"
  }
]

Alternatives Considered

Are-there any other way to use the web search integration thought the Open WebUI API?

Additional Context

My Open WebUI sever is connected to an Ollama instance.

Originally created by @SuperPat45 on GitHub (Mar 25, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/12045 ### Check Existing Issues - [x] I have searched the existing issues and discussions. ### Problem Description OpenAI has just unveiled a new Web Search tool for the /chat/completions API: https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat ### Desired Solution you'd like It would be great if Open WebUI could provide the web_search_options parameter to the /api/chat/completions when the search feature is enabled in system preferences: ``` curl -X POST "https://api.openai.com/v1/chat/completions" \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-type: application/json" \ -d '{ "model": "gpt-4o-search-preview", "web_search_options": { "user_location": { "type": "approximate", "approximate": { "country": "GB", "city": "London", "region": "London", } } }, "messages": [{ "role": "user", "content": "What are the best restaurants around Granary Square?" }] }' [ { "index": 0, "message": { "role": "assistant", "content": "the model response is here...", "refusal": null, "annotations": [ { "type": "url_citation", "url_citation": { "end_index": 985, "start_index": 764, "title": "Page title...", "url": "https://..." } } ] }, "finish_reason": "stop" } ] ``` ### Alternatives Considered Are-there any other way to use the web search integration thought the Open WebUI API? ### Additional Context My Open WebUI sever is connected to an Ollama instance.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#16448