Announcing the official OpenAI library for .NET
At Microsoft Build 2024, we announced new investments that expand the AI ecosystem for .NET developers. We’re excited to share more detailed plans around Microsoft’s collaboration with OpenAI on their official .NET library.
Today, the OpenAI team released their first beta, version 2.0.0-beta.1, of the official OpenAI library for .NET. Features include:
- Support for the entire OpenAI API, including Assistants v2 and Chat Completions
- Support for GPT-4o, OpenAI’s latest flagship model
- Extensibility to enable the community to build libraries on top
- Sync and async APIs for ease of use and efficiency
- Access to streaming completions via
IAsyncEnumerable<T>
This official .NET library ensures a smooth and supported integration with OpenAI and Azure OpenAI. It also complements OpenAI’s official libraries for Python and TypeScript/JavaScript developers.
The .NET library is developed and supported on GitHub and will be kept up to date with the latest features from OpenAI. Work will continue over the next few months to gather feedback to improve the library and release a stable NuGet package.
Thank you to the .NET community
We’d like to thank and recognize the work of Roger Pincombe on his library that was published under the OpenAI v1.x NuGet package name. Roger initially published the library in June 2020, making it the first known OpenAI package for .NET. He volunteered countless hours of personal time ever since to maintain the project on GitHub. Roger has worked closely with OpenAI and Microsoft on our plans for the official .NET package for OpenAI. Roger is also helping with a migration guide from his package to the new official one.
Of course, developers may choose to continue using their favorite community libraries, like:
OpenAI and the .NET team also thank these project maintainers for their extraordinary efforts in filling a void within the community. Even with the release of the official package from OpenAI, there are opportunities for community libraries to add significant value on top. We look forward to collaborating with the community in this space.
Next steps
Here’s how you can get involved:
- Try the library: Install the OpenAI .NET library and start experimenting with its features.
- Join the community: Engage with us and other developers on GitHub. Share your experiences, report issues, and contribute to discussions.
- Attend the live stream: Join us live at 10:00 AM PDT on June 19 for the .NET AI Community Standup. Ask questions, learn more about the library, and see demos of its capabilities.


Light
Dark
5 comments
What does this mean for the
Azure.AI.OpenAIpackage?Hello, Thomas! That’s a great question. We’ve worked closely with OpenAI for overall .NET convergence and that existing
Azure.AI.OpenAIpackage is being converted into the Azure OpenAI Service “companion library” that will provide a dedicatedAzureOpenAIClientfor connecting to Azure OpenAI resources, together with extensions for Azure-specific concepts like Responsible AI content filter results and On Your Data integration. All of the common capabilities between OpenAI and Azure OpenAI will share the same scenario clients, methods, and request/response types, so interoperating between Azure and non-Azure should be easier than ever.We’re hoping to have that update published very soon (I’m waiting on a build right now!) and you can keep an eye on the Azure.AI.OpenAI readme and NuGet package.
Noting here as we’ll note in the repository: this will bring some very significant changes to the details of the usage patterns and we’re eager to hear your feedback. Discussions are open on the openai-dotnet repository and we’ll also be regularly percolating all of the 2.0.0-beta input on azure-sdk-for-net repository, too. Our goal is to stabilize the preview and produce GA-status libraries as soon as we can, and that means great input from the community is critical to ensuring this .NET support is as awesome as it deserves to be.
Here’s the updated Azure.AI.OpenAI package Travis mentioned: https://www.nuget.org/packages/Azure.AI.OpenAI/2.0.0-beta.1
Does this include support for the latest GPT-4o features? audio stream in & out as well as image & video recognition?
Hey Jose Luis!
Yes they do! the main repo have great samples (https://github.com/openai/openai-dotnet), and we talked about that also today in the .NET + AI LATAM streaming.
Best