Azure throws an error when using OpenAI ResponseAPI with web search

David Captur 160 Reputation points
2025-05-13T09:18:32.5833333+00:00

When using the new ResponseAPI, Azure is throwing an error when using web-search.

Request URL: Get - https://openai-{{env}}.openai.azure.com/openai/responses?api-version=2025-03-01-preview

Body:

{
    "model":"gpt-4.1-mini",
    "input": "Using web search, tell me today's date and 1 random / cool bit of news which happened within the past 12 hours.",
    "tools": [
        { 
            "type": "web_search_preview",
            "search_context_size": "low"
        }
    ]
}

Response:

{
    "error": {
        "message": "An error occurred while processing your request. You can retry your request, or contact us through our help center at oai-assistants@microsoft.com if the error persists. Please include the request ID e57eb9dd-14d5-41fd-9ef1-1558e91d31a1 in your message.",
        "type": "server_error",
        "param": null,
        "code": "server_error"
    }
}

Thanks.

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
3,583 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Sina Salam 22,031 Reputation points Volunteer Moderator
    2025-05-13T14:29:24.5933333+00:00

    Hello David Captur,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand you're having issues when attempting to use the web_search_preview tool with the Azure OpenAI Responses API.

    The fact that the web_search_preview tool is not supported in the 2025-03-01-preview version of the Responses API. This means that any request including this tool will consistently fail, regardless of model or input, because the API simply doesn’t recognize or process that tool type at this time.

    Therefore, your expectation that the Responses API can handle real-time web search through this tool is what’s causing the failure. The error message may appear to suggest a transient server-side issue, but in reality, it’s a structural incompatibility. This is not a temporary outage or misconfiguration it’s a limitation of the current API capabilities. The documentation confirms that tool support is limited in this endpoint, and web_search_preview is not among the supported features.

    To move forward reliably, the best practice is to remove the tools section entirely from your request payload. For example:

    {
      "model": "gpt-4.1-mini",
      "input": "Tell me today's date and a cool fact."
    }
    

    If your use case requires real-time search capabilities, the most dependable approach is to either:

    • Use the Azure OpenAI Assistants API (when available in your region and subscription), which is designed to support tools like web search natively, or
    • Integrate with external services such as the Bing Search API or Azure Cognitive Search, and then pass the results into your prompt manually.

    To ensure you’re always working with the latest capabilities and limitations, I recommend regularly checking the official Azure OpenAI documentation: https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/responses. You can avoid these types of errors and ensure a more stable and predictable integration by by aligning your implementation with the supported features of the API.

    I hope this is helpful! Do not hesitate to let me know if you have any other questions or clarifications.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.


  2. JAYA SHANKAR G S 3,960 Reputation points Microsoft External Staff Moderator
    2025-05-15T12:18:28.3133333+00:00

    Hello @David Captur ,

    I understand the issue and have reported it by raising a bug in the Azure OpenAI SDK GitHub repository. You can find the link to the issue below:

    Azure throws an irrelevant error when using OpenAI ResponseAPI with web search · Issue #41120 · Azure/azure-sdk-for-python

    I believe you're now familiar with the supported tools available for use with the Azure OpenAI responses API. To stay up to date with the latest features and capabilities, please refer to the following official pages:

    What's new in Azure OpenAI Service? - Azure AI services | Microsoft Learn, Azure updates | Microsoft Azure

    Please give feedback by clicking on yes and we will be monitoring the raised issue for further updates.

    If you have any query, let us know in comments or in private message.

    Thank you

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.