Skip to main content

Fixed: "error OPENAI001: 'Azure.AI.Extensions.OpenAI.ProjectVectorStoresClient' is for evaluation purposes only and is subject to change or removal in future updates"

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

I was giving a Microsoft Agent Framework agent the file search tool, which needs a vector store in the Microsoft Foundry project, and the build failed with five OPENAI001 errors: 'Azure.AI.Extensions.OpenAI.ProjectVectorStoresClient' is for evaluation purposes only. The vector store API is marked experimental, and one #pragma around the code that uses it fixes the build.

What I Was Doing​

I was building a small console app for the Fundamentals tutorial Tools the Model Service Runs. One of those tools is file search: the model service searches files that you upload to your Foundry project. It searches a vector store, so the app uploads a file, puts it in a new vector store, and gives the agent a HostedFileSearchTool for that store. The app had Microsoft.Agents.AI.Foundry 1.28.0-preview.261106.1 and Azure.Identity 1.21.0, and this code:

Program.cs (file search, as it was)
// 3. File search: the model service searches files you upload to your Foundry project.
ProjectOpenAIClient openAI = project.GetProjectOpenAIClient();
OpenAIFileClient files = openAI.GetOpenAIFileClient();
ProjectVectorStoresClient vectorStores = openAI.GetProjectVectorStoresClient();

OpenAIFile coursePlan = await files.UploadFileAsync("course-plan.md", FileUploadPurpose.Assistants);
VectorStore store = await vectorStores.CreateVectorStoreAsync(new VectorStoreCreationOptions
{
Name = "course-plan",
FileIds = { coursePlan.Id },
});

try
{
// The service reads the file into the vector store in the background. Wait until it's done.
while (store.Status == VectorStoreStatus.InProgress)
{
await Task.Delay(TimeSpan.FromSeconds(1));
store = await vectorStores.GetVectorStoreAsync(store.Id);
}

What I Expected​

A clean build. The other three tools in the same app, code interpreter, web search and a remote MCP server, built without a single warning.

What I Got​

Terminal
dotnet build
Output
Restore complete (0.3s)
CourseHelper net10.0 failed with 5 error(s) (1.4s)
/Users/you/source/CourseHelper/Program.cs(25,1): error OPENAI001: 'Azure.AI.Extensions.OpenAI.ProjectVectorStoresClient' is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
/Users/you/source/CourseHelper/Program.cs(25,42): error OPENAI001: 'Azure.AI.Extensions.OpenAI.ProjectOpenAIClient.GetProjectVectorStoresClient()' is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
/Users/you/source/CourseHelper/Program.cs(28,1): error OPENAI001: 'OpenAI.VectorStores.VectorStore' is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
/Users/you/source/CourseHelper/Program.cs(28,67): error OPENAI001: 'OpenAI.VectorStores.VectorStoreCreationOptions' is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
/Users/you/source/CourseHelper/Program.cs(37,28): error OPENAI001: 'OpenAI.VectorStores.VectorStoreStatus' is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.

Build failed with 5 error(s) in 2.1s

macOS-style terminal window: dotnet build reports CourseHelper net10.0 failed with 5 errors, each error OPENAI001, for Azure.AI.Extensions.OpenAI.ProjectVectorStoresClient, ProjectOpenAIClient.GetProjectVectorStoresClient(), OpenAI.VectorStores.VectorStore, VectorStoreCreationOptions and VectorStoreStatus, each one for evaluation purposes only and subject to change or removal in future updates, and Build failed with 5 errors

What I Checked​

Which code the errors point at. All five are about vector stores: the vector store client, the method that returns it, and the VectorStore, VectorStoreCreationOptions and VectorStoreStatus types. The file client (OpenAIFileClient) and HostedFileSearchTool itself got no error.

The OpenAI .NET library's documentation. Its README has a section called Experimental APIs: Some client APIs are marked with [Experimental] while their .NET design is still evolving. Using one produces a compiler error that you must explicitly suppress for its diagnostic ID. OPENAI001 is that ID.

Microsoft's .NET documentation on experimental APIs. The Preview APIs page: When building against an experimental API, the compiler produces an error. … To express consent to using an experimental API, you suppress the specific diagnostic. It recommends the project's <NoWarn> property for that, and adds that consenting to using one experimental feature doesn't consent to using another.

Why It Happens​

The vector store API of the OpenAI .NET library, and the Foundry project's vector store client built on it, are marked [Experimental("OPENAI001")]: their shape may still change in a later version. The compiler turns every use of them into an error until you say, in code, that you accept that. Creating a vector store with these clients and types means accepting OPENAI001.

The Fix​

Accept the diagnostic for exactly the code that uses vector stores, with a comment that says what you accepted:

Program.cs
// 3. File search: the model service searches files you upload to your Foundry project.
// The OpenAI library marks its vector store API as for evaluation only (OPENAI001): it may still change.
#pragma warning disable OPENAI001
ProjectOpenAIClient openAI = project.GetProjectOpenAIClient();

and after the finally block that deletes the store and the file again:

Program.cs
#pragma warning restore OPENAI001

#pragma warning disable turns the diagnostic off from that line on, and restore turns it back on, so a vector store API used anywhere else still stops the build. In this app one section uses vector stores, so the #pragma keeps the consent next to that code. When many files use an experimental API, Microsoft's recommendation of <NoWarn> in the project file is simpler; Fixed: error OPENAI001: 'OpenAI.Responses.ResponsesClient' is for evaluation purposes only shows that way.

After the Fix​

Output
Restore complete (0.3s)
CourseHelper net10.0 succeeded (1.5s) → bin/Debug/net10.0/CourseHelper.dll

Build succeeded in 2.1s

macOS-style terminal window: dotnet build reports Restore complete, CourseHelper net10.0 succeeded, and Build succeeded

The app then uploaded the file, created the vector store, and the agent answered from it:

Output (file search)
=== File search
> Which week covers async and await, and when are the office hours?
called file_search
Async and await are covered in Week 5. Office hours are Tuesdays from 17:00 to 18:00 UTC.
source: course-plan.md
(2172 tokens in)

Common Mistakes​

MistakeWhat happensDo this instead
Turning off every warning in the project to silence theseReal problems in other code disappear tooAccept only OPENAI001
#pragma warning disable without restoreEvery experimental OpenAI API below it is accepted too, without anyone decidingRestore it right after the code that needs it
Accepting it without a commentThe next reader doesn't know what was accepted, or whySay in a comment that the vector store API may still change

Troubleshooting​

SymptomLikely causeFix
Still OPENAI001 after the #pragmaThe error points at a line outside the disabled sectionMove the restore below that line, or disable it there too
OPENAI001 for OpenAI.Responses.ResponsesClientA different experimental API: the Responses clientAccept it the same way (Fixed)

FAQ​

Is it safe to use an API marked for evaluation?​

It works today, as the run above shows. The mark warns that its shape may change in a later version, so an upgrade of the OpenAI library or of Agent Framework may need changes to this code. Check it whenever you upgrade.

Can I create the vector store without these APIs?​

Not with these clients: the vector store client and every vector store type this code uses carry the mark. Creating the store once outside the app, in the Foundry portal or with the REST API, moves that work out of your code, but the app still needs the store's ID.

Conclusion​

Five OPENAI001 errors meant one thing: the vector store API is marked experimental, and the compiler wants you to accept that. #pragma warning disable OPENAI001 before the file search code and #pragma warning restore OPENAI001 after it, with a comment saying why, fixed the build and kept the consent next to the only code that needs it.

Additional Resources​