RouterBase.Client
0.1.0
dotnet add package RouterBase.Client --version 0.1.0
NuGet\Install-Package RouterBase.Client -Version 0.1.0
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="RouterBase.Client" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RouterBase.Client" Version="0.1.0" />
<PackageReference Include="RouterBase.Client" />
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 RouterBase.Client --version 0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: RouterBase.Client, 0.1.0"
#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 RouterBase.Client@0.1.0
#: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=RouterBase.Client&version=0.1.0
#tool nuget:?package=RouterBase.Client&version=0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
RouterBase .NET Client
RouterBase provides an OpenAI-compatible API at https://routerbase.com/v1. This package is a small NuGet-ready .NET client for chat completions and model listing.
Install
dotnet add package RouterBase.Client
Usage
using RouterBase;
var client = new RouterBaseClient(
Environment.GetEnvironmentVariable("ROUTERBASE_API_KEY"),
defaultModel: "google/gemini-2.5-flash"
);
var response = await client.ChatCompletionAsync(new[]
{
new ChatMessage("user", "Explain RouterBase in one sentence.")
});
Console.WriteLine(response.Choices[0].Message.Content);
Local Example
ROUTERBASE_API_KEY="sk-rb-..." dotnet run --project examples/ChatExample -- "Explain RouterBase in one sentence"
Configuration
ROUTERBASE_API_KEY: required API key.ROUTERBASE_BASE_URL: optional, defaults tohttps://routerbase.com/v1.ROUTERBASE_MODEL: optional model id; the client defaults togoogle/gemini-2.5-flash.ROUTERBASE_TIMEOUT: optional HTTP timeout in seconds when the client creates its ownHttpClient.- Custom
HttpClient,baseUrl,defaultModel,timeout, anduserAgentvalues can be passed toRouterBaseClientfor tests or staging.
More detail: docs/configuration.md.
Links
- RouterBase
- RouterBase docs
- Chat completions docs
- npm quickstart package: https://www.npmjs.com/package/routerbase-quickstart
- Release notes: CHANGELOG.md
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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.
-
net8.0
- No dependencies.
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 |
|---|---|---|
| 0.1.0 | 111 | 7/4/2026 |
Initial release with chat completions, model listing, typed responses, configurable defaults, and RouterBase documentation links.