OpenAI .NET is the official client library for calling the OpenAI REST API from C# and other .NET languages, with first-class support for modern .NET patterns. It provides strongly typed clients across API areas (chat, audio, images, embeddings, moderations, batches, files, models, vector stores, responses, realtime, assistants) and works with .NET Standard 2.0 while the examples use .NET 8. You install it via NuGet and authenticate with an API key, ideally through environment variables or configuration rather than hardcoding. Every synchronous method has an async counterpart, and the library offers convenient streaming primitives for chat completions so you can process tokens as they arrive. It supports tool/function calling, structured outputs via JSON schema, audio input/output, image generation, embeddings, Whisper transcription, and assistants with retrieval augmented generation.

Features

  • Strongly typed clients for chat, audio, images, embeddings, moderations, files, models, batches, vector stores, realtime, responses, assistants
  • Async and streaming APIs for low-latency, token-by-token processing
  • Tool calling and structured outputs with JSON schema constraints
  • Audio input/output, Whisper transcription, and TTS support
  • DI-friendly design, OpenAIClient factory, and protocol methods for raw access
  • Built-in retries and testing support with model factories and virtual methods

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

MIT License

Follow OpenAI .NET

OpenAI .NET Web Site

Other Useful Business Software
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of OpenAI .NET!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

C#

Related Categories

C# Libraries

Registered

2025-10-04