Soenneker.OpenAI.Client.Chat 4.0.1180

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.OpenAI.Client.Chat --version 4.0.1180
                    
NuGet\Install-Package Soenneker.OpenAI.Client.Chat -Version 4.0.1180
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.OpenAI.Client.Chat" Version="4.0.1180" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.OpenAI.Client.Chat" Version="4.0.1180" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.OpenAI.Client.Chat" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.OpenAI.Client.Chat --version 4.0.1180
                    
#r "nuget: Soenneker.OpenAI.Client.Chat, 4.0.1180"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.OpenAI.Client.Chat@4.0.1180
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.OpenAI.Client.Chat&version=4.0.1180
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.OpenAI.Client.Chat&version=4.0.1180
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image Soenneker.OpenAI.Client.Chat

An async thread-safe singleton for the OpenAI Chat (completions) client

This library provides an implementation for interacting with the OpenAI service. It allows you to configure and utilize a ChatClient to perform various tasks using OpenAI's models.

For the Azure version of this: Soenneker.Azure.OpenAI.Client.Chat

Installation

dotnet add package Soenneker.OpenAI.Client.Chat

Register:

builder.services.AddOpenAIChatClientAsSingleton();

IConfiguration values:

"OpenAI:ApiKey"
"OpenAI:Model"

Usage

public class OpenAIService
{
    private readonly IOpenAIChatClient _chatClient;

    public OpenAIService(IOpenAIChatClient chatClient)
    {
        _chatClient = chatClient;
    }

    public async ValueTask<string> Chat(string prompt, CancellationToken cancellationToken = default)
    {
        var client = await _chatClient.Get(cancellationToken);
        ChatCompletion completion = await client.CompleteChatAsync(prompt);
    }
}
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.1183 0 3/7/2026
4.0.1182 96 3/5/2026
4.0.1181 33 3/5/2026
4.0.1180 33 3/5/2026
4.0.1179 33 3/5/2026
4.0.1178 38 3/4/2026
4.0.1177 31 3/4/2026
4.0.1176 37 3/4/2026
4.0.1175 38 3/4/2026
4.0.1174 33 3/4/2026
4.0.1173 39 3/4/2026
4.0.1172 118 3/3/2026
4.0.1171 736 2/28/2026
4.0.1170 117 2/28/2026
4.0.1169 98 2/27/2026
4.0.1168 231 2/27/2026
4.0.1167 87 2/27/2026
4.0.1166 117 2/26/2026
4.0.1165 1,031 2/22/2026
4.0.1164 102 2/22/2026
Loading failed