Soenneker.OpenAI.HttpClients
11.0.166
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.OpenAI.HttpClients --version 11.0.166
NuGet\Install-Package Soenneker.OpenAI.HttpClients -Version 11.0.166
<PackageReference Include="Soenneker.OpenAI.HttpClients" Version="11.0.166" />
<PackageVersion Include="Soenneker.OpenAI.HttpClients" Version="11.0.166" />
<PackageReference Include="Soenneker.OpenAI.HttpClients" />
paket add Soenneker.OpenAI.HttpClients --version 11.0.166
#r "nuget: Soenneker.OpenAI.HttpClients, 11.0.166"
#:package Soenneker.OpenAI.HttpClients@11.0.166
#addin nuget:?package=Soenneker.OpenAI.HttpClients&version=11.0.166
#tool nuget:?package=Soenneker.OpenAI.HttpClients&version=11.0.166
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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Soenneker.Extensions.Configuration (>= 11.0.914)
- Soenneker.Utils.HttpClientCache (>= 11.0.2141)
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.183 | 127 | 11/19/2026 |
| 11.0.182 | 58 | 11/19/2026 |
| 11.0.181 | 68 | 11/18/2026 |
| 11.0.179 | 50 | 11/18/2026 |
| 11.0.178 | 54 | 11/18/2026 |
| 11.0.177 | 199 | 11/15/2026 |
| 11.0.176 | 111 | 11/15/2026 |
| 11.0.174 | 232 | 11/11/2026 |
| 11.0.173 | 112 | 11/11/2026 |
| 11.0.172 | 103 | 11/11/2026 |
| 11.0.171 | 102 | 11/11/2026 |
| 11.0.170 | 161 | 11/11/2026 |
| 11.0.169 | 405 | 11/3/2026 |
| 11.0.168 | 134 | 11/3/2026 |
| 11.0.167 | 117 | 11/3/2026 |
| 11.0.166 | 127 | 11/3/2026 |
| 11.0.165 | 123 | 11/3/2026 |
| 11.0.164 | 358 | 10/27/2026 |
| 11.0.163 | 131 | 10/27/2026 |
| 11.0.162 | 110 | 10/26/2026 |
Updated Multiple NuGet packages