Soenneker.OpenRouter.HttpClients 4.0.156

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 4.0.156
                    
NuGet\Install-Package Soenneker.OpenRouter.HttpClients -Version 4.0.156
                    
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="4.0.156" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.OpenRouter.HttpClients" Version="4.0.156" />
                    
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 4.0.156
                    
#r "nuget: Soenneker.OpenRouter.HttpClients, 4.0.156"
                    
#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@4.0.156
                    
#: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=4.0.156
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.OpenRouter.HttpClients&version=4.0.156
                    
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 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 (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 150 11/19/2026
11.0.179 81 11/19/2026
11.0.178 80 11/19/2026
11.0.176 96 11/18/2026
11.0.175 75 11/18/2026
11.0.172 209 11/15/2026
11.0.171 109 11/15/2026
11.0.169 652 11/11/2026
11.0.168 93 11/11/2026
11.0.167 159 11/11/2026
11.0.166 95 11/11/2026
11.0.165 15,795 11/3/2026
11.0.164 620 11/3/2026
11.0.162 119 11/3/2026
11.0.160 6,990 10/27/2026
11.0.159 151 10/26/2026
11.0.158 115 10/26/2026
11.0.157 142 10/26/2026
4.0.156 245 10/15/2026
4.0.155 114 10/14/2026
Loading failed

Updated NuGet packages