OpenAI-API-dotnet  by OkGoDoIt

C#/.NET SDK for accessing the OpenAI APIs

created 5 years ago
1,895 stars

Top 23.5% on sourcepulse

GitHubView on GitHub
Project Summary

This C#/.NET SDK provides a wrapper for interacting with OpenAI's APIs, including GPT-3.5/4, DALL-E 2/3, and audio processing. It's designed for .NET developers seeking a straightforward way to integrate OpenAI's capabilities into their applications.

How It Works

The library offers a fluent API for common tasks like chat completions, image generation, and audio transcription. It supports various authentication methods (API keys, environment variables, config files) and handles API request/response serialization. Key features include conversation management with automatic context truncation, streaming responses, and direct support for GPT Vision and JSON mode outputs.

Quick Start & Requirements

  • Install via NuGet: Install-Package OpenAI -Version 1.11.0
  • Requirements: .NET Standard 2.0 compatible (.NET Framework >=4.7.2, .NET Core >=3.0). Works across Windows, Linux, macOS.
  • Authentication: API key via constructor, OPENAI_API_KEY environment variable, or .openai config file.

Highlighted Details

  • Supports GPT-3.5/4, GPT-3.5/4-Turbo, GPT-4 Vision, and DALL-E 3.
  • Includes streaming capabilities for chat and completions.
  • Offers audio transcription, text-to-speech, and translation features.
  • Provides utilities for embeddings and moderation.

Maintenance & Community

This project was officially adopted by Microsoft and is now maintained as the official C# OpenAI library (v2.0.0-beta and later). The original repository (up to v1.11) remains for historical documentation.

Licensing & Compatibility

Licensed under CC-0 Public Domain. This allows for unrestricted use in public or private projects, including commercial applications.

Limitations & Caveats

The repository documents the original unofficial version up to v1.11. For the latest features and official support, users should refer to the new Microsoft-maintained library. Azure OpenAI integration requires manual configuration and currently only supports API key authentication, not AD-Flow.

Health Check
Last commit

1 year ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
16 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.