Compendium.Adapters.OpenRouter
1.1.0-preview.6
dotnet add package Compendium.Adapters.OpenRouter --version 1.1.0-preview.6
NuGet\Install-Package Compendium.Adapters.OpenRouter -Version 1.1.0-preview.6
<PackageReference Include="Compendium.Adapters.OpenRouter" Version="1.1.0-preview.6" />
<PackageVersion Include="Compendium.Adapters.OpenRouter" Version="1.1.0-preview.6" />
<PackageReference Include="Compendium.Adapters.OpenRouter" />
paket add Compendium.Adapters.OpenRouter --version 1.1.0-preview.6
#r "nuget: Compendium.Adapters.OpenRouter, 1.1.0-preview.6"
#:package Compendium.Adapters.OpenRouter@1.1.0-preview.6
#addin nuget:?package=Compendium.Adapters.OpenRouter&version=1.1.0-preview.6&prerelease
#tool nuget:?package=Compendium.Adapters.OpenRouter&version=1.1.0-preview.6&prerelease
compendium-adapter-openrouter
OpenRouter AI provider adapter for the Compendium event-sourcing framework. Implements IAIProvider from Compendium.Abstractions.AI to give access to 100+ LLM models (Claude, GPT-4, Llama, Mistral, etc.) through a single OpenAI-compatible API.
Extracted from sassy-solutions/compendium per ADR-0006 (multi-repo adapter split). Built from template-compendium-adapter-dotnet.
Install
dotnet add package Compendium.Adapters.OpenRouter
services.AddOpenRouter(builder.Configuration.GetSection("OpenRouter"));
See docs/README.md for full configuration, model routing, fallback behaviour, and cost optimisation.
GLM models (z-ai/glm-*)
The GLM models go through the GLM dialect (Compendium.Adapters.ZAi.Glm, shared with the Z.ai and Mistral adapters —
docs/adr/0001-glm-dialect.md): with CompletionRequest.Reasoning,
reasoning: {effort, exclude} (low / high / max for GLM 5.3, high / xhigh for GLM 5.2, the efforts the
catalog lists; never effort: "none", GLM 5.3's reasoning is mandatory);
max_tokens with room for the reasoning, with or without it; reasoning / reasoning_details read into
ReasoningDelta / Reasoning when asked for, never into the answer; reasoning_tokens into UsageStats.ReasoningTokens;
and the usage frame OpenRouter sends after the last content chunk read into the final chunk. Every other model is sent
and read exactly as before.
Versioning
This package continues the version sequence of Compendium.Adapters.OpenRouter originally published from the framework monorepo (last framework-published version: 1.0.0-preview.8). The first release from this repo is v1.0.0-preview.9. Versions are driven by git tags via MinVer — see docs/RELEASE.md.
Repository conventions
| Aspect | Choice |
|---|---|
| Target | .NET 9 and .NET 10 (net9.0;net10.0), C# 13 |
| Test framework | xUnit 2.9.3 + FluentAssertions 6.12.1 + NSubstitute 5.1.0 |
| Coverage | currently 98.77 % line / 93.23 % branch (63 tests) — gate at 90 % |
| HTTP mocking | RichardSzalay.MockHttp 7.0.0 |
| Result pattern | Result<T> from Compendium.Core |
| Test naming | {SUT}Tests / {Method}_{Scenario}_{Expected} + AAA explicit |
Build & test locally
dotnet restore
dotnet build -c Release
dotnet test -c Release --collect:"XPlat Code Coverage"
Releasing
Tag with a v prefix on main to publish to nuget.org + GitHub Packages:
git tag v1.0.0-preview.10
git push origin v1.0.0-preview.10
See docs/RELEASE.md for the full release procedure and required secrets.
License
MIT — Copyright © 2026 Sassy Solutions.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. 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 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. |
-
net10.0
- Compendium.Abstractions.AI (>= 1.1.0-preview.6)
- Compendium.Adapters.ZAi.Glm (>= 1.1.0-preview.6)
- Compendium.Core (>= 1.0.5-preview.5)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.13)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Http (>= 10.0.13)
- Microsoft.Extensions.Http.Resilience (>= 10.6.0)
- Microsoft.Extensions.Options (>= 10.0.13)
-
net9.0
- Compendium.Abstractions.AI (>= 1.1.0-preview.6)
- Compendium.Adapters.ZAi.Glm (>= 1.1.0-preview.6)
- Compendium.Core (>= 1.0.5-preview.5)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.20)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.20)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.20)
- Microsoft.Extensions.Http (>= 9.0.20)
- Microsoft.Extensions.Http.Resilience (>= 10.6.0)
- Microsoft.Extensions.Options (>= 9.0.20)
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 |
|---|---|---|
| 1.1.0-preview.6 | 580 | 10/31/2026 |
| 1.0.0 | 129,565 | 5/14/2026 |
| 1.0.0-preview.9 | 735 | 5/13/2026 |
| 1.0.0-preview.8 | 967 | 5/2/2026 |
| 1.0.0-preview.7 | 83 | 5/2/2026 |
| 1.0.0-preview.6 | 121 | 5/2/2026 |
| 1.0.0-preview.5 | 123 | 4/30/2026 |
| 1.0.0-preview.4 | 194 | 4/26/2026 |
| 1.0.0-preview.3 | 88 | 4/26/2026 |
| 1.0.0-preview.2 | 91 | 4/25/2026 |
| 1.0.0-preview.1 | 193 | 4/24/2026 |