Search vector store returns 404

Andreas Harto 20 Reputation points
2025-08-15T11:01:16.8333333+00:00

The api documented for searching a vector store https://learn.microsoft.com/en-us/azure/ai-foundry/openai/reference-preview#search-vector-store returns 404.
I have tried multiple API versions with no luck. The other methods like list files work.

Python example:

vector_store_id = "vs_xxxx"
url = f"https://{os.getenv('AZURE_OPENAI_RESOURCE_NAME')}.openai.azure.com/openai/vector_stores/{vector_store_id}/search?api-version=2025-04-01-preview"

headers = {
    "api-key": f"{os.getenv('AZURE_OPENAI_API_KEY')}",
    "Content-Type": "application/json",
}

response = requests.post(
    url,
    headers=headers,
    json={
        "query": "some query",
    },
)

print(response.json())
Azure OpenAI in Foundry Models
0 comments No comments

Answer accepted by question author
Amira Bedhiafi 43,046 Reputation points MVP Volunteer Moderator
2025-08-16T20:49:20.9633333+00:00

Hello Andreas !

Thank you for posting on Microsoft Learn.

I think you’re not doing anything wrong, the standalone /openai/vector_stores/{id}/search endpoint isn’t actually enabled on Azure OpenAI yet (despite being mentioned in the preview docs). Multiple Microsoft Q&A threads report consistent 404 Resource not found for that route across the recent preview API versions, while other Vector Store endpoints (list files, get store, etc.) work. Microsoft staff have also suggested the preview doc is ahead of the rollout.

https://learn.microsoft.com/en-us/answers/questions/2244170/azure-open-ai-vector-store-search-api-not-working

You can use the Responses API + file_search tool (LLM does the retrieval you get citations back).

from openai import AzureOpenAI
client = AzureOpenAI(
    api_key=os.environ["AZURE_OPENAI_API_KEY"],
    api_version="2025-04-01-preview",
    azure_endpoint=f"https://{os.environ['AZURE_OPENAI_RESOURCE_NAME']}.openai.azure.com"
)
resp = client.responses.create(
    model="gpt-4o-mini",  
    input="some query",
    tools=[{"type": "file_search"}],
    tool_choice="auto",
    metadata=None,
    
    attachments=[{"vector_store_ids": ["vs_xxxx"]}]
)
print(resp.output_text)

This is the path shown in the Azure File search how-to (use vector stores via the tool rather than calling /search directly).

https://learn.microsoft.com/en-us/azure/ai-foundry/openai/how-to/file-search

You can aslo roll your own similarity search (no LLM) if you embed the query with your Azure embedding deployment and search in your vector DB (Azure AI Search, pgvector, Redis...). Azure AI Search is the first-party option for production vector retrieval.

https://learn.microsoft.com/en-us/azure/search/vector-search-overview

Why you see 404, the route exists in preview docs but isn’t live on Azure OpenAI endpoints yet (it is/was available on OpenAI public API). So, the resource and ID can be fetched, but /search returns 404.

https://learn.microsoft.com/en-us/azure/ai-foundry/openai/reference-preview

https://community.openai.com/t/vector-store-search-api-endpoint-the-missing-documentation/1209326

Was this answer helpful?


0 additional answers

Sort by: Most helpful

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.