Soenneker.Cohere.OpenApiClientUtil 11.0.273

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

Soenneker.Cohere.OpenApiClientUtil

Provides a cached, bearer-authenticated CohereOpenApiClient with configurable base URL and authorization formatting.

Installation

dotnet add package Soenneker.Cohere.OpenApiClientUtil

Configuration

{
  "Cohere": {
    "ApiKey": "your-api-key",
    "ClientBaseUrl": "https://api.cohere.com",
    "AuthHeaderName": "Authorization",
    "AuthHeaderValueTemplate": "Bearer {token}"
  }
}

ApiKey is required. The other values show their defaults. Keep the key in a secret provider, and override the base URL or header formatting only when the target Cohere-compatible endpoint requires it.

Registration

using Soenneker.Cohere.OpenApiClientUtil.Registrars;

services.AddCohereOpenApiClientUtilAsScoped();

Singleton registration is available with AddCohereOpenApiClientUtilAsSingleton().

The scoped utility borrows a singleton Cohere HTTP provider. Disposing the utility clears its generated-client cache but leaves the shared HTTP client alive until the provider's container lifetime ends.

Usage

using Soenneker.Cohere.OpenApiClientUtil.Abstract;
using Soenneker.Cohere.OpenApiClient;
using Soenneker.Cohere.OpenApiClient.Models;

CohereOpenApiClient client = await clientUtil.Get(cancellationToken);

var request = new Chatv2Request
{
    Model = modelName,
    Messages = messages
};

Chatv2200Response? response =
    await client.V2.Chat.PostAsync(request, cancellationToken: cancellationToken);

The generated request and response models are exposed directly. Validate model-specific inputs, handle nullable response bodies and Kiota API exceptions, and avoid logging prompts, documents, embeddings, or generated output when they may contain sensitive data.

Do not dispose the borrowed HttpClient or mutate the shared request adapter. Dispose this utility through dependency injection according to its selected lifetime.

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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.273 48 12/3/2026
11.0.272 73 12/3/2026
11.0.271 78 12/3/2026
11.0.270 74 12/3/2026
11.0.269 76 12/3/2026
11.0.268 69 12/2/2026
11.0.267 78 12/2/2026
11.0.266 87 12/2/2026
11.0.265 80 12/2/2026
11.0.263 87 12/2/2026
11.0.262 84 12/2/2026
11.0.261 94 12/2/2026
11.0.260 87 12/1/2026
11.0.259 90 12/1/2026
11.0.258 88 12/1/2026
11.0.257 92 12/1/2026
11.0.256 87 12/1/2026
11.0.255 90 12/1/2026
11.0.254 93 11/30/2026
11.0.253 97 11/30/2026
Loading failed

Updated Multiple NuGet packages