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
$300 Free Credits for Your Google Cloud Projects Icon
$300 Free Credits for Your Google Cloud Projects

Start building on Google Cloud with $300 in free credits. No commitment, no credit card required until you're ready to scale.

Launch your next project with $300 in free Google Cloud credits—no strings attached. Test, build, and deploy without risk. Use your credits across the entire Google Cloud platform to find what works best for your needs. After your credits are used, continue with always-free tier services. Only pay when you're ready to scale. Sign up in minutes and start exploring.
Start Free Trial
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