Portic.Client 0.1.0

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

Portic.Client

Thin .NET client for Portic's stable POST /v1/messages HTTP surface. It builds on Portic.Sdk's normalized ChatRequest / ChatCompletion contracts, so callers get one provider-neutral shape whether the gateway routes to OpenAI, Anthropic, Ollama or a local adapter.

dotnet add package Portic.Client

What it does

  • Wraps HttpClient for POST /v1/messages.
  • Serializes/deserializes the normalized contracts with web-default JSON (camelCase).
  • Surfaces non-success responses as PorticClientException, including Portic's ProblemDetails reason code when available.

Basic usage

using Portic.Client;
using Portic.Sdk.Contracts;

var httpClient = new HttpClient
{
    BaseAddress = new Uri("https://portic.example/")
};

var portic = new PorticClient(httpClient);

var completion = await portic.SendAsync(new ChatRequest
{
    Model = "gpt-4o-mini",
    Messages =
    [
        new ChatMessage { Role = "system", Content = "Answer tersely." },
        new ChatMessage { Role = "user", Content = "Write a haiku about gateways." },
    ],
});

Console.WriteLine(completion.Message.Content);

OpenAI-style migration shape

If you already assemble a messages array for an OpenAI-compatible call, the Portic adoption path is deliberately small: keep the conversation payload, point HttpClient.BaseAddress at Portic, and send the normalized ChatRequest instead of a provider-specific request type.

var completion = await portic.SendAsync(new ChatRequest
{
    Model = "gpt-4o-mini",
    Provider = "openai",
    Messages =
    [
        new ChatMessage { Role = "user", Content = "Summarize this repository strategy." },
    ],
});

Versioning and compatibility

Portic.Client tracks the gateway's stable /v1/messages surface. Within v1, compatibility is additive: clients must ignore unknown response fields, and new optional request fields may appear. Breaking transport changes require a new path version in the gateway and a corresponding major version bump here.

Licence

Apache-2.0

Product 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 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.

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 143 8/22/2026