Universal.Operative.Sdk.Discrete.OpenAI.ChatGpt 3.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Universal.Operative.Sdk.Discrete.OpenAI.ChatGpt --version 3.0.0
                    
NuGet\Install-Package Universal.Operative.Sdk.Discrete.OpenAI.ChatGpt -Version 3.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.Discrete.OpenAI.ChatGpt" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Universal.Operative.Sdk.Discrete.OpenAI.ChatGpt" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Universal.Operative.Sdk.Discrete.OpenAI.ChatGpt" />
                    
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.Discrete.OpenAI.ChatGpt --version 3.0.0
                    
#r "nuget: Universal.Operative.Sdk.Discrete.OpenAI.ChatGpt, 3.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.Discrete.OpenAI.ChatGpt@3.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.Discrete.OpenAI.ChatGpt&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Universal.Operative.Sdk.Discrete.OpenAI.ChatGpt&version=3.0.0
                    
Install as a Cake Tool

Universal.Operative.Sdk.Discrete.OpenAI.ChatGpt

An IModel adapter for the ChatGPT Responses backend. This is not the OpenAI Platform Responses API; use Universal.Operative.Sdk.Discrete.OpenAI for that API and its broader surface.

dotnet add package Universal.Operative.Sdk.Discrete.OpenAI.ChatGpt

Authentication

Use an access token directly when token storage and refresh are handled elsewhere:

using var client = new ChatGptResponsesClient(accessToken, accountId);

Use an auth.json file for persisted credentials and automatic refresh:

using var httpClient = new HttpClient();
using var credentials = new AuthenticationFileCredentialProvider(authFilePath, httpClient);
using var client = new ChatGptResponsesClient(httpClient, credentials);

Use OAuthClient to create and complete a browser authorization session:

var oauth = new OAuthClient(httpClient);
var authorization = oauth.CreateAuthorizationSession();

string code = oauth.ReadAuthorizationCode(callbackUri, authorization);
OAuthResponse response = await oauth.ExchangeCodeAsync(code, authorization);
credentials.Save(response);
using Universal.OpenAI.ChatGpt.Client;
using Universal.OpenAI.ChatGpt.Client.Responses;
using Universal.Operative.Sdk;
using Universal.Operative.Sdk.Discrete;
using Universal.Operative.Sdk.Discrete.OpenAI.ChatGpt;

using var httpClient = new HttpClient();
using var credentials = new AuthenticationFileCredentialProvider(authFilePath, httpClient);
using var client = new ChatGptResponsesClient(httpClient, credentials);

IModel model = new ResponsesModel(client, new ResponsesModel.Options
{
    ModelId = Models.Gpt56Luna,
    ReasoningEffort = ReasoningEfforts.Medium,
});

Message response = await model.CompleteAsync(new Conversation
{
    Messages =
    {
        new Message
        {
            Role = MessageRoles.User,
            Content = { new TextBlock("Explain this code.") },
        },
    },
});

StreamAsync preserves the Responses SSE lifecycle as universal indexed block events. Text, reasoning summaries, refusals, and function-call arguments are emitted incrementally when the backend supplies deltas; completed output items remain the fallback for content the backend only supplies at settlement.

Persisted conversations can move between providers. Before serialization, the adapter converts provider-hosted tool activity into bounded text context, omits unsupported provider-specific blocks, and removes unmatched historical tool calls/results that ChatGPT cannot replay safely.

License

Free for noncommercial use under the Universal.Operative Noncommercial License. Commercial use requires a separate license from Andrew Ong.

Product 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 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
3.1.1 100 10/2/2026
3.1.0 93 10/1/2026
3.0.1 92 9/28/2026
3.0.0 134 9/7/2026
1.0.4 116 9/2/2026
1.0.3 107 9/1/2026
1.0.2 103 9/1/2026
1.0.1 104 9/1/2026
1.0.0 98 9/1/2026

Supports conversation managers and durable chronologies.