litellm - ✅(Solved) Fix [Feature]: Support tool_search for gpt-5.4 and gpt-5.4-pro via /v1/chat/completions [1 pull requests, 1 participants]

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…
GitHub stats
BerriAI/litellm#23206Fetched 2026-04-08 00:38:04
View on GitHub
Comments
0
Participants
1
Timeline
7
Reactions
0
Participants
Timeline (top)
labeled ×3referenced ×2closed ×1cross-referenced ×1

OpenAI introduced tool_search to dynamically load tools only when needed. This improves token efficiency and allows models to discover tools at runtime.

Documentation: https://developers.openai.com/api/docs/guides/tools-tool-search/

Root Cause

OpenAI introduced tool_search to dynamically load tools only when needed. This improves token efficiency and allows models to discover tools at runtime.

Documentation: https://developers.openai.com/api/docs/guides/tools-tool-search/

Fix Action

Fixed

PR fix notes

PR #23258: docs(responses): add tool_search & namespaces docs for gpt-5.4

Description (problem / solution / changelog)

Relevant issues

Fixes #23206

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/test_litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Type

📖 Documentation

Changes

Add documentation for OpenAI's tool_search and namespace tools feature (gpt-5.4+) to the Responses API docs page.

What was added:

  • New "Tool Search & Namespaces" section in docs/my-website/docs/providers/openai/responses_api.md
  • SDK usage example showing litellm.responses() with tool_search, namespaces, and defer_loading
  • Proxy usage example with config.yaml setup and OpenAI SDK client
  • Response output handling for tool_search_call and tool_search_output items

Changed files

  • docs/my-website/docs/providers/openai/responses_api.md (modified, +230/-0)
RAW_BUFFERClick to expand / collapse

Check for existing issues

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

The Feature

Context

OpenAI introduced tool_search to dynamically load tools only when needed. This improves token efficiency and allows models to discover tools at runtime.

Documentation: https://developers.openai.com/api/docs/guides/tools-tool-search/

Problem

Currently LiteLLM does not appear to support passing tool_search with namespace through /v1/chat/completions for models like:

  • gpt-5.4
  • gpt-5.4-pro

Motivation, pitch

Add support for tool_search with namespaces when using gpt-5.4 / gpt-5.4-pro through the /v1/chat/completions endpoint in LiteLLM.

What part of LiteLLM is this about?

SDK (litellm Python package)

extent analysis

Fix Plan

To add support for tool_search with namespaces in LiteLLM, we need to update the /v1/chat/completions endpoint in the LiteLLM Python package.

Steps:

  • Update the completions function in the LiteLLM SDK to accept tool_search and namespace parameters.
  • Modify the API request to include the tool_search and namespace parameters.

Example Code:

import requests

def completions(model, prompt, tool_search=None, namespace=None):
    url = "https://api.openai.com/v1/chat/completions"
    headers = {"Authorization": "Bearer YOUR_API_KEY"}
    data = {
        "model": model,
        "prompt": prompt,
    }
    if tool_search:
        data["tool_search"] = tool_search
    if namespace:
        data["namespace"] = namespace

    response = requests.post(url, headers=headers, json=data)
    return response.json()

# Example usage:
completions("gpt-5.4", "Hello, world!", tool_search=True, namespace="my_namespace")

Verification

To verify the fix, test the updated completions function with different models, including gpt-5.4 and gpt-5.4-pro, and check that the tool_search and namespace parameters are correctly passed to the API.

Extra Tips

  • Make sure to replace YOUR_API_KEY with your actual OpenAI API key.
  • You can add error handling and logging to the completions function to improve robustness and debugging.

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

litellm - ✅(Solved) Fix [Feature]: Support tool_search for gpt-5.4 and gpt-5.4-pro via /v1/chat/completions [1 pull requests, 1 participants]