Soenneker.OpenAI.HttpClients 11.0.205

Prefix Reserved
dotnet add package Soenneker.OpenAI.HttpClients --version 11.0.205
                    
NuGet\Install-Package Soenneker.OpenAI.HttpClients -Version 11.0.205
                    
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.HttpClients" Version="11.0.205" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.OpenAI.HttpClients" Version="11.0.205" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.OpenAI.HttpClients" />
                    
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.HttpClients --version 11.0.205
                    
#r "nuget: Soenneker.OpenAI.HttpClients, 11.0.205"
                    
#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.HttpClients@11.0.205
                    
#: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.HttpClients&version=11.0.205
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.OpenAI.HttpClients&version=11.0.205
                    
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

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

Provides a cached, bearer-authenticated HttpClient for the OpenAI API.

Installation

dotnet add package Soenneker.OpenAI.HttpClients

Configuration

{
  "OpenAI": {
    "ApiKey": "your-api-key"
  }
}

OpenAI:ClientBaseUrl can override the default https://api.openai.com/v1 endpoint. OpenAI:AuthHeaderName and OpenAI:AuthHeaderValueTemplate can override the default bearer header for a compatible endpoint.

Usage

using Soenneker.OpenAI.HttpClients.Abstract;
using Soenneker.OpenAI.HttpClients.Registrars;

services.AddOpenAIOpenApiHttpClientAsSingleton();

IOpenAIOpenApiHttpClient openAI = serviceProvider
    .GetRequiredService<IOpenAIOpenApiHttpClient>();

HttpClient client = await openAI.Get(cancellationToken);

Do not dispose the returned HttpClient; the registered provider owns it and removes it from the cache when disposed.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Soenneker.OpenAI.HttpClients:

Package Downloads
Soenneker.OpenAI.OpenApiClientUtil

Provides a configured OpenAI REST API client and reuses it for the lifetime of the registered service.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.205 108 12/3/2026
11.0.204 74 12/3/2026
11.0.203 74 12/3/2026
11.0.202 67 12/3/2026
11.0.201 70 12/3/2026
11.0.200 58 12/3/2026
11.0.199 75 12/2/2026
11.0.197 78 12/2/2026
11.0.195 127 12/2/2026
11.0.194 64 12/2/2026
11.0.193 79 12/2/2026
11.0.192 75 12/2/2026
11.0.191 99 12/1/2026
11.0.190 110 12/1/2026
11.0.189 106 12/1/2026
11.0.188 118 12/1/2026
11.0.187 114 12/1/2026
11.0.186 118 11/30/2026
11.0.185 180 11/30/2026
11.0.184 124 11/29/2026
Loading failed

Updated Multiple NuGet packages