Soenneker.OpenRouter.HttpClients 11.0.176

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.OpenRouter.HttpClients --version 11.0.176
                    
NuGet\Install-Package Soenneker.OpenRouter.HttpClients -Version 11.0.176
                    
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.OpenRouter.HttpClients" Version="11.0.176" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.OpenRouter.HttpClients" Version="11.0.176" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.OpenRouter.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.OpenRouter.HttpClients --version 11.0.176
                    
#r "nuget: Soenneker.OpenRouter.HttpClients, 11.0.176"
                    
#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.OpenRouter.HttpClients@11.0.176
                    
#: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.OpenRouter.HttpClients&version=11.0.176
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.OpenRouter.HttpClients&version=11.0.176
                    
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.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 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.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
11.0.180 275 11/19/2026
11.0.179 105 11/19/2026
11.0.178 101 11/19/2026
11.0.176 109 11/18/2026
11.0.175 89 11/18/2026
11.0.172 217 11/15/2026
11.0.171 112 11/15/2026
11.0.169 657 11/11/2026
11.0.168 98 11/11/2026
11.0.167 165 11/11/2026
11.0.166 99 11/11/2026
11.0.165 15,797 11/3/2026
11.0.164 622 11/3/2026
11.0.162 121 11/3/2026
11.0.160 6,992 10/27/2026
11.0.159 154 10/26/2026
11.0.158 120 10/26/2026
11.0.157 147 10/26/2026
4.0.156 248 10/15/2026
4.0.155 117 10/14/2026
Loading failed

Updated Soenneker.Utils.HttpClientCache to 11.0.2158