500 Internal Server Error with o3‑mini + file_search on EastUS2 region (Assistants API)

Goran 20 Reputation points
2025-06-30T19:30:33.91+00:00

Our application has been successfully creating Azure OpenAI assistants with o3-mini (2025‑01‑31 build), attaching a vector store, enabling file_search, and calling /runs on the Assistants API. As of today, these calls now return a 500 Internal Server Error:

POST https://<your‑endpoint>.openai.azure.com/openai/threads/<thread_id>/runs?api‑version=2024‑05‑01‑preview

500 Internal Server Error

{

"error": {

"message": "The server had an error processing your request. Sorry about that! You can retry your req (truncated...)"

}

}

This flow worked without issue until very recently, with no changes in our code or Azure configuration.

Steps to reproduce:

Create an assistant with model = o3-mini (2025-01-31).

Attach tools including file_search, plus a file-backed vector store.

  1. Creates assistant thread, then POSTs to /runs.

The POST returns an HTTP 500 Internal Server Error (no further details).


[EDIT]: It looks like error is happening when passing reasoning_effort paramenter when creating assistant. Per OpenAI docs that is possible for o-series models only. I omitted and passed that argument when calling assistant run and seem to work now.

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

Accepted answer
  1. Manas Mohanty 6,370 Reputation points Microsoft External Staff Moderator
    2025-07-08T07:45:57.6066667+00:00

    Hi Goran

    I am getting partial success in East Us region (not able summarize but not failing at least with 500 internal server errors, managable) and with API version - "2025-04-01-preview"

    Attached sample code and results for reference

    %pip install openai
    
    from openai import AzureOpenAI
        
    client = AzureOpenAI(
        api_key="<yourazureopenaikey>",  
        api_version="2025-04-01-preview",
        azure_endpoint = "https://<yourazureopenairesourcename>.openai.azure.com/"
        )
    
    assistant = client.beta.assistants.create(
      name="Recommender Assistant",
      instructions="You are a bot summarize the document and gives a improved content for attached pdf.",
      model="o3-mini",
      tools=[{"type": "file_search"}],
    )
    
    
    
    # Create a vector store called "Financial Statements"
    vector_store = client.vector_stores.create(name="Financial Statements")
     
    # Ready the files for upload to OpenAI
    file_paths = ["CSA_Test.pdf"]
    file_streams = [open(path, "rb") for path in file_paths]
     
    # Use the upload and poll SDK helper to upload the files, add them to the vector store,
    # and poll the status of the file batch for completion.
    file_batch = client.vector_stores.file_batches.upload_and_poll(
      vector_store_id=vector_store.id, files=file_streams
    )
     
    # You can print the status and the file counts of the batch to see the result of this operation.
    print(file_batch.status)
    print(file_batch.file_counts)
    
    
    # you can replace with vector_store.id instead of string value used here
    assistant = client.beta.assistants.update(
      assistant_id=assistant.id,
      tool_resources={"file_search": {"vector_store_ids": [vector_store.id]}},
    )
    
    
    assistant = client.beta.assistants.create(
      instructions="Please summarize the attached document",
      model="o3-mini",
      tools=[{"type": "file_search"}],
      tool_resources={
        "file_search": {
          "vector_store_ids": [vector_store.id]
        }
      }
    )
    
    
    thread = client.beta.threads.create()
    
    run = client.beta.threads.runs.create(
     
      thread_id=thread.id,
      assistant_id=assistant.id
    )
    
    
    #retrieve the results with run
    import time
    
    # Looping until the run completes or fails
    while run.status in ['queued', 'in_progress', 'cancelling']:
      time.sleep(1)
      run = client.beta.threads.runs.retrieve(
        thread_id=thread.id,
        run_id=run.id
      )
    
    if run.status == 'completed':
      messages = client.beta.threads.messages.list(
        thread_id=thread.id
      )
      print(messages)
    elif run.status == 'requires_action':
      # the assistant requires calling some functions
      # and submit the tool outputs back to the run
      print("processing, Please rerun")
      pass
    else:
      print(run.status)
    
    
    

    Looking forward to your update with Code and result

    Note: Have not used reasoning effort here, have modified code from playground instead of file search code, as i faced difficulty in event handler step.

    Reference used for API Version

    1. https://learn.microsoft.com/en-us/azure/ai-foundry/openai/api-version-lifecycle?tabs=key
    2. https://learn.microsoft.com/en-us/azure/ai-foundry/openai/reference-preview

    Thank you

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Amira Bedhiafi 34,651 Reputation points Volunteer Moderator
    2025-07-05T18:19:22.7566667+00:00

    Hello Goran !

    Thank you for posting on Microsoft Learn.

    What you are sharing is a known limitation introduced in the Assistants API (May 2024 preview) when using the o3-mini model with file_search and reasoning_effort in the EastUS2 region.

    You're right in identifying that the problem is caused by passing the reasoning_effort parameter when starting a run (/runs endpoint) with a model (o3-mini) that currently does not support it under Azure Assistants API, despite OpenAI general documentation saying it's allowed for o-series models.

    reasoning_effort is only supported for chat completions, not for assistant runs using file search with o3-mini.

    You can omit the reasoning_effort parameter when creating the assistant or calling /runs for that assistant.

    Even though reasoning_effort is accepted by the OpenAI API, Azure Assistants API might still enforce stricter checks or lag slightly behind in compatibility with model features.

    Try to use:

    {
      "assistant_id": "...",
      "instructions": "Answer using uploaded files",
      "tools": [{"type": "file_search"}]
    }
    
    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

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.