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
<PackageReference Include="Universal.Operative.Sdk.OpenAI" Version="1.0.0" />
<PackageVersion Include="Universal.Operative.Sdk.OpenAI" Version="1.0.0" />
<PackageReference Include="Universal.Operative.Sdk.OpenAI" />
paket add Universal.Operative.Sdk.OpenAI --version 1.0.0
#r "nuget: Universal.Operative.Sdk.OpenAI, 1.0.0"
#:package Universal.Operative.Sdk.OpenAI@1.0.0
#addin nuget:?package=Universal.Operative.Sdk.OpenAI&version=1.0.0
#tool nuget:?package=Universal.Operative.Sdk.OpenAI&version=1.0.0
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 | Versions 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. |
-
net10.0
- Universal.OpenAI.Client (>= 4.2.0)
- Universal.Operative.Sdk (>= 1.0.0)
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.