litellm - 💡(How to fix) Fix [Bug]: websearch_interception not working for OpenAI provider when stream=true

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

{ "error": { "message": "litellm.BadRequestError: OpenAIException - Unknown parameter: '_websearch_interception_converted_stream'.. Received Model Group=openai-gpt-5.1\nAvailable Model Group Fallbacks=None", "type": "invalid_request_error", "param": "_websearch_interception_converted_stream", "code": "400" } }

Code Example

curl -X 'POST' \
  'https://{litellm-host}/v1/chat/completions' \
  -H 'accept: application/json' \
  -H 'x-litellm-api-key: sk-XXXXXX' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "openai-gpt-5.1",
  "messages": [
    {
      "role": "user",
      "content": "What is the weather in San Francisco today?"
    }
  ],
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "litellm_web_search",
        "description": "Search the web for information, always include URL in citations",
        "parameters": {
          "type": "object",
          "properties": {
            "query": {
              "type": "string"
            }
          },
          "required": [
            "query"
          ]
        }
      }
    }
  ],
  "tool_choice": "auto",
  "stream": false
}' | jq

---

{
  "error": {
    "message": "litellm.BadRequestError: OpenAIException - Unknown parameter: '_websearch_interception_converted_stream'.. Received Model Group=openai-gpt-5.1\nAvailable Model Group Fallbacks=None",
    "type": "invalid_request_error",
    "param": "_websearch_interception_converted_stream",
    "code": "400"
  }
}

---
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

Web search interception doesn't work with OpenAI provider when stream: true. I would expect it to work the same way it does with stream: false

Steps to Reproduce

  1. Configure search tool & web_search interception as per https://docs.litellm.ai/docs/integrations/websearch_interception
  2. Test interception works when stream=false
curl -X 'POST' \
  'https://{litellm-host}/v1/chat/completions' \
  -H 'accept: application/json' \
  -H 'x-litellm-api-key: sk-XXXXXX' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "openai-gpt-5.1",
  "messages": [
    {
      "role": "user",
      "content": "What is the weather in San Francisco today?"
    }
  ],
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "litellm_web_search",
        "description": "Search the web for information, always include URL in citations",
        "parameters": {
          "type": "object",
          "properties": {
            "query": {
              "type": "string"
            }
          },
          "required": [
            "query"
          ]
        }
      }
    }
  ],
  "tool_choice": "auto",
  "stream": false
}' | jq
  1. Test the same request with "stream": true" and it fails with
{
  "error": {
    "message": "litellm.BadRequestError: OpenAIException - Unknown parameter: '_websearch_interception_converted_stream'.. Received Model Group=openai-gpt-5.1\nAvailable Model Group Fallbacks=None",
    "type": "invalid_request_error",
    "param": "_websearch_interception_converted_stream",
    "code": "400"
  }
}

Relevant log output

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.83.14

Twitter / LinkedIn details

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING