Universal.Operative.Sdk.OpenAI 1.0.0

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

About

Universal.Operative.Sdk.OpenAI plugs OpenAI into Universal.Operative.Sdk by providing two IModel adapters backed by the Universal.OpenAI.Client transport:

  • ChatCompletionsModel — targets the Chat Completions endpoint. Also the right choice for the wide ecosystem of OpenAI-compatible servers (Azure OpenAI, vLLM, llama.cpp, Groq, Together, OpenRouter, LM Studio, Ollama, …).
  • ResponsesModel — targets the Responses API. Prefer this for first-class OpenAI-only features: reasoning round-trip, hosted tools (web search, file search, code interpreter, image generation, MCP), and structured output shapes Chat Completions can't express. It is stateless by default (store=false) — full history is sent on every turn.

Both adapters stream provider events and fold them into the SDK's provider-neutral StreamEvent sequence, so the rest of the harness (tool dispatch, transformers, event stream) is identical regardless of which one you pick.

How to Use

Installation

dotnet add package Universal.Operative.Sdk.OpenAI

Configuration

using Universal.Operative.Sdk;
using Universal.Operative.Sdk.OpenAI;

// Chat Completions — also works against Azure OpenAI / vLLM / OpenRouter / etc.
// via the Universal.OpenAI.Client's base-URL configuration.
IModel model = new ChatCompletionsModel("sk-...", new ChatCompletionsModel.Options
{
    ModelId = "gpt-4.1",
    MaxCompletionTokens = 4096,
    Temperature = 0.7f,
});

// Responses API — needed for reasoning round-trip and hosted tools.
IModel reasoningModel = new ResponsesModel("sk-...", new ResponsesModel.Options
{
    ModelId = "gpt-5",
    ReasoningEffort = ReasoningEfforts.High,
    Include = new[] { "reasoning.encrypted_content" }, // round-trip reasoning across stateless turns
});

Both constructors also accept an existing Universal.OpenAI.Client.V1.V1Client in place of a raw API key, so you can reuse a client (custom HttpClient, base address, headers) across models.

Usage

Either model drops straight into OperativeBuilder:

IOperative operative = OperativeBuilder.FromDefaults(model)
    .AddBaselineTools()
    .Build();

await foreach (OperativeEvent e in operative.ExecuteAsync(conversation))
{
    // handle events as usual — see Universal.Operative.Sdk's Package.md
}

ParallelToolCalls (both models) controls whether OpenAI may emit more than one tool call per turn. ReasoningEffort (both) accepts the constants on Universal.OpenAI.Client.V1.Responses.ReasoningEfforts ("minimal", "low", "medium", "high"). ResponsesModel additionally exposes Truncation and ServiceTier for endpoint-specific knobs.

License

Free for noncommercial use under the Universal.Operative Noncommercial License. Source is closed; commercial use requires a separate license from Andrew Ong.

Product Compatible and additional computed target framework versions.
.NET 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. 
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
1.0.0 101 7/3/2026

Initial release.