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
<PackageReference Include="Soenneker.Cohere.OpenApiClientUtil" Version="11.0.273" />
<PackageVersion Include="Soenneker.Cohere.OpenApiClientUtil" Version="11.0.273" />
<PackageReference Include="Soenneker.Cohere.OpenApiClientUtil" />
paket add Soenneker.Cohere.OpenApiClientUtil --version 11.0.273
#r "nuget: Soenneker.Cohere.OpenApiClientUtil, 11.0.273"
#:package Soenneker.Cohere.OpenApiClientUtil@11.0.273
#addin nuget:?package=Soenneker.Cohere.OpenApiClientUtil&version=11.0.273
#tool nuget:?package=Soenneker.Cohere.OpenApiClientUtil&version=11.0.273
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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Soenneker.Cohere.HttpClients (>= 11.0.210)
- Soenneker.Cohere.OpenApiClient (>= 11.0.82)
- Soenneker.Kiota.GenericAuthenticationProvider (>= 11.0.65)
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 |
Updated Multiple NuGet packages