Skip to content

Latest commit

 

History

History
1367 lines (1136 loc) · 111 KB

File metadata and controls

1367 lines (1136 loc) · 111 KB

Release History

2.12.0 (2026-06-30)

Acknowledgments

Thank you to our developer community members who helped to make the OpenAI client library better with their contributions to this release:

Features Added

  • OpenAI.Containers:
    • Added support for network policies.
      • Added the ContainerNetworkPolicy type with the following derived types:
        • ContainerAllowlistNetworkPolicy
        • ContainerDisabledNetworkPolicy
      • Added the ContainerNetworkPolicyKind extensible enum.
      • Added the ContainerNetworkPolicyDomainSecret type.
      • Added the NetworkPolicy property to ContainerCreationOptions.
    • Added support for memory limits for containers.
      • Added the ContainerMemoryLimit extensible enum.
      • Added the MemoryLimit property to ContainerCreationOptions.
    • Added support for listing containers filtered by name.
      • Added the Name property to ContainerCollectionOptions.
  • OpenAI.Conversations:
    • Added new conveniences to the ConversationClient:
      • Added the ConversationCreationOptions type.
      • Added the ConversationUpdateOptions type.
      • Added the ConversationDeletionResult type.
      • Added the ConversationResource type.
      • Added new convenience methods to the ConversationClient:
        • CreateConversation and CreateConversationAsync
        • DeleteConversation and DeleteConversationAsync
        • GetConversation and GetConversationAsync
        • UpdateConversation and UpdateConversationAsync
  • OpenAI.Responses:
    • Added support for cache keys and cache retention policies, used by OpenAI to cache responses for similar requests in order to optimize your cache hit rates.
      • Added the ResponsePromptCacheRetentionPolicy extensible enum.
      • Added the PromptCacheKey and PromptCacheRetentionPolicy properties to CreateResponseOptions.
      • Added the PromptCacheKey and PromptCacheRetentionPolicy properties to ResponseResult.

Bugs Fixed

  • OpenAI.Chat:
    • Fixed ChatMessageContentPart.CreateImagePart(Uri) incorrectly serializing image_url.url via Uri.ToString(), which would unescape percent-encoded characters (e.g., %20 → space) and break downstream image fetches. The serialized URL now uses Uri.AbsoluteUri to preserve percent-encoding.

Other Changes

Breaking Changes in Experimental APIs

  • OpenAI.Containers:
    • Renamed the following classes for consistency:
      • Renamed DeleteContainerResponse to ContainerDeletionResult.
      • Renamed DeleteContainerFileResponse to ContainerFileDeletionResult.
      • Renamed ContainerResourceExpiresAfter to ContainerExpirationPolicy.
      • Renamed CreateContainerBody to ContainerCreationOptions.
    • Renamed the following properties for consistency:
      • Renamed the Minutes property of ContainerExpirationPolicy to Duration.
      • Renamed the Id property of ContainerDeletionResult to ContainerId.
      • Renamed the Id property of ContainerFileDeletionResult to ContainerFileId.
      • Renamed the ExpiresAfter property of ContainerResource to ExpirationPolicy.
    • Changed the type of the Anchor property of ContainerExpirationPolicy from string to ContainerExpirationPolicyAnchor?.
    • Changed the type of the Duration property of ContainerExpirationPolicy from int to TimeSpan?.
    • Changed the type of the ExpiresAfter property of ContainerResource from ContainerResourceExpiresAfter to ContainerExpirationPolicy.
    • Removed the ContainerResourceExpiresAfter class.
  • OpenAI.Conversations:
    • Made the options parameter of type RequestOptions required for several methods in the ConversationClient in order to disambiguate the new overloads.

2.11.0 (2026-06-05)

Acknowledgments

Thank you to our developer community members who helped to make the OpenAI client library better with their contributions to this release:

Features Added

  • OpenAI.Chat:
    • Added support for specifying high-level guidance regarding the context window size to use during a web search.
      • Added the ChatWebSearchContextSize extensible enum.
      • Added the SearchContextSize property to ChatWebSearchOptions.
  • OpenAI.Skills:
    • Added support for managing reusable, versioned agent skills.
      • Introduced the new SkillClient with the following methods:
        • UploadSkill and UploadSkillAsync
        • UpdateSkill and UpdateSkillAsync
        • GetSkill and GetSkillAsync
        • GetSkills and GetSkillsAsync
        • DownloadSkill and DownloadSkillAsync
        • DeleteSkill and DeleteSkillAsync
        • UploadSkillVersion and UploadSkillVersionAsync
        • GetSkillVersion and GetSkillVersionAsync
        • GetSkillVersions and GetSkillVersionsAsync
        • DownloadSkillVersion and DownloadSkillVersionAsync
        • DeleteSkillVersion and DeleteSkillVersionAsync
  • OpenAI.Responses:
    • Added support for retrieving the log probabilities of output tokens.
      • Added the ResponseTokenLogProbabilityDetails type.
      • Added the ResponseTokenTopLogProbabilityDetails type.
      • Added the OutputTextTokenLogProbabilities property to ResponseContentPart.
      • Added the TokenLogProbabilities property to StreamingResponseOutputTextDeltaUpdate.
      • Added the TokenLogProbabilities property to StreamingResponseOutputTextDoneUpdate.
    • Added support for retrieving the function name in applicable function call argument streaming events.
      • Added FunctionName property to StreamingResponseFunctionCallArgumentsDoneUpdate.
    • Added extensibility to the ResponseItem class hierarchy.
      • Added the ResponseItemKind extensible enum.
      • Added the Kind property to ResponseItem.
      • Added a protected constructor to ResponseItem that takes a ResponseItemKind parameter.
    • Added extensibility to the ResponseTool class hierarchy.
      • Added the ResponseToolKind extensible Enum.
      • Added the Kind property to ResponseTool.
      • Added a protected constructor to ResponseTool that takes a ResponseToolKind parameter.
    • Added extensibility to the StreamingResponseUpdate class hierarchy.
      • Added the StreamingResponseUpdateKind extensible enum.
      • Added the Kind property to StreamingResponseUpdate.
      • Added a protected constructor to StreamingResponseUpdate that takes a StreamingResponseUpdateKind parameter.

Bugs Fixed

  • OpenAI.Assistants:
    • Fixed a NullReferenceException when a streaming response delivered an unmodeled error event. The SSE error frame is now surfaced as a ClientResultException so the failure is observable, while the unknown-event path stays covered.
  • OpenAI.Files:
    • Fixed an issue where the UploadFile and UploadFileAsync method overloads in OpenAIFileClient that take a filePath were incorrectly using the entire path as the filename.
  • OpenAI.Realtime:
    • Fixed an issue where the AudioEndTime property of RealtimeClientCommandConversationItemTruncate was incorrectly serialized as a float instead of an integer.

Breaking Changes in Experimental APIs

  • OpenAI.Audio:
    • Changed the type of the KnownSpeakerReferenceUris property of AudioTranscriptionOptions from IList<Uri> to IList<string>.
  • OpenAI.Containers:
    • Renamed the CreateContainerFile and CreateContainerFileAsync methods of ContainerClient to UploadContainerFile and UploadContainerFileAsync.
    • Changed the type of the Order property of ContainerFileCollectionOptions from ContainerCollectionOrder? to ContainerFileCollectionOrder?.
  • OpenAI.Realtime:
    • Changed the type of the Options property of RealtimeClientSettings from OpenAIClientOptions to RealtimeClientOptions.
  • OpenAI.Responses:
    • Moved the AddResponsesClient and AddKeyedResponsesClient IHostApplicationBuilder extension methods under the OpenAI.Responses namespace.
    • Removed the action and background parameters from the constructor of ImageGenerationCallResponseItem.
    • Removed the ImageGenToolCallBackground type in favor of ImageGenerationToolBackground.
    • Removed the ImageGenToolCallOutputFormat type in favor of ImageGenerationToolOutputFileFormat.
    • Removed the ImageGenToolCallQuality type in favor of ImageGenerationToolQuality.
    • Removed the ImageGenToolCallSize type in favor of ImageGenerationToolSize.
    • Changed the type of the Action property of ImageGenerationCallResponseItem from ImageGenerationToolAction to ImageGenerationToolAction?.
    • Changed the type of the Background property of ImageGenerationCallResponseItem from ImageGenToolCallBackground to ImageGenerationToolBackground?.
    • Changed the type of the OutputFormat property of ImageGenerationCallResponseItem from ImageGenToolCallOutputFormat to ImageGenerationToolOutputFileFormat?.
    • Changed the type of the Quality property of ImageGenerationCallResponseItem from ImageGenToolCallQuality to ImageGenerationToolQuality?.
    • Changed the type of the Size property of ImageGenerationCallResponseItem from ImageGenToolCallSize to ImageGenerationToolSize?.
    • Renamed the OutputFormat property of ImageGenerationCallResponseItem to OutputFileFormat.
    • Changed the type of the Options property of ResponsesClientSettings from OpenAIClientOptions to ResponsesClientOptions.
    • Changed the type of the options parameters in the constructors of ResponsesClient from OpenAIClientOptions to ResponsesClientOptions.
    • Reordered the parameters of the following methods of the ResponsesClient for consistency:
      • CompactResponse and CompactResponseAsync
      • GetInputTokenCount and GetInputTokenCountAsync
    • Renamed StreamingResponseTextAnnotationAddedUpdate to StreamingResponseOutputTextAnnotationAddedUpdate.

2.10.0 (2026-04-03)

Features Added

  • OpenAI.Audio:
    • Added support for audio transcriptions with speaker diarization.
      • Added the Diarized value to the AudioTranscriptionFormat extensible enum.
      • Added KnownSpeakerNames and KnownSpeakerReferenceUris properties to AudioTranscriptionOptions.
      • Added TranscribeAudioDiarized and TranscribeAudioDiarizedAsync methods to the AudioClient.
      • Added the following derived types of StreamingAudioTranscriptionUpdate:
        • StreamingAudioTranscriptionTextSegmentUpdate
    • Added support for streaming speech generation.
      • Added GenerateSpeechStreaming and GenerateSpeechStreamingAsync methods to the AudioClient.
      • Added the StreamingSpeechUpdate type with the following derived types:
        • StreamingSpeechAudioDeltaUpdate
        • StreamingSpeechAudioDoneUpdate
    • Added support for managing custom voices and voice consents.
      • Added the following protocol methods to the AudioClient:
        • CreateVoice and CreateVoiceAsync
        • CreateVoiceConsent and CreateVoiceConsentAsync
        • DeleteVoiceConsent and DeleteVoiceConsentAsync
        • GetVoiceConsent and GetVoiceConsentAsync
        • GetVoiceConsents and GetVoiceConsentsAsync
        • UpdateVoiceConsent and UpdateVoiceConsentAsync
    • Added support for controlling how input audio is cut into chunks for transcription requests.
      • Added the ChunkingStrategy property to AudioTranscriptionOptions.
    • Added support for viewing the usage statistics of transcription requests.
      • Added the Usage property to AudioTranscription.
      • Added the AudioTranscriptionUsage type with the following derived types:
        • AudioTranscriptionTokenUsage
        • AudioTranscriptionDurationUsage
    • Added support for viewing the usage statistics of streaming speech generation requests.
      • Added the SpeechTokenUsage type.
  • OpenAI.Responses:
    • Added support for allowing the model to create, update, and delete files in codebases using structured diffs via the Apply Patch tool.
      • Added the following derived types of ResponseTool:
        • ApplyPatchTool
      • Added the following derived types of ResponseItem:
        • ApplyPatchCallItem
        • ApplyPatchCallOutputItem
      • Added the ApplyPatchOperation type with the following derived types:
        • ApplyPatchCreateFileOperation
        • ApplyPatchDeleteFileOperation
        • ApplyPatchUpdateFileOperation
    • Added support for viewing the specific action that the model takes as part of a web search.
      • Added the Action property to WebSearchCallResponseItem.
      • Added the WebSearchAction type with the following derived types:
        • WebSearchFindInPageAction
        • WebSearchOpenPageAction
        • WebSearchSearchAction
      • Added the WebSearchCallActionSources value to the IncludedResponseProperty extensible enum.
      • Added the WebSearchActionSource type with the following derived types:
        • WebSearchActionUriSource
    • Added support for controlling whether the Image Generation tool generates a new image or edits an existing image.
      • Added the Action property to ImageGenerationTool.
      • Added the ImageGenerationToolAction extensible enum with values Generate, Edit, and Auto.
  • OpenAI.VectorStores:
    • Added support for adding descriptions to Vector Stores.
      • Added the Description property to VectorStoreCreationOptions.

Bugs Fixed

  • OpenAI.Embeddings:
    • Fixed an issue where base64-encoded embedding values containing JSON escape sequences (e.g., \/ or \u002F for /) failed to decode, causing a FormatException. Per RFC 8259 §7, these are valid JSON representations that the OpenAI API may produce.

Other Changes

  • Added ConfigurationSchema.json to the NuGet package via the MSBuild JsonSchemaSegment feature, enabling automatic JSON IntelliSense and validation for appsettings.json when configuring OpenAI clients. Provides per-client model suggestions and OpenAI-specific options, composing with System.ClientModel's base credential and pipeline definitions.

Breaking Changes in Preview APIs

  • OpenAI.Containers:
    • Renamed the Bytes property of ContainerFileResource to SizeInBytes and changed its type from int to long?.
  • OpenAI.Conversations:
    • Renamed the MessageOutputTextLogprobs value of the IncludedConversationItemProperty extensible enum to MessageOutputTextLogProbabilities.
    • Changed the type of the limit parameter in the GetConversationItems and GetConversationItemsAsync protocol methods from long? to int?.
  • OpenAI.Files:
    • Changed the type of the limit parameter in the GetFiles and GetFilesAsync protocol methods from long? to int?.
  • OpenAI.Responses:
    • Changed the type of the InputImageUri property of ResponseContentPart from Uri to string.
    • Changed the type of the ImageUri property of ImageGenerationToolInputImageMask from Uri to string.
  • OpenAI.VectorStores:
    • Renamed the Size property of VectorStoreFile to UsageInBytes and changes its type from int to long?.
  • OpenAI.Videos:
    • Changed the type of the limit parameter in the GetVideo and GetVideosAsync protocol methods from long? to int?.

2.9.1 (2026-03-02)

Features Added

  • OpenAI.Responses:
    • Added InputFileUri property and CreateInputFilePart(Uri) factory method to ResponseContentPart to support file URL inputs.

Bugs Fixed

  • Fixed an issue where Microsoft.SourceLink.GitHub was inadvertently included as a runtime dependency of the package, causing downstream build failures with "Source control information is not available" errors. The package is now correctly treated as a build-only dependency.
  • OpenAI.Chat:
    • Fixed an issue where JsonPatch customizations applied to ChatCompletionOptions were lost when the options were cloned internally before an API call.

2.9.0 (2026-02-27)

Acknowledgments

Thank you to our developer community members who helped to make the OpenAI client library better with their contributions to this release:

Features Added

  • OpenAI.Audio:
    • Added support for AudioClient configuration and dependency injection via the new AudioClientSettings class.
  • OpenAI.Batch:
    • Added support for BatchClient configuration and dependency injection via the new BatchClientSettings class.
  • OpenAI.Chat:
    • Added support for ChatClient configuration and dependency injection via the new ChatClientSettings class.
    • Added value of None to ChatReasoningEffortLevel enum to allow opting out of reasoning.
  • OpenAI.Containers:
    • Added support for ContainerClient configuration and dependency injection via the new ContainerClientSettings class.
  • OpenAI.Conversations:
    • Added support for ConversationClient configuration and dependency injection via the new ConversationClientSettings class.
  • OpenAI.Embeddings:
    • Added support for EmbeddingClient configuration and dependency injection via the new EmbeddingClientSettings class.
  • OpenAI.Evals:
    • Added support for EvaluationClient configuration and dependency injection via the new EvaluationClientSettings class.
  • OpenAI.Files:
    • Added support for OpenAIFileClient configuration and dependency injection via the new OpenAIFileClientSettings class.
    • Added support for retrieving files using pagination via new overloads of the GetFiles and GetFilesAsync methods in the OpenAIFileClient.
  • OpenAI.FineTuning:
    • Added support for FineTuningClient configuration and dependency injection via the new FineTuningClientSettings class.
  • OpenAI.Graders:
    • Added support for GraderClient configuration and dependency injection via the new GraderClientSettings class.
  • OpenAI.Images:
    • Added support for ImageClient configuration and dependency injection via the new ImageClientSettings class.
    • Added value of HighQuality to GeneratedImageQuality enum to allow generating higher quality images.
    • Added InputFidelity property to ImageEditOptions to control how closely distinctive features from the input are preserved.
    • Added OutputCompressionFactor property to ImageEditOptions to set the compression level (0-100%) for jpeg or webp outputs.
    • Added OutputFileFormat property to ImageEditOptions to set the file format in which the generated images are returned.
    • Added Background property to GeneratedImageCollection.
    • Added OutputFileFormat property to GeneratedImageCollection.
    • Added Quality property to GeneratedImageCollection.
    • Added Size property to GeneratedImageCollection.
  • OpenAI.Models:
    • Added support for OpenAIModelClient configuration and dependency injection via the new OpenAIModelClientSettings class.
  • OpenAI.Moderations:
    • Added support for ModerationClient configuration and dependency injection via the new ModerationClientSettings class.
    • Added support for classifying multi-modal inputs via new ClassifyInputs and ClassifyInputsAsync methods in the ModerationClient.
      • Use the new ModerationInputPart class to create text or image inputs for classification.
      • Use the new ApplicableInputKinds property of the ModerationCategory class to understand to which parts of the input the moderation results apply.
  • OpenAI.Realtime:
    • Added support for the stable version of the Realtime REST API.
    • Added support for RealtimeClient configuration and dependency injection via the new RealtimeClientSettings class.
    • Added support for integrating with remote MCP servers.
      • Users can add the new RealtimeMcpTool to the Tools property of their RealtimeConversationSessionOptions and configure it.
        • Use the AllowedTools property to limit which of the server tools can be called by the model.
        • Use the ToolCallApprovalPolicy property to specify which tools require an explicit approval before being called by the model.
        • Use the AuthorizationToken property to specify the access token to used when authenticating with the remote MCP server.
        • Use the ConnectorId property to use the OpenAI-maintained MCP wrappers for popular services like Microsoft Outlook or Dropbox.
    • Added a new RealtimeClientCommand class that represents client events to be used with the new SendCommand and SendCommandAsync overloads in the RealtimeSessionClient and exposed all supported client events as derived types:
      • RealtimeClientCommandConversationItemCreate
      • RealtimeClientCommandConversationItemDelete
      • RealtimeClientCommandConversationItemRetrieve
      • RealtimeClientCommandConversationItemTruncate
      • RealtimeClientCommandInputAudioBufferAppend
      • RealtimeClientCommandInputAudioBufferClear
      • RealtimeClientCommandInputAudioBufferCommit
      • RealtimeClientCommandOutputAudioBufferClear
      • RealtimeClientCommandResponseCancel
      • RealtimeClientCommandResponseCreate
      • RealtimeClientCommandSessionUpdate
    • Added support for System.Client.Model's JsonPatch, which enables users to get and set additional JSON properties in response and request payloads.
  • OpenAI.Responses:
    • Added support for ResponsesClient configuration and dependency injection via the new ResponsesClientSettings class.
    • Added support for compacting conversations via the new CompactResponse and CompactResponseAsync protocol methods in the ResponsesClient.
    • Added support for returning the number of input tokens that a Response would consume via the new GetInputTokenCount and GetInputTokenCountAsync protocol methods in the ResponsesClient.
    • Added value of None to ResponseReasoningEffortLevel enum to allow opting out of reasoning.
    • Added InputImageUri property to ResponseContentPart to manage image inputs as URIs.
    • Added implicit conversion operators to McpToolCallApprovalPolicy to facilitate its assignment.
  • OpenAI.VectorStores:
    • Added support for VectorStoreClient configuration and dependency injection via the new VectorStoreClientSettings class.
  • OpenAI.Videos:
    • Added support for VideoClient configuration and dependency injection via the new VideoClientSettings class.

Bugs Fixed

  • OpenAI.Chat:
    • Fixed a concurrency issue corrupting the state of the ChatCompletionOptions argument when the same instance was passed into concurrent calls of CompleteChat/CompleteChatAsync and/or CompleteChatStreaming/CompleteChatStreamingAsync.
  • OpenAI.Realtime:
    • Fixed an issue causing permanent state corruption when sending audio was cancelled in RealtimeSessionClient.
    • Fixed an issue with RealtimeSessionClient always requiring an API key.
  • OpenAI.Responses:
    • Fixed a concurrency issue corrupting the state of the CreateResponseOptions argument when the same instance was passed into concurrent calls of CreateResponse/CreateResponseAsync and/or CreateResponseStreaming/CreateResponseStreamingAsync.

Other Changes

Breaking Changes in Preview APIs

  • OpenAI.Images:
    • Changed the type of the InputTokenCount, OutputTokenCount, and TotalTokenCount properties of ImageTokenUsage from int to long.
  • OpenAI.Realtime:
    • This release migrates the implementation of the Realtime API from the beta REST API to the GA REST API. As such, it contains numerous breaking changes, including the following:
      • Renamed RealtimeSession to RealtimeSessionClient.
      • Renamed ConversationTool to RealtimeTool and exposed all supported tools as derived types:
        • RealtimeFunctionTool
        • RealtimeMcpTool
      • Changed RealtimeItem into a class hierarchy and exposed all supported item types as derived types:
        • RealtimeMessageItem
        • RealtimeFunctionCallItem
        • RealtimeFunctionCallOutputItem
        • RealtimeMcpToolCallItem
        • RealtimeMcpToolDefinitionListItem
        • RealtimeMcpToolCallApprovalRequestItem
        • RealtimeMcpToolCallApprovalResponseItem
      • Renamed RealtimeUpdate to RealtimeServerUpdate and exposed all supported server events as derived types:
        • RealtimeServerUpdateConversationCreated
        • RealtimeServerUpdateConversationItemAdded
        • RealtimeServerUpdateConversationItemCreated
        • RealtimeServerUpdateConversationItemDeleted
        • RealtimeServerUpdateConversationItemDone
        • RealtimeServerUpdateConversationItemInputAudioTranscriptionCompleted
        • RealtimeServerUpdateConversationItemInputAudioTranscriptionDelta
        • RealtimeServerUpdateConversationItemInputAudioTranscriptionFailed
        • RealtimeServerUpdateConversationItemInputAudioTranscriptionSegment
        • RealtimeServerUpdateConversationItemRetrieved
        • RealtimeServerUpdateConversationItemTruncated
        • RealtimeServerUpdateError
        • RealtimeServerUpdateInputAudioBufferCleared
        • RealtimeServerUpdateInputAudioBufferCommitted
        • RealtimeServerUpdateInputAudioBufferDtmfEventReceived
        • RealtimeServerUpdateInputAudioBufferSpeechStarted
        • RealtimeServerUpdateInputAudioBufferSpeechStopped
        • RealtimeServerUpdateInputAudioBufferTimeoutTriggered
        • RealtimeServerUpdateMcpListToolsCompleted
        • RealtimeServerUpdateMcpListToolsFailed
        • RealtimeServerUpdateMcpListToolsInProgress
        • RealtimeServerUpdateOutputAudioBufferCleared
        • RealtimeServerUpdateOutputAudioBufferStarted
        • RealtimeServerUpdateOutputAudioBufferStopped
        • RealtimeServerUpdateRateLimitsUpdated
        • RealtimeServerUpdateResponseContentPartAdded
        • RealtimeServerUpdateResponseContentPartDone
        • RealtimeServerUpdateResponseCreated
        • RealtimeServerUpdateResponseDone
        • RealtimeServerUpdateResponseFunctionCallArgumentsDelta
        • RealtimeServerUpdateResponseFunctionCallArgumentsDone
        • RealtimeServerUpdateResponseMcpCallArgumentsDelta
        • RealtimeServerUpdateResponseMcpCallArgumentsDone
        • RealtimeServerUpdateResponseMcpCallCompleted
        • RealtimeServerUpdateResponseMcpCallFailed
        • RealtimeServerUpdateResponseMcpCallInProgress
        • RealtimeServerUpdateResponseOutputAudioDelta
        • RealtimeServerUpdateResponseOutputAudioDone
        • RealtimeServerUpdateResponseOutputAudioTranscriptDelta
        • RealtimeServerUpdateResponseOutputAudioTranscriptDone
        • RealtimeServerUpdateResponseOutputItemAdded
        • RealtimeServerUpdateResponseOutputItemDone
        • RealtimeServerUpdateResponseOutputTextDelta
        • RealtimeServerUpdateResponseOutputTextDone
        • RealtimeServerUpdateSessionCreated
        • RealtimeServerUpdateSessionUpdated
    • We recommend checking out our examples and tests as well as the migration guide for tips on how to use the new API surface.
  • OpenAI.Responses:
    • Removed the Model property of the ResponsesClient in favor of specifying the model on a per-call basis when calling CreateResponse/CreateResponseAsync or CreateResponseStreaming/CreateResponseStreamingAsync. To do this, set the Model property of the CreateResponseOptions parameter. With this change, users no longer have to provide a model unless it is actually needed.
    • Changed the type of the Instructions property of ResponseResult from string to IList<ResponseItem> to handle multi-item instructions.

2.8.0 (2025-12-11)

Features Added

  • OpenAI.Chat:
    • Added the SafetyIdentifier property to ChatCompletionOptions, which enables users to specify a stable identifier that can be used to help detect end-users of their application that may be violating OpenAI's usage policies.
  • OpenAI.Responses:
    • Added the SafetyIdentifier property to CreateResponseOptions and ResponseResult, which enables users to specify a stable identifier that can be used to help detect end-users of their application that may be violating OpenAI's usage policies.
    • Added the ConversationOptions property to CreateResponseOptions and ResponseResult, which enables users to automatically manage the state of a conversation in a multi-turn interaction by persisting state and sharing context across subsequent responses, rather than having to chain multiple response items together.
    • Added the MaxToolCallCount property to CreateResponseOptions and ResponseResult, which enables users to set the maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored.
    • Added the TopLogProbabilityCount property to CreateResponseOptions and ResponseResult, which enables users to specify the number of most likely tokens to return at each token position, each with an associated log probability.
    • Added the IncludedProperties property to CreateResponseOptions, which enables users to specify additional output data to be included in the model response.
    • Added a setter to the Id property of ResponseItem.
    • Added a setter to the Status property of the types derived from ResponseItem.

Breaking Changes in Preview APIs

  • OpenAI.Responses:
    • Until now, this feature area has been marked as experimental via the [Experimental] attribute. As we prepare to stabilize it and remove its experimental designation, we are cleaning up the APIs to better align them with the service REST APIs, as well as to offer more flexibility and improve usability. See our examples for helpful references on how to use the updated APIs.
      • The OpenAIResponseClient class has been renamed to ResponsesClient.
      • The ResponseCreationOptions class has been renamed to CreateResponseOptions.
      • The OpenAIResponse class has been renamed to ResponseResult.
      • When calling the CreateResponse, CreateResponseAsync, CreateResponseStreaming and CreateResponseStreamingAsync methods of the ResponsesClient with a CreateResponseOptions argument, the input items must now be specified via the new InputItems property of CreateResponseOptions.
      • When calling the CreateResponseStreaming and CreateResponseStreamingAsync methods of the ResponsesClient with a CreateResponseOptions argument, the StreamingEnabled property of CreateResponseOptions must be set to true.
      • The OpenAIResponsesModelFactory class used for mocking output models (e.g., ResponseResult, ResponseTokenUsage, etc.) has been removed in favor of adding setters to the properties of these models.

2.7.0 (2025-11-13)

Acknowledgments

Thank you to our developer community members who helped to make the OpenAI client library better with their contributions to this release:

Features Added

  • OpenAI.Responses:
    • Enabled support for stable web search via the WebSearchTool class, with a separate WebSearchPreviewTool class for preview web search features.
    • Added Filename property to FileCitationMessageAnnotation to provide the name of the cited file.
    • Exposed reasoning streaming events, including:
      • StreamingResponseReasoningTextDeltaUpdate and StreamingResponseReasoningTextDoneUpdate for reasoning text events.
      • StreamingResponseReasoningSummaryPartAddedUpdate and StreamingResponseReasoningSummaryPartDoneUpdate for reasoning summary part events.
      • StreamingResponseReasoningSummaryTextDeltaUpdate and StreamingResponseReasoningSummaryTextDoneUpdate for reasoning summary text events.

Bugs Fixed

  • OpenAI.Assistants:
    • Fixed an issue with custom serialization for MessageCreationAttachment that prevented proper handling of file attachments in message creation. (A community contribution, courtesy of BenjaminDavidPinter)
  • OpenAI.Responses:
    • Fixed the generated serialization name of partial_image_b64 in StreamingResponseImageGenerationCallPartialImageUpdate to ensure correct serialization of partial image data in streaming responses.
    • Fixed serialization issues with Patch properties by adding the JsonIgnore attribute, preventing System.InvalidOperationException when using JsonSerializer without the custom converter.

Other Changes

  • Updated the System.ClientModel dependency to version 1.8.1 to adopt bug fixes for JSON Patch. For more context, see the System.ClientModel ChangeLog

2.6.0 (2025-10-31)

Acknowledgments

Thank you to our developer community members who helped to make the OpenAI client library better with their contributions to this release:

Features Added

  • OpenAI.Chat:
    • Added the Minimal property to ChatReasoningEffortLevel. (A community contribution, courtesy of kurnakovv)
    • Added support for System.Client.Model's JsonPatch, which enables users to get and set additional JSON properties in response and request payloads.
  • OpenAI.Conversations:
    • Introduced the new ConversationClient to support the Conversations API with protocol methods for the following operations:
      • CreateConversation and CreateConversationAsync
      • GetConversation and GetConversationAsync
      • UpdateConversation and UpdateConversationAsync
      • DeleteConversation and DeleteConversationAsync
      • CreateConversationItems and CreateConversationItemsAsync
      • GetConversationItems and GetConversationItemsAsync
      • DeleteConversationItem and DeleteConversationItemAsync
  • OpenAI.Embeddings:
    • Added support for System.Client.Model's JsonPatch, which enables users to get and set additional JSON properties in response and request payloads.
      • Go to the OpenAI.Chat and OpenAI.Responses section in this changelog for examples that can be extrapolated to Embeddings.
  • OpenAI.Responses:
    • Added the Minimal property to ResponseReasoningEffortLevel. (A community contribution, courtesy of kurnakovv)
    • Added the ContainerFileCitationMessageAnnotation class which is derived from ResponseMessageAnnotation and is used to cite files in the container of the Code Interpreter tool.
    • Enabled support for the Image Generation tool, which can be used to generate images using models like gpt-image-1.
      • Users can add the new ImageGenerationTool to the Tools property of their ResponseCreationOptions and configure it using properties such as Background, Quality, Size, and more.
    • Added support for System.Client.Model's JsonPatch, which enables users to get and set additional JSON properties in response and request payloads.
  • OpenAI.Videos:
    • Introduced the new VideoClient to support the Videos API with protocol methods for the following operations:
      • CreateVideo and CreateVideoAsync
      • GetVideo and GetVideoAsync
      • DeleteVideo and DeleteVideoAsync
      • DownloadVideo and DownloadVideoAsync
      • GetVideos and GetVideosAsync
      • CreateVideoRemix and GetVideoRemixAsync

Bugs Fixed

  • OpenAI.Audio:
    • Added the explicit conversion operators from ClientResult that were missing in the AudioTranscription and AudioTranslation classes.
  • OpenAI.Chat:
    • Added the ContentParts property that was missing in the ChatCompletionMessageListDatum class.

Breaking Changes in Preview APIs

  • OpenAI.Containers:
    • Renamed the GetContainerFileContent and GetContainerFileContentAsync methods of ContainerClient to DownloadContainerFile and DownloadContainerFileAsync.
  • OpenAI.Responses:
    • Removed the duplicated GetInputItems and GetInputItemsAsync methods of the OpenAIResponseClient in favor of the existing GetResponseInputItems and GetResponseInputItemsAsync methods.

2.5.0 (2025-09-23)

Acknowledgments

Thank you to our developer community members who helped to make the OpenAI client library better with their contributions to this release:

Features Added

  • OpenAI.Responses:
    • Added the Model property to OpenAIResponseClient. (A community contribution, courtesy of BenjaminDavidPinter)
    • Added the ServiceDescription property to McpTool.
    • Enabled support for connectors, which are OpenAI-maintained MCP wrappers for popular services like Microsoft Outlook or Dropbox.
      • Added the ConnectorId property to McpTool.
    • Enabled support for authentication with remote MCP servers.
      • Added the AuthorizationToken property to McpTool.
    • Enabled support for the Code Interpreter tool, which allows models to write and run Python code in a sandboxed environment to solve complex problems in domains like data analysis, coding, and math.
      • Users can add the new CodeInterpreterTool to the Tools property of their ResponseCreationOptions and configure it.
        • Use the Container property to configure the sandboxed environment, including any files that should be made available.

Bugs Fixed

  • OpenAI.Responses:
    • Fixed an issue with the constructor of McpToolCallApprovalRequestItem not taking the item ID as a parameter. MCP approval requests are correlated to MCP approval responses using this ID, which implies that this ID should be required.
    • Fixed an issue with some of the MCP-related StreamingResponseUpdate classes missing the ItemId and OutputIndex properties.

2.4.0 (2025-09-05)

Features Added

  • OpenAI.Audio:
    • Added the Endpoint property to AudioClient.
  • OpenAI.Batch:
    • Added the Endpoint property to BatchClient.
  • OpenAI.Chat:
    • Added the Endpoint property to ChatClient.
    • Added the ServiceTier property to ChatCompletionOptions, ChatCompletion, and StreamingChatCompletionUpdate to configure the policy that the server will use to process the request in terms of pricing, performance, etc.
    • Added an explicit conversion operator to ChatCompletion and ChatCompletionDeletionResult to convert from ClientResult.
  • OpenAI.Containers:
    • Added the Endpoint property to ContainerClient.
    • Added convenience counterparts to the protocol methods of ContainerClient that use the strongly-typed model classes.
    • Added automatic pagination support to the following methods of ContainerClient:
      • GetContainers and GetContainersAsync
      • GetContainerFiles and GetContainerFilesAsync
    • Added an explicit conversion operator to ContainerResource, ContainerFileResource, DeleteContainerResponse, and DeleteContainerFileResponse to convert from ClientResult.
  • OpenAI.Embeddings:
    • Added the Endpoint property to EmbeddingsClient.
    • Added an explicit conversion operator to OpenAIEmbeddingCollection to convert from ClientResult.
  • OpenAI.Evals:
    • Added the Endpoint property to EvaluationClient.
  • OpenAI.Files:
    • Added the Endpoint property to OpenAIFileClient.
    • Added an explicit conversion operator to OpenAIFile, OpenAIFileCollection, and FileDeletionResult to convert from ClientResult.
  • OpenAI.FineTuning:
    • Added the Endpoint property to FineTuningClient.
  • OpenAI.Graders:
    • Added the Endpoint property to GraderClient.
    • Added an explicit conversion operator to RunGraderResponse and ValidateGraderResponse to convert from ClientResult.
  • OpenAI.Images:
    • Added the Endpoint property to ImageClient.
    • Added an explicit conversion operator to GeneratedImageCollection to convert from ClientResult.
    • Added the Background property to ImageEditOptions to set transparency for the background of the generated image(s).
    • Added the Quality property to ImageEditOptions to set the quality of the generated image(s).
  • OpenAI.Images:
    • Added the Endpoint property to ImageClient.
    • Added an explicit conversion operator to GeneratedImageCollection to convert from ClientResult.
    • Added the Background property to ImageEditOptions to set transparency for the background of the generated image(s).
    • Added the Quality property to ImageEditOptions to set the quality of the generated image(s).
  • OpenAI.Models:
    • Added the Endpoint property to OpenAIModelClient.
    • Added an explicit conversion operator to OpenAIModel, OpenAIModelCollection, and ModelDeletionResult to convert from ClientResult.
  • OpenAI.Moderations:
    • Added the Endpoint property to ModerationClient.
    • Added an explicit conversion operator to ModerationResultCollection to convert from ClientResult.
  • OpenAI.Realtime:
    • Added a constructor that can take a string API key to RealtimeClient.
    • Added constructors that can take a custom AuthenticationPolicy to RealtimeClient.
    • Added the Endpoint property to RealtimeClient.
    • Replaced the RequestOptions parameter of the following methods of RealtimeClient for a new RealtimeSessionOptions parameter and a CancellationToken parameter:
      • StartConversationSession and StartConversationSessionAsync
      • StartTranscriptionSession and StartTranscriptionSessionAsync
      • StartSession and StartSessionAsync
  • OpenAI.Responses:
    • Added the Endpoint property to OpenAIResponseClient.
    • Added an explicit conversion operator to OpenAIResponse to convert from ClientResult.
    • Added new classes derived from ResponseTool to facilitate certain scenarios:
      • FunctionTool
      • FileSearchTool
      • WebSearchTool
      • ComputerTool
    • Added initial support for integrating with remote MCP servers via the Responses API in streaming and non-streaming scenarios.
      • Users can add the new McpTool to the Tools property of their ResponseCreationOptions and configure it.
        • Use the AllowedTools property to limit which of the server tools can be called by the model.
        • Use the ToolCallApprovalPolicy property to specify which tools require an explicit approval before being called by the model.
      • Support for selecting the McpTool via the ToolChoice property is coming soon.
      • Support for configuring the McpTool with an access token that can be used to authenticate with the remote MCP server is coming soon.
      • Support for connectors is coming soon.
    • Added new classes derived from ResponseMessageAnnotation to facilitate certain scenarios:
      • FileCitationMessageAnnotation
      • FilePathMessageAnnotation
      • UriCitationMessageAnnotation
    • Added the ServiceTier property to ResponseCreationOptions, OpenAIResponse, and StreamingChatCompletionUpdate to configure the policy that the server will use to process the request in terms of pricing, performance, etc.
  • OpenAI.VectorStores:
    • Added the Endpoint property to OpenAIResponseClient.
    • Added an explicit conversion operator to VectorStore, VectorStoreFile, VectorStoreFileBatch, VectorStoreDeletionResult, and FileFromStoreRemovalResult to convert from ClientResult.

Bug Fixed

  • OpenAI.Realtime:
    • Fixed an issue with the classes derived from ResponseItem (such as ReasoningResponseItem) missing some constructors or property setters, which made it difficult to use them as inputs.
    • Fixed an issue with the HTTP pipeline of the RealtimeClient that was preventing the following methods from working correctly:
      • CreateEphemeralToken and CreateEphemeralTokenAsync
      • CreateEphemeralTranscriptionToken and CreateEphemeralTranscriptionTokenAsync

Breaking Changes in Preview APIs

  • OpenAI.Chat:
    • Changed the type of the options parameter of the GetChatCompletionMessages method of the ChatClient from ChatCompletionCollectionOptions to ChatCompletionMessageCollectionOptions.
  • OpenAI.Realtime:
    • Replaced the RequestOptions parameter for a new RealtimeSessionOptions parameter and a CancellationToken parameter.
  • OpenAI.Responses:
    • Renamed the Background property to BackgroundModeEnabled for clarity.
    • Renamed the ComputerOutput class to ComputerCallOutput.
    • Changed the type of the Delta property of StreamingResponseFunctionCallArgumentsDeltaUpdate from string to BinaryData.
    • Changed the type of the Arguments property of StreamingResponseFunctionCallArgumentsDoneUpdate from string to BinaryData and renamed it to FunctionArguments.
    • Renamed the WebSearchContextSize class to WebSearchToolContextSize.
    • Renamed the WebSearchUserLocation class to WebSearchToolLocation.
    • Refactored the factory methods of ResponseItem.
    • Refactored the factory methods of ResponseTool.
    • Removed the properties of ResponseMessageAnnotation except for the Kind property and moved them to the new derived types.
  • OpenAI.VectorStores:
    • Removed the OperationResult pattern along with the CreateVectorStoreOperation AddFileToVectorStoreOperation, and CreateBatchFileJobOperation classes.
    • Renamed the VectorStoreBatchFileJob class to VectorStoreFileBatch
    • Renamed the VectorStoreFileAssociation class to VectorStoreFile
    • Renamed the VectorStoreFileAssociationError class to VectorStoreFileError
    • Renamed the VectorStoreFileAssociationStatus class to VectorStoreFileStatus
    • Renamed the VectorStoreFileAssociationErrorCode class to VectorStoreFileErrorCode
    • Renamed the VectorStoreFileAssociationCollectionOptions class to VectorStoreFileCollectionOptions
    • Renamed the VectorStoreFileAssociationCollectionOrder class to VectorStoreFileCollectionOrder
    • Renamed the CancelBatchFileJob and CancelBatchFileJobAsync methods of VectorStoreClient to CancelVectorStoreFileBatch and CancelVectorStoreFileBatchAsync
    • Renamed the CreateBatchFileJob and CreateBatchFileJobAsync methods of VectorStoreClient to AddFileBatchToVectorStore and AddFileBatchToVectorStoreAsync
    • Renamed the GetBatchFileJob and GetBatchFileJobAsync methods of VectorStoreClient to GetVectorStoreFileBatch and GetVectorStoreFileBatchAsync
    • Renamed the GetFileAssociation and GetFileAssociationAsync methods of VectorStoreClient to GetVectorStoreFile and GetVectorStoreFileAsync
    • Renamed the GetFileAssociations and GetFileAssociationsAsync methods of VectorStoreClient to GetVectorStoreFiles and GetVectorStoreFilesAsync
    • Renamed the GetFileAssociationsInBatch and GetFileAssociationsInBatchAsync methods of VectorStoreClient to GetVectorStoreFilesInBatch and GetVectorStoreFilesInBatchAsync
    • Renamed the RemoveFileFromStore and RemoveFileFromStoreAsync methods of VectorStoreClient to RemoveFileFromVectorStore and RemoveFileFromVectorStoreAsync

Other Changes

  • Updated the System.ClientModel dependency to version 1.6.1.

2.3.0 (2025-08-01)

Features Added

  • OpenAI.Audio:
    • Added the Model property to AudioClient.
    • Added constructors that can take a custom AuthenticationPolicy to AudioClient.
  • OpenAI.Batch:
    • Added new methods to BatchClient:
      • GetBatch and GetBatchAsync
    • Added constructors that can take a custom AuthenticationPolicy to BatchClient.
  • OpenAI.Chat:
    • Added new methods to ChatClient:
      • UpdateChatCompletion and UpdateChatCompletionAsync
      • GetChatCompletions and GetChatCompletionsAsync
      • GetChatCompletionMessages and GetChatCompletionMessagesAsync
    • Added the Model property to ChatClient.
    • Added constructors that can take a custom AuthenticationPolicy to ChatClient.
  • OpenAI.Containers:
    • Introduced the new ContainersClient to support the Containers API with protocol methods for the following operations:
      • CreateContainer and CreateContainerAsync
      • GetContainers and GetContainersAsync
      • GetContainer and GetContainerAsync
      • DeleteContainer and DeleteContainerAsync
      • CreateContainerFile and CreateContainerFileAsync
      • GetContainerFiles and GetContainerFilesAsync
      • GetContainerFile and GetContainerFileAsync
      • GetContainerFileContent and GetContainerFileContentAsync
      • DeleteContainerFile and DeleteContainerFileAsync
  • OpenAI.Embeddings:
    • Added the Model property to EmbeddingClient.
    • Added constructors that can take a custom AuthenticationPolicy to EmbeddingClient.
  • OpenAI.Evals:
    • Added constructors that can take a custom AuthenticationPolicy to EvaluationClient.
  • OpenAI.Files:
    • Added constructors that can take a custom AuthenticationPolicy to OpenAIFileClient.
  • OpenAI.FineTuning:
    • Added constructors that can take a custom AuthenticationPolicy to FineTuningClient.
  • OpenAI.Graders:
    • Introduced the new GraderClient to support the Graders API with protocol methods for the following operations:
      • RunGrader and RunGraderAsync
      • ValidateGrader and ValidateGraderAsync
  • OpenAI.Images:
    • Added the Model property to ImageClient.
    • Added constructors that can take a custom AuthenticationPolicy to ImageClient.
  • OpenAI.Models:
    • Added constructors that can take a custom AuthenticationPolicy to OpenAIModelClient.
  • OpenAI.Moderations:
    • Added the Model property to ModerationClient.
    • Added constructors that can take a custom AuthenticationPolicy to ModerationClient.
  • OpenAI.Realtime:
    • Enabled support for semantic voice activity detection (VAD) via the new CreateSemanticVoiceActivityTurnDetectionOptions method of TurnDetectionOptions.
  • OpenAI.Responses:
    • Added a model factory.
    • Added constructors that can take a custom AuthenticationPolicy to OpenAIResponseClient.
  • OpenAI.VectorStores:
    • Added constructors that can take a custom AuthenticationPolicy to VectorStoreClient.

Bug Fixed

  • OpenAI.Assistants:
    • Fixed an issue causing the ImageDetail property of MessageContent to not be serialized correctly.
  • OpenAI.Audio:
    • Added a check to all overloads of TranscribeAudioStreaming and TranscribeAudioStreamingAsync in the AudioClient to prevent using the whisper-1 model, which does not support streaming and simply ignores the stream parameter.
  • OpenAI.Realtime:
    • Improved the disposal logic in AsyncWebsocketMessageResultEnumerator to prevent multiple disposals.
  • OpenAI.Responses:
    • Fixed an issue in code generation that caused the StreamingResponseTextAnnotationAddedUpdate class to not be generated correctly as part of the set of possible handles when streaming.
    • Fixed an issue in code generation that caused the Status property of ReasoningResponseItem and the ReasoningStatus enum to not be generated correctly and lead to incorrect behavior.

Other Changes

  • The OpenAI NuGet package now contains signed binaries.
  • Updated the System.ClientModel dependency to version 1.5.1, which contains a fix for a concurrency bug which could cause some applications running on the legacy .NET Framework to experience an infinite loop while deserializing service responses.
  • Removed the explicit net6.0 target framework, as this version reached end-of-life in November 2024 and is no longer maintained nor supported by Microsoft. This does not prevent using the OpenAI library on .NET 6, as the runtime will fallback to the netstandard2.0 target.

2.2.0 (2025-07-02)

Features Added

  • OpenAI.Audio:
    • Enabled support for streaming audio transcriptions:
      • Added new methods to AudioClient:
        • TranscribeAudioStreaming and TranscribeAudioStreamingAsync
      • Added new types of StreamingAudioTranscriptionUpdate to work with streaming transcriptions:
        • StreamingAudioTranscriptionTextDeltaUpdate
        • StreamingAudioTranscriptionTextDoneUpdate
    • Added the TranscriptionTokenLogProbabilities property to AudioTranscription to represent token-level log probability information.
    • Added the AudioTranscriptionIncludes enum and Includes property to AudioTranscriptionOptions to request additional information in the transcription response.
    • Added new voices to GeneratedSpeechVoice.
    • Added the Instructions property to SpeechGenerationOptions to control the voice of the generated audio with additional instructions.
  • OpenAI.Batch:
    • Added new Rehydrate method overloads that receive a batch ID instead of rehydration token.
  • OpenAI.Chat:
    • Added new methods to ChatClient:
      • DeleteChatCompletion and DeleteChatCompletionAsync
      • GetChatCompletion and GetChatCompletionAsync
    • Added Aac format to ChatOutputAudioFormat.
    • Added new voices to ChatOutputAudioVoice.
  • OpenAI.Evals:
    • Introduced the new EvaluationClient to support the Evaluations API with protocol methods for the following operations:
      • CreateEvaluation and CreateEvaluationAsync
      • GetEvaluation and GetEvaluationAsync
      • GetEvaluations and GetEvaluationsAsync
      • UpdateEvaluation and UpdateEvaluationAsync
      • DeleteEvaluation and DeleteEvaluationAsync
      • CreateEvaluationRun and CreateEvaluationRunAsync
      • GetEvaluationRun and GetEvaluationRunAsync
      • GetEvaluationRuns and GetEvaluationRunsAsync
      • CancelEvaluationRun and CancelEvaluationRunAsync
      • DeleteEvaluationRun and DeleteEvaluationRunAsync
      • GetEvaluationRunOutputItem and GetEvaluationRunOutputItemAsync
      • GetEvaluationRunOutputItems and GetEvaluationRunOutputItemsAsync
  • OpenAI.FineTuning:
    • Added new methods to FineTuningClient:
      • GetFineTuningCheckpointPermissions and GetFineTuningCheckpointPermissionsAsync
      • CreateFineTuningCheckpointPermission and CreateFineTuningCheckpointPermissionAsync
      • DeleteFineTuningCheckpointPermission and DeleteFineTuningCheckpointPermission
      • PauseFineTuningJob and PauseFineTuningJobAsync
      • ResumeFineTuningJob and ResumeFineTuningJobAsync
    • Added new experimental types to support fine-tuning workflows.
  • OpenAI.Images:
    • Added the Usage property to GeneratedImageCollection to represent image token usage information.
    • Added the Background property to ImageGenerationOptions to set transparency for the background of the generated image(s).
    • Added the ModerationLevel property to ImageGenerationOptions to control the content-moderation level for generated image(s).
    • Added the OutputCompressionFactor property to ImageGenerationOptions to set the compression level (0-100%) for the generated images.
    • Added the OutputFileFormat property to ImageGenerationOptions to set the file format in which the generated images are returned.
    • Added support for new values to the GeneratedImageSize enum.
  • OpenAI.Responses:
    • Added new methods to the OpenAIResponseClient:
      • CancelResponse and CancelResponseAsync
      • GetResponseStreaming and GetResponseStreamingAsync.
    • Added Linux property to ComputerToolEnvironment.
    • Added Background property to ResponseCreationOptions to support background mode.
    • Added SequenceNumber property to StreamingResponseUpdate to support background mode while streaming.
    • Added InputTokenDetails property to ResponseTokenUsage to represent token usage information.
    • Added EncryptedContent property to ReasoningResponseItem to represent the encrypted content of the reasoning item.
  • OpenAI.VectorStores:
    • Added new methods to VectorStoreClient:
      • RetrieveVectorStoreFileContent and RetrieveVectorStoreFileContentAsync
      • SearchVectorStore and SearchVectorStoreAsync
      • UpdateVectorStoreFileAttributes and UpdateVectorStoreFileAttributesAsync

Bugs Fixed

  • OpenAI.Files:
    • Added a SizeInBytesLong property to OpenAIFile to correctly represent the size of a file.
  • OpenAI.Responses:
    • Fixed an issue where setting the ReasoningSummaryVerbosity property of ResponseReasoningOptions was sending the wrong property to the service.
    • Fixed an issue with the CreateInputFilePart method of ResponseContentPart not being able to send files as BinaryData.

Breaking Changes in Preview APIs

  • Removed the implicit operator from all models that converts a model to BinaryContent.
  • Removed the explicit operator from all models that converts a ClientResult to a model.
  • OpenAI:
    • Renamed the GetRealtimeConversationClient method from OpenAIClient to GetRealtimeClient.
  • OpenAI.FineTuning:
    • Renamed the FineTuningJobOperation class to FineTuningJob.
    • Removed protocol methods for CreateFineTuningJob, GetJob, and GetJobs and added convenience methods for them.
  • OpenAI.Realtime:
    • Updated namespace from OpenAI.Conversations to OpenAI.Realtime. All APIs and types related to real-time conversations have been moved to the new OpenAI.Realtime namespace.
  • OpenAI.Responses:
    • Removed the SummaryTextParts property of ReasoningResponseItem in favor a new property called SummaryParts.
    • Removed the following public constructors:
      • FileSearchCallResponseItem(IEnumerable<string> queries, IEnumerable<FileSearchCallResult> results)
      • FunctionCallOutputResponseItem(string callId, string functionOutput)
      • FunctionCallResponseItem(string callId, string functionName, BinaryData functionArguments)
    • Made several properties read-only that were previously settable:
      • CallId and Output in ComputerCallOutputResponseItem
      • Action, CallId, and Status in ComputerCallResponseItem
      • Results and Status in FileSearchCallResponseItem
      • CallId in FunctionCallOutputResponseItem
      • CallId in FunctionCallResponseItem
    • Changed the following property types:
      • Attributes in FileSearchCallResult is now IReadOnlyDictionary<string, BinaryData> instead of IDictionary<string, BinaryData>.
      • Status properties are now nullable in multiple response item types.
      • Code in ResponseError is now ResponseErrorCode instead of string.
    • Renamed the WebSearchToolContextSize extensible enum to WebSearchContextSize.
    • Renamed the WebSearchToolLocation class to WebSearchUserLocation.
  • OpenAI.VectorStores:
    • Renamed method parameters from vectorStore to options in CreateVectorStore and ModifyVectorStore methods in VectorStoreClient.

2.2.0-beta.4 (2025-03-18)

Features Added

  • OpenAI.Chat:
    • Enabled support for file inputs. When using models with vision capabilities, you can now also provide PDF files as inputs, either as a file ID or as base64-encoded data. (aaa924e)
      • Added the CreateFilePart(string fileId) and CreateFilePart(BinaryData fileBytes, string fileBytesMediaType, string filename) factory methods to ChatMessageContentPart.
  • OpenAI.Responses:
    • Added the ResponseToolChoice class to help specify which tool the model should select when generating a response. (aaa924e)

Breaking Changes in Preview APIs

  • OpenAI.Assistants:
    • Removed the default constructor and the use of the required keyword from the FileSearchRankingOptions and FunctionToolDefinition classes to align with the rest of the library. (86407c8)
  • OpenAI.RealtimeConversation:
    • Removed the default constructor and the use of the required keyword from the ConversationFunctionTool class to align with the rest of the library. (86407c8)
  • OpenAI.Responses:
    • Removed the id parameter from the factory methods of the ResponseItem class.
    • Renamed the AllowParallelToolCalls property of the ResponseCreationOptions and OpenAIResponse classes to ParallelToolCallsEnabled. (aaa924e)
    • Changed the type of the ToolChoice property of the ResponseCreationOptions and OpenAIResponseclasses from BinaryData to ResponseToolChoice. (aaa924e)
    • Changed MessageRole from an "extensible enum" to a regular enum. (aaa924e)
    • Refactored the StreamingResponse* classes. (aaa924e)
  • OpenAI.VectorStores:
    • Removed the default constructor and the use of the required keyword from the VectorStoreExpirationPolicy class to align with the rest of the library. (86407c8)

2.2.0-beta.3 (2025-03-11)

Features Added

  • OpenAI.Responses:
    • Enabled support for the new Responses API. (0ca4c06)
      • Added a new OpenAIResponseClient in a corresponding scenario namespace.
      • This release aims to bring the new Responses API to .NET as soon as possible. Details, examples, and comprehensive updates for other operations are coming soon!
  • OpenAI.Chat:
  • OpenAI.Files:
    • Enabled support for user data and evals files. (0ca4c06)

2.2.0-beta.2 (2025-02-18)

Bugs Fixed

  • OpenAI.Chat:
    • Fixed an issue that caused calls to the CompleteChatStreaming and CompleteChatStreamingAsync methods to fail with audio-enabled models unless provided a ChatCompletionOptions instance that had previously been used in a non-streaming CompleteChat or CompleteChatAsync method call. (d6615ab)
    • Fixed an issue that caused calls to the CompleteChatStreaming and CompleteChatStreamingAsync methods to not report token usage when provided a ChatCompletionOptions instance that had previously been used in a non-streaming CompleteChat or CompleteChatAsync method call. (d6615ab)
    • Fixed a series of issues with standalone serialization and deserialization of ChatCompletionOptions that impacted the ability to manipulate chat completion requests via System.ClientModel.Primitives.ModelReaderWriter and related utilities. (d6615ab)

2.2.0-beta.1 (2025-02-07)

Features Added

  • OpenAI.Audio:
    • Added explicit support for new values of GeneratedSpeechVoice. (0e0c460)
  • OpenAI.Chat:
    • Enabled support for input and output audio in chat completions using the gpt-4o-audio-preview model.
      • Added a ResponseModalities property to ChatCompletionOptions (modalities in the REST API). (0e0c460)
        • Set this flags enum property to ChatResponseModalities.Text | ChatResponseModalities.Audio in order to request output audio. Note that you need to set the new AudioOptions property too.
      • Added an AudioOptions property to ChatCompletionOptions (audio in the REST API). (0e0c460)
        • Use this property to configure the output audio voice and format.
      • Added a CreateInputAudioPart(BinaryData, ChatInputAudioFormat) static method to ChatMessageContentPart. (0e0c460)
        • Use this method to send input audio as a ChatMessageContentPart in the Content property of a UserChatMessage.
      • Added an OutputAudio property to ChatCompletion. (0e0c460)
        • Use this property to retrieve the output audio that was generated by the model.
      • Added an OutputAudioReference property to AssistantChatMessage. (0e0c460)
        • Use this property to reference the output audio of a prior ChatCompletion to continue an existing chat.
      • For more information, see the example in the README.
    • Enabled support for Predicted Outputs in chat completions using the gpt-4o and gpt-4o-mini models. Predicted Outputs can greatly improve response times when large parts of the model response are known ahead of time. This is most common when you are regenerating a file with only minor changes to most of the content.
      • Added an OutputPrediction property to ChatCompletionOptions (prediction in the REST API). (0e0c460)
        • Use this property to configure a Predicted Output. The property is of a new type called ChatOutputPrediction, which you can create via the ChatOutputPrediction.CreateStaticContentPrediction(string) or ChatOutputPrediction.CreateStaticContentPrediction(IEnumerable<ChatMessageContentPart>) static methods.
      • Added an AcceptedPredictionTokenCount property to ChatOutputTokenUsageDetails. (0e0c460)
        • When using Predicted Outputs, use this property to track the number of tokens in the prediction that appeared in the completion.
      • Added a RejectedPredictionTokenCount property to ChatOutputTokenUsageDetails. (0e0c460)
        • When using Predicted Outputs, use this property to track the number of tokens in the prediction that did not appear in the completion. Note that these tokens are still counted in the total completion tokens for purposes of billing, output, and context window limits.
    • Added a ReasoningEffortLevel property to ChatCompletionOptions (reasoning_effort in the REST API). (0e0c460)
      • Use this property to constrain the effort on reasoning for the models with reasoning capabilities (such as o3-mini and o1). Reducing the reasoning effort can result in faster responses and fewer tokens used on reasoning.
    • Added a DeveloperChatMessage class. (0e0c460)
      • Use this type of message to provide instructions that the model should follow, regardless of messages sent by the user. It replaces the existing SystemChatMessage class when using o1 and newer models.
  • OpenAI.RealtimeConversation:
    • Added explicit support for new values of ConversationVoice. (0e0c460)

Breaking Changes in Preview APIs

  • OpenAI.Assistants:
    • Removed the setters of the IDictionary<string, string> Metadata properties of the "options" classes (e.g., AssistantCreationOptions) to be able to guarantee that the collections are always initialized. (0e0c460)
      • The dictionaries remain writeable, and you can add elements to it using collection initializer syntax or the Add(TKey, TValue) method.
  • OpenAI.RealtimeConversation:
    • Renamed the InputTokens, OutputTokens, and TotalTokens properties in ConversationTokenUsage to InputTokenCount, OutputTokenCount, and TotalTokenCount, respectively. (0e0c460)
    • Renamed the AudioTokens, CachedTokens, and TextTokens properties in ConversationInputTokenUsageDetails to AudioTokenCount, CachedTokenCount, and TextTokenCount, respectively. (0e0c460)
    • Renamed the AudioTokens and TextTokens properties in ConversationOutputTokenUsageDetails to AudioTokenCount and TextTokenCount, respectively. (0e0c460)
  • OpenAI.VectorStores:
    • Removed the setters of the IDictionary<string, string> Metadata properties of the "options" classes (e.g., VectorStoreCreationOptions) to be able to guarantee that the collections are always initialized. (0e0c460)
      • The dictionaries remain writeable, and you can add elements to it using collection initializer syntax or the Add(TKey, TValue) method.

Other Changes

  • Added .NET 8 as a target framework. (6203354)
  • Enabled support for trimming. (4cd8529)
  • Enabled support for native AOT compilation. (4cd8529)

2.1.0 (2024-12-04)

Features Added

  • OpenAI.Assistants:

Breaking Changes in Preview APIs

  • OpenAI.RealtimeConversation:
    • Renamed the From*() factory methods on ConversationContentPart to Create*Part() for consistency. (bf3f0ed)
    • Removed an extraneous toolCallId parameter from ConversationItem.CreateSystemMessage(). (bf3f0ed)
  • OpenAI.Assistants:
    • Renamed RunStepType to RunStepKind. (bf3f0ed)
    • Changed RunStepKind from an "extensible enum" to a regular enum. (bf3f0ed)
    • Renamed the ToolCallId property of RunStepToolCall to Id. (bf3f0ed)
    • Renamed the ToolKind property of RunStepToolCall to Kind. (bf3f0ed)
    • Replaced the FileSearchRanker and FileSearchScoreThreshold properties of RunStepToolCall with a new FileSearchRankingOptions property that contains both values to make it clearer how they are related. (bf3f0ed)

Bugs Fixed

  • OpenAI.RealtimeConversation:
    • Fixed serialization issues with ConversationItem creation of system and assistant messages. (bf3f0ed)
    • Fixed an issue causing a deadlock when calling the RealtimeConversationSession's SendInputAudio method overload that takes a BinaryData parameter. (f491c2d)

2.1.0-beta.2 (2024-11-04)

Features Added

  • OpenAI.Chat:
    • Added a StoredOutputEnabled property to ChatCompletionOptions (store in the REST API). (b0f9e5c)
      • Use this property to indicate whether or not to store the output of the chat completion for use in model distillation or evals.
    • Added a Metadata property to ChatCompletionOptions (metadata in the REST API). (b0f9e5c)
      • Use this property to add custom tags and values to the chat completions for filtering in the OpenAI dashboard.
    • Added an InputTokenDetails property to ChatTokenUsage (usage.prompt_token_details in the REST API). (b0f9e5c)
      • The property is of a new type called ChatInputTokenUsageDetails, which contains properties for AudioTokenCount and CachedTokenCount for usage with supported models.
    • Added an AudioTokenCount property to ChatOutputTokenUsageDetails (usage.completion_token_details in the REST API). Audio support in chat completions is coming soon. (b0f9e5c)
  • OpenAI.Moderations:
    • Added Illicit and IllicitViolent properties ModerationResult to represent these two new moderation categories. (b0f9e5c)

Breaking Changes in Preview APIs

  • OpenAI.RealtimeConversation:
    • Made improvements to the experimental Realtime API. Please note this features area is currently under rapid development and not all changes may be reflected here. (b0f9e5c)
      • Several types have been renamed for consistency and clarity.
      • ConversationRateLimitsUpdate (previously ConversationRateLimitsUpdatedUpdate) now includes named RequestDetails and TokenDetails properties, mapping to the corresponding named items in the underlying rate_limits command payload.

Bugs Fixed

  • OpenAI.RealtimeConversation:
    • Fixed serialization and deserialization of ConversationToolChoice literal values (such as "required"). (9de3709)

Other Changes

  • Updated the System.ClientModel dependency to version 1.2.1. (b0f9e5c)
    • This updates the System.Text.Json transitive dependency to version 6.0.10, which includes a security compliance fix for CVE-2024-43485. Please note that the OpenAI library was not impacted by this vulnerability since it does not use the [JsonExtensionData] feature.

2.1.0-beta.1 (2024-10-01)

Note

With this updated preview library release, we're excited to bring early support for the newly-announced /realtime beta API. You can read more about /realtime here: https://openai.com/index/introducing-the-realtime-api/. Given the scope and recency of the feature area, the new RealtimeConversationClient is subject to substantial refinement and change over the coming weeks -- this release is purely intended to empower early development against gpt-4o-realtime-preview as quickly and efficiently as possible.

Features Added

2.0.0 (2024-09-30)

Note

First stable version of the official OpenAI library for .NET.

Features Added

  • Support for OpenAI's latest flagship models, including GPT-4o, GPT-4o mini, o1-preview, and o1-mini
  • Support for the entire OpenAI REST API, including:
    • Structured outputs
    • Reasoning tokens
    • Experimental support for Assistants beta v2
  • Support for sync and async APIs
  • Convenient APIs to facilitate working with streaming chat completions and assistants
  • Tons of other quality-of-life features for ease of use and productivity

Breaking Changes

Note

The following breaking changes only apply when upgrading from the previous 2.0.0-beta.* versions.

  • Implemented ChatMessageContent to encapsulate the representation of content parts in ChatMessage, ChatCompletion, and StreamingChatCompletionUpdate. (31c2ba6)
  • Changed the representation of function arguments to BinaryData in ChatToolCall, StreamingChatToolCallUpdate, ChatFunctionCall, and StreamingChatFunctionCallUpdate. (31c2ba6)
  • Renamed OpenAIClientOptions's ApplicationId to UserAgentApplicationId. (31c2ba6)
  • Renamed StreamingChatToolCallUpdate's Id to ToolCallId. (31c2ba6)
  • Renamed StreamingChatCompletionUpdate's Id to CompletionId. (31c2ba6)
  • Replaced Auto and None in the deprecated ChatFunctionChoice with CreateAutoChoice() and CreateNoneChoice(). (31c2ba6)
  • Replaced the deprecated ChatFunctionChoice(ChatFunction) constructor with CreateNamedChoice(string functionName). (31c2ba6)
  • Renamed FileClient to OpenAIFileClient and the corresponding GetFileClient() method in OpenAIClient to GetOpenAIFileClient(). (31c2ba6)
  • Renamed ModelClient to OpenAIModelClient and the corresponding GetModelClient() method in OpenAIClient to GetOpenAIModelClient(). (31c2ba6)

2.0.0-beta.13 (2024-09-27)

Breaking Changes

  • Refactored ModerationResult by merging ModerationCategories and ModerationCategoryScores into individual ModerationCategory properties, each with Flagged and Score properties. (19ceae4)
  • Renamed type OpenAIFileInfo to OpenAIFile and OpenAIFileInfoCollection to OpenAIFileCollection. (19ceae4)
  • Renamed type OpenAIModelInfo to OpenAIModel and OpenAIModelInfoCollection to OpenAIModelCollection. (19ceae4)
  • Renamed type Embedding to OpenAIEmbedding and EmbeddingCollection to OpenAIEmbeddingCollection. (19ceae4)
  • Renamed property ImageUrl to ImageUri and method FromImageUrl to FromImageUri in the MessageContent type. (19ceae4)
  • Renamed property ParallelToolCallsEnabled to AllowParallelToolCalls in the RunCreationOptions, ThreadRun, and ChatCompletionOptions types. (19ceae4)
  • Renamed properties PromptTokens to InputTokenCount, CompletionTokens to OutputTokenCount, and TotalTokens to TotalTokenCount in the RunTokenUsage and RunStepTokenUsage types. (19ceae4)
  • Renamed properties InputTokens to InputTokenCount and TotalTokens to TotalTokenCount in the EmbeddingTokenUsage type. (19ceae4)
  • Renamed properties MaxPromptTokens to MaxInputTokenCount and MaxCompletionTokens to MaxOutputTokenCount in the ThreadRun, RunCreationOptions, and RunIncompleteReason types. (19ceae4)
  • Removed the virtual keyword from the Pipeline property across all clients. (75eded5)
  • Renamed the Granularities property of AudioTranscriptionOptions to TimestampGranularities. (a330c2e)
  • Changed AudioTranscriptionFormat from an enum to an "extensible enum". (a330c2e)
  • Changed AudioTranslationFormat from an enum to an "extensible enum". (a330c2e)
  • Changed GenerateImageFormat from an enum to an "extensible enum". (a330c2e)
  • Changed GeneratedImageQuality from an enum to an "extensible enum". (a330c2e)
  • Changed GeneratedImageStyle from an enum to an "extensible enum". (a330c2e)
  • Removed method overloads in AssistantClient and VectorStoreClient that take complex parameters in favor of methods that take simple string IDs. (a330c2e)
  • Updated the TokenIds property type in the TranscribedSegment type from IReadOnlyList<int> to ReadOnlyMemory<int>. (a330c2e)
  • Updated the inputs parameter type in the GenerateEmbeddings and GenerateEmbeddingsAsync methods of EmbeddingClient from IEnumerable<IEnumerable<int>> to IEnumerable<ReadOnlyMemory<int>>. (a330c2e)
  • Changed ChatMessageContentPartKind from an extensible enum to an enum. (a330c2e)
  • Changed ChatToolCallKind from an extensible enum to an enum. (a330c2e)
  • Changed ChatToolKind from an extensible enum to an enum. (a330c2e)
  • Changed OpenAIFilePurpose from an extensible enum to an enum. (a330c2e)
  • Changed OpenAIFileStatus from an extensible enum to an enum. (a330c2e)
  • Renamed OpenAIFilePurpose to FilePurpose. (a330c2e)
  • Renamed OpenAIFileStatus to FileStatus. (a330c2e)
  • Removed constructors that take string API key and options. (a330c2e)

2.0.0-beta.12 (2024-09-20)

Features Added

  • The library now includes support for the new OpenAI o1 model family. (2ab1a94)
    • ChatCompletionOptions will automatically apply its MaxOutputTokenCount value (renamed from MaxTokens) to the new max_completion_tokens request body property
    • Usage includes a new OutputTokenDetails property with a ReasoningTokenCount value that will reflect o1 model use of this new subcategory of output tokens.
    • Note that OutputTokenCount (completion_tokens) is the sum of displayed tokens generated by the model and (when applicable) these new reasoning tokens
  • Assistants file search now includes support for RankingOptions. (2ab1a94)
    • Use of the include[] query string parameter and retrieval of run step detail result content is currently only available via protocol methods
  • Added support for the Uploads API in FileClient. This Experimental feature allows uploading large files in multiple parts. (2ab1a94)
    • The feature is supported by the CreateUpload, AddUploadPart, CompleteUpload, and CancelUpload protocol methods.

Breaking Changes

  • Renamed ChatMessageContentPart's CreateTextMessageContentPart factory method to CreateTextPart. (2ab1a94)
  • Renamed ChatMessageContentPart's CreateImageMessageContentPart factory method to CreateImagePart. (2ab1a94)
  • Renamed ChatMessageContentPart's CreateRefusalMessageContentPart factory method to CreateRefusalPart. (2ab1a94)
  • Renamed ImageChatMessageContentPartDetail to ChatImageDetailLevel. (2ab1a94)
  • Removed ChatMessageContentPart's ToString overload. (2ab1a94)
  • Renamed the MaxTokens property in ChatCompletionOptions to MaxOutputTokenCount. (2ab1a94)
  • Renamed properties in ChatTokenUsage:
    • InputTokens is renamed to InputTokenCount. (2ab1a94)
    • OutputTokens is renamed to OutputTokenCount. (2ab1a94)
    • TotalTokens is renamed to TotalTokenCount. (2ab1a94)
  • Removed the common ListOrder enum from the top-level OpenAI namespace in favor of individual enums in their corresponding sub-namespace. (2ab1a94)
  • Renamed the PageSize property to PageSizeLimit. (2ab1a94)
  • Updated deletion methods to return a result object instead of a bool. Affected methods:
    • DeleteAssistant, DeleteMessage, and DeleteThread in AssistantClient. (2ab1a94)
    • DeleteVectorStore and RemoveFileFromStore in VectorStoreClient. (2ab1a94)
    • DeleteModel in ModelClient. (2ab1a94)
    • DeleteFile in FileClient. (2ab1a94)
  • Removed setters from collection properties. (2ab1a94)
  • Renamed ChatTokenLogProbabilityInfo to ChatTokenLogProbabilityDetails. (2ab1a94)
  • Renamed ChatTokenTopLogProbabilityInfo to ChatTokenTopLogProbabilityDetails. (2ab1a94)
  • Renamed the Utf8ByteValues properties of ChatTokenLogProbabilityDetails and ChatTokenTopLogProbabilityDetails to Utf8Bytes and changed their type from IReadOnlyList<int> to ReadOnlyMemory<byte>?. (2ab1a94)
  • Renamed the Start and End properties of TranscribedSegment and TranscribedWord to StartTime and EndTime. (2ab1a94)
  • Changed the type of TranscribedSegment's AverageLogProbability and NoSpeechProbability properties from double to float. (2ab1a94)
  • Changed the type of TranscribedSegment's SeekOffset property from long to int. (2ab1a94)
  • Changed the type of TranscribedSegment's TokenIds property from IReadOnlyList<long> to IReadOnlyList<int>. (2ab1a94)
  • Updated the Embedding.Vector property to the Embedding.ToFloats() method. (2ab1a94)
  • Removed the optional parameter from the constructors of VectorStoreCreationHelper, AssistantChatMessage, and ChatFunction. (2ab1a94)
  • Removed the optional purpose parameter from FileClient.GetFilesAsync and FileClient.GetFiles methods, and added overloads where purpose is required. (2ab1a94)
  • Renamed ModerationClient's ClassifyTextInput methods to ClassifyText. (2ab1a94)
  • Removed duplicated Created property from GeneratedImageCollection. (2ab1a94)

Bugs Fixed

  • Addressed an issue that caused multi-page queries of fine-tuning jobs, checkpoints, and events to fail. (2ab1a94)
  • ChatCompletionOptions can now be serialized via ModelReaderWriter.Write() prior to calling CompleteChat using the options. (2ab1a94)

Other Changes

  • Added support for CancellationToken to ModelClient methods. (2ab1a94)
  • Applied the Obsolete attribute where appropriate to align with the existing deprecations in the REST API. (2ab1a94)

2.0.0-beta.11 (2024-09-03)

Features Added

  • Added the OpenAIChatModelFactory in the OpenAI.Chat namespace (a static class that can be used to instantiate OpenAI models for mocking in non-live test scenarios). (79014ab)

Breaking Changes

  • Updated fine-tuning pagination methods GetJobs, GetEvents, and GetJobCheckpoints to return IEnumerable<ClientResult> instead of ClientResult. (5773292)
  • Updated the batching pagination method GetBatches to return IEnumerable<ClientResult> instead of ClientResult. (5773292)
  • Changed GeneratedSpeechVoice from an enum to an "extensible enum". (79014ab)
  • Changed GeneratedSpeechFormat from an enum to an "extensible enum". (cc9169a)
  • Renamed SpeechGenerationOptions's Speed property to SpeedRatio. (cc9169a)

Bugs Fixed

  • Corrected an internal deserialization issue that caused recent updates to Assistants file_search to fail when streaming a run. Strongly typed support for ranking_options is not included but will arrive soon. (cc9169a)
  • Mitigated a .NET runtime issue that prevented ChatResponseFormat from serializing correctly on targets including Unity. (cc9169a)

Other Changes

  • Reverted the removal of the version path parameter "v1" from the default endpoint URL. (583e9f6)
  • Added the Experimental attribute to the following APIs:
    • All public APIs in the OpenAI.Assistants namespace. (79014ab)
    • All public APIs in the OpenAI.VectorStores namespace. (79014ab)
    • All public APIs in the OpenAI.Batch namespace. (0f5e024)
    • All public APIs in the OpenAI.FineTuning namespace. (0f5e024)
    • The ChatCompletionOptions.Seed property. (0f5e024)

2.0.0-beta.10 (2024-08-26)

Breaking Changes

  • Renamed AudioClient's GenerateSpeechFromText methods to simply GenerateSpeech. (d84bf54)
  • Changed the type of OpenAIFileInfo's SizeInBytes property from long? to int?. (d84bf54)

Bugs Fixed

  • Fixed a newly introduced bug (#185) where providing OpenAIClientOptions to a top-level OpenAIClient did not carry over to scenario clients (e.g. ChatClient) created via that top-level client (d84bf54)

Other Changes

  • Removed the version path parameter "v1" from the default endpoint URL. (d84bf54)

2.0.0-beta.9 (2024-08-23)

Features Added

  • Added support for the new structured outputs response format feature, which enables chat completions, assistants, and tools on each of those clients to provide a specific JSON Schema that generated content should adhere to. (3467b53)
    • To enable top-level structured outputs for response content, use ChatResponseFormat.CreateJsonSchemaFormat() and AssistantResponseFormat.CreateJsonSchemaFormat() as the ResponseFormat in method options like ChatCompletionOptions
    • To enable structured outputs for function tools, set StrictParameterSchemaEnabled to true on the tool definition
    • For more information, please see the new section in readme.md
  • Chat completions: the request message types of AssistantChatMessage, SystemChatMessage, and ToolChatMessage now support array-based content part collections in addition to simple string input. (3467b53)
  • Added the following model factories (static classes that can be used to instantiate OpenAI models for mocking in non-live test scenarios):
    • OpenAIAudioModelFactory in the OpenAI.Audio namespace (3284295)
    • OpenAIEmbeddingsModelFactory in the OpenAI.Embeddings namespace (3284295)
    • OpenAIFilesModelFactory in the OpenAI.Files namespace (b1ce397)
    • OpenAIImagesModelFactory in the OpenAI.Images namespace (3284295)
    • OpenAIModelsModelFactory in the OpenAI.Models namespace (b1ce397)
    • OpenAIModerationsModelFactory in the OpenAI.Moderations namespace (b1ce397)

Breaking Changes

  • Removed client constructors that do not explicitly take an API key parameter or an endpoint via an OpenAIClientOptions parameter, making it clearer how to appropriately instantiate a client. (13a9c68)
  • Removed the endpoint parameter from all client constructors, making it clearer that an alternative endpoint must be specified via the OpenAIClientOptions parameter. (13a9c68)
  • Removed OpenAIClient's Endpoint protected property. (13a9c68)
  • Made OpenAIClient's constructor that takes a ClientPipeline parameter protected internal instead of just protected. (13a9c68)
  • Renamed the User property in applicable Options classes to EndUserId, making its purpose clearer. (13a9c68)

Bugs Fixed

  • The Assistants namespace VectorStoreCreationHelper type now properly includes a ChunkingStrategy property. (3467b53)

Other Changes

  • ChatCompletion.ToString() will no longer throw an exception when no content is present, as is the case for tool calls. Additionally, if a tool call is present with no content, ToString() will return the serialized form of the first available tool call. (3467b53)

2.0.0-beta.8 (2024-07-31)

Breaking Changes

  • Changed name of return types from methods returning streaming collections from ResultCollection to CollectionResult. (7bdecfd)
  • Changed return types from methods returning paginated collections from PageableCollection to PageCollection. (7bdecfd)
  • Users must now call GetAllValues on the collection of pages to enumerate collection items directly. Corresponding protocol methods return IEnumerable<ClientResult> where each collection item represents a single service response holding a page of values. (7bdecfd)
  • Updated VectorStoreFileCounts and VectorStoreFileAssociationError types from readonly struct to class. (58f93c8)

Bugs Fixed

  • (#49) Fixed a bug with extensible enums implementing case-insensitive equality but case-sensitive hash codes. (0c12500)
  • (#57) Fixed a bug with requests URIs with query string parameter potentially containing a malformed double question mark (??) on .NET Framework (net481). (0c12500)
  • Added optional CancellationToken parameters to methods for AssistantClient and VectorStore client, consistent with past changes in 19a65a0. (d77539c)
  • Fixed Assistants FileSearchToolDefinition's MaxResults parameter to appropriately serialize and deserialize the value (d77539c)
  • Added missing [EditorBrowsable(EditorBrowsableState.Never)] attributes to AssistantClient protocol methods, which should improve discoverability of the strongly typed methods. (d77539c)

Other Changes

  • Removed the usage of init and updated properties to use set. (58f93c8)

2.0.0-beta.7 (2024-06-24)

Bugs Fixed

  • (#84) Fixed a NullReferenceException thrown when adding the custom headers policy while OpenAIClientOptions is null (0b97311)

2.0.0-beta.6 (2024-06-21)

Features Added

  • OrganizationId and ProjectId are now present on OpenAIClientOptions. When instantiating a client, providing an instance of OpenAIClientOptions with these properties set will cause the client to add the appropriate request headers for org/project, eliminating the need to manually configure the headers. (9ee7dff)

Bugs Fixed

  • (#72) Fixed filename request encoding in operations using multipart/form-data, including files and audio (2ba8e69)
  • (#79) Fixed hard-coded user role for caller-created Assistants API messages on threads (d665b61)
  • Fixed non-streaming Assistants API run step details not reporting code interpreter logs when present (d665b61)

Breaking Changes

Assistants (beta):

  • AssistantClient.CreateMessage() and the explicit constructor for ThreadInitializationMessage now require a MessageRole parameter. This properly enables the ability to create an Assistant message representing conversation history on a new thread. (d665b61)

2.0.0-beta.5 (2024-06-14)

Features Added

  • API updates, current to openai/openai-openapi@dd73070b (1af6569)
    • This includes MaxResults for Assistants FileSearchToolDefinition, ParallelToolCallsEnabled for function tools in Assistants and Chat, and FileChunkingStrategy for Assistants VectorStores
  • Optional CancellationToken parameters are now directly present on most methods, eliminating the need to use protocol methods (19a65a0)

Bugs Fixed

  • (#30) Mitigated a .NET runtime issue that prevented chat message content and several other types from serializing correctly on targets including mono and wasm (896b9e0)
  • Assistants: Fixed an issue that threw an exception when receiving code interpreter run step logs when streaming a run (207d597)
  • Fixed a concurrency condition that could cause multipart/form-data requests to no longer generate random content part boundaries (no direct scenario impact) (7cacdee)

Breaking Changes

Assistants (beta):

Other Changes

  • Added an environment-variable-based test project to the repository with baseline scenario coverage (db6328a)
  • Build/analyzer warnings cleaned up throughout the project (45fc4d7, b1fa082, 22ab606)
  • Proactively aligned library's implementation of server-sent event (SSE) handling with the source of the incoming System.Net.ServerSentEvents namespace (674e0f7)

2.0.0-beta.4 (2024-06-10)

Features Added

  • Added new, built-in helpers to simplify the use of text-only message content (1c40de6)

Bugs Fixed

  • Optimized embedding deserialization and addressed correctness on big endian systems (e28b5a7)
  • Optimized b64_json message parsing via regex (efd76b5)

2.0.0-beta.3 (2024-06-07)

Bugs Fixed

  • Removed a vestigial package reference (5874f53)

2.0.0-beta.2 (2024-06-06)

Bugs Fixed

  • Addressed an assembly properties issue (bf21eb5)
  • Added migration guide to package (f150666)

2.0.0-beta.1 (2024-06-06)

Features Added

This is the official OpenAI client library for C# / .NET. It provides convenient access to the OpenAI REST API from .NET applications and supports all the latest features. It is generated from our OpenAPI specification in collaboration with Microsoft.

Breaking Changes

If you are a user migrating from version 1.11.0 or earlier, we will soon share a migration guide to help you get started.