GPT-5-series models not supporting data_sources (Azure AI Search) in chat/completions API

Gokulamurthy Purushothaman 0 Reputation points
2025-10-22T00:39:07.1966667+00:00

When using the GPT-5 family models (gpt-5, gpt-5-chat) via the Azure OpenAI chat/completions API, the request fails validation whenever the data_sources parameter (used for Azure AI Search / “On Your Data” integration) is included. This same pattern works correctly with GPT-4o-mini and other GPT-4 variants. I'm unable to do the same in "Playgrounds" under the gpt-5 models, "datasource" parameters were missing.


Expected Behavior

The data_sources parameter should be accepted and processed by GPT-5-series deployments, just as it is for GPT-4o-mini, allowing Azure AI Search (Cognitive Search) to be used as an external grounding source for contextual chat responses.

Steps to Reproduce

  1. Create a GPT-5-chat deployment on Azure OpenAI (2025-01-01-preview).
  2. Call the /chat/completions endpoint with a valid message payload.
  3. Add a data_sources array referencing an existing Azure AI Search index.
  4. Observe the 400 validation error or loss of grounding support.

Sample response:

{

"id": "15281be3-9414-4d7b-a96d-39b05cf600b7",

"model": "gpt-5-chat",

"created": 1761091658,

"object": "extensions.chat.completion",

"choices": [

{

  "index": 0,

  "finish_reason": "stop",

  "message": {

    "role": "assistant",

    "content": "The requested information is not available in the retrieved data. Please try another query or topic.",

    "context": { "citations": [] }

  }

}

],

"usage": { "prompt_tokens": 3175, "completion_tokens": 21, "total_tokens": 3196 }

}

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
{count} votes

2 answers

Sort by: Most helpful
  1. Jerald Felix 7,910 Reputation points
    2025-10-22T02:23:23.86+00:00

    Hello Gokulamurthy Purushothaman,

    You're correct in observing that GPT-5 preview models (gpt-5, gpt-5-chat) currently have limited support for the data_sources parameter that enables Azure AI Search / "On Your Data" integration. This is a known limitation with the preview release.

    Current Status:

    The GPT-5 models in the 2025-01-01-preview API version are in early preview and do not yet have full feature parity with GPT-4 models. The data_sources parameter and Azure AI Search grounding capabilities are among the features still being rolled out for GPT-5 series.

    Why This Happens:

    1. Preview Limitations: The GPT-5 models are in preview status, and Microsoft is gradually enabling features as they validate performance and compatibility
    2. API Version Dependencies: The extensions API (extensions.chat.completion) that handles data_sources integration may not be fully implemented for GPT-5 yet
    3. Feature Rollout Strategy: Microsoft typically releases new models with core capabilities first, then adds advanced features like RAG (Retrieval-Augmented Generation) integration

    Current Workarounds:

    1. Use GPT-4o or GPT-4o-mini: For production workloads requiring Azure AI Search integration, continue using GPT-4o-mini or GPT-4 models which fully support data_sources
    2. Implement Custom RAG: You can implement your own retrieval logic by:
      • Querying Azure AI Search directly
      • Including retrieved context in your system message or user prompt
      • Sending the enriched prompt to GPT-5
    3. Monitor Preview Updates: Since this is a preview API, capabilities are being added regularly

    Example Custom RAG Pattern:

    
    # Query Azure Search separately
    
    search_results = azure_search_client.search(query)
    
    context = "\n".join([doc['content'] for doc in search_results])
    
    # Include context in prompt
    
    messages = [
    
        {"role": "system", "content": f"Answer based on this context: {context}"},
    
        {"role": "user", "content": user_query}
    
    ]
    
    # Call GPT-5 without data_sources parameter
    
    response = openai_client.chat.completions.create(
    
        model="gpt-5-chat",
    
        messages=messages
    
    )
    
    

    Next Steps:

    1. Check Azure Updates: Monitor the Azure OpenAI What's New page for announcements about GPT-5 feature availability
    2. Review API Changelog: The 2025-01-01-preview API is still evolving, and data_sources support may be added in upcoming preview versions
    3. Provide Feedback: Report this through Azure Portal feedback to help prioritize the feature

    Expected Timeline:

    While I don't have specific dates, data_sources support for GPT-5 models will likely be added as the preview progresses toward general availability. For now, GPT-4o-mini offers excellent performance with full Azure AI Search integration if you need that capability immediately.

    Best Regards,

    Jerald Felix


  2. Eric D 11 Reputation points
    2025-10-27T22:35:52.0133333+00:00

    Hi! We have an EastUS2 deployment of gpt-5-mini that shows as GenerallyAvailable (see screenshot below) but also unable to use RAG / Azure AI Search with the Chat Completions API via Microsoft.SemanticKernel version 1.66.

    Using the "SetNewMaxCompletionTokensEnabled = true" setting still causes "Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead"

    Also setting MaxTokens = 2000 and/or ReasoningEffort = ChatReasoningEffortLevel.Low causes "Validation error at #/reasoning_effort: Extra inputs are not permitted\nValidation error at #/max_completion_tokens: Extra inputs are not permitted"

    Using apiVersion: "2025-04-01-preview" produces the same results as above.

    Note: Using "SetNewMaxCompletionTokensEnabled = true" without specifying an AzureChatDataSource works great!

    What are we missing?
    User's image

    0 comments No comments

Your answer

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