Soenneker.OpenRouter.HttpClients
4.0.156
Prefix Reserved
dotnet add package Soenneker.OpenRouter.HttpClients --version 4.0.156
NuGet\Install-Package Soenneker.OpenRouter.HttpClients -Version 4.0.156
<PackageReference Include="Soenneker.OpenRouter.HttpClients" Version="4.0.156" />
<PackageVersion Include="Soenneker.OpenRouter.HttpClients" Version="4.0.156" />
<PackageReference Include="Soenneker.OpenRouter.HttpClients" />
paket add Soenneker.OpenRouter.HttpClients --version 4.0.156
#r "nuget: Soenneker.OpenRouter.HttpClients, 4.0.156"
#:package Soenneker.OpenRouter.HttpClients@4.0.156
#addin nuget:?package=Soenneker.OpenRouter.HttpClients&version=4.0.156
#tool nuget:?package=Soenneker.OpenRouter.HttpClients&version=4.0.156
Soenneker.OpenRouter.HttpClients
Provides a cached HttpClient configured for OpenRouter's API, including bearer authentication.
Installation
dotnet add package Soenneker.OpenRouter.HttpClients
Configuration
{
"OpenRouter": {
"ApiKey": "your-api-key"
}
}
OpenRouter:ClientBaseUrl, OpenRouter:AuthHeaderName, and OpenRouter:AuthHeaderValueTemplate can override the defaults.
Usage
using Soenneker.OpenRouter.HttpClients.Abstract;
using Soenneker.OpenRouter.HttpClients.Registrars;
services.AddOpenRouterOpenApiHttpClientAsSingleton();
IOpenRouterOpenApiHttpClient provider = serviceProvider
.GetRequiredService<IOpenRouterOpenApiHttpClient>();
HttpClient client = await provider.Get(cancellationToken);
HttpResponseMessage response = await client.GetAsync("models", cancellationToken);
response.EnsureSuccessStatusCode();
The provider owns its cached client. Disposing the provider removes and disposes that client. Scoped registration gives each provider instance its own cached client.
| Product | Versions 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. |
-
net10.0
- Soenneker.Extensions.Configuration (>= 4.0.910)
- Soenneker.Utils.HttpClientCache (>= 4.0.2128)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.OpenRouter.HttpClients:
| Package | Downloads |
|---|---|
|
Soenneker.OpenRouter.OpenApiClientUtil
Provides a configured OpenRouter 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 |
|---|---|---|
| 4.0.156 | 131 | 10/15/2026 |
| 4.0.155 | 94 | 10/14/2026 |
| 4.0.152 | 116 | 10/14/2026 |
| 4.0.151 | 104 | 10/14/2026 |
| 4.0.150 | 87 | 10/14/2026 |
| 4.0.144 | 106 | 10/13/2026 |
| 4.0.143 | 91 | 10/13/2026 |
| 4.0.139 | 115 | 10/12/2026 |
| 4.0.136 | 138 | 10/11/2026 |
| 4.0.135 | 746 | 10/9/2026 |
| 4.0.134 | 61,207 | 10/1/2026 |
| 4.0.133 | 10,494 | 9/29/2026 |
| 4.0.132 | 9,454 | 9/29/2026 |
| 4.0.131 | 10,376 | 9/26/2026 |
| 4.0.130 | 106 | 9/26/2026 |
| 4.0.129 | 116 | 9/25/2026 |
| 4.0.127 | 115 | 9/25/2026 |
| 4.0.126 | 111 | 9/24/2026 |
| 4.0.125 | 151 | 9/17/2026 |
| 4.0.124 | 103 | 9/16/2026 |
Updated NuGet packages