Class ChatCompletionsOptions | Azure SDK for .NET
David Richardson
Published Feb 16, 2026
The configuration information used for a chat completions request.
Inheritance
System.Object
ChatCompletionsOptions
Namespace: System.Dynamic.ExpandoObject
Assembly: Azure.AI.OpenAI.dll
Syntax
public class ChatCompletionsOptions Constructors
ChatCompletionsOptions()
Initializes a new instance of ChatCompletionsOptions.
Declaration
public ChatCompletionsOptions (); Properties
ChoicesPerPrompt
Gets or sets the number of choices that should be generated per provided prompt. Has a valid range of 1 to 128.
Declaration
public Nullable<int> ChoicesPerPrompt { get; set; } Property Value
| System.Nullable<System.Int32> |
FrequencyPenalty
Gets or sets a value that influences the probability of generated tokens appearing based on their cumulative frequency in generated text. Has a valid range of -2.0 to 2.0.
Declaration
public Nullable<float> FrequencyPenalty { get; set; } Property Value
| System.Nullable<System.Single> |
MaxTokens
Gets the maximum number of tokens to generate. Has minimum of 0.
Declaration
public Nullable<int> MaxTokens { get; set; } Property Value
| System.Nullable<System.Int32> |
Messages
Gets or sets the set of chat messages associated with a chat completions request.
Declaration
public System.Collections.Generic.IList<Azure.AI.OpenAI.ChatMessage> Messages { get; } Property Value
NucleusSamplingFactor
Gets or set a an alternative value to Temperature, called nucleus sampling, that causes the model to consider the results of the tokens with NucleusSamplingFactor probability mass.
Declaration
public Nullable<float> NucleusSamplingFactor { get; set; } Property Value
| System.Nullable<System.Single> |
PresencePenalty
Gets or sets a value that influences the probability of generated tokens appearing based on their existing presence in generated text. Has a valid range of -2.0 to 2.0.
Declaration
public Nullable<float> PresencePenalty { get; set; } Property Value
| System.Nullable<System.Single> |
StopSequences
Gets a list of textual sequences that will end completions generation. A maximum of four stop sequences are allowed.
Declaration
public System.Collections.Generic.IList<string> StopSequences { get; } Property Value
| System.Collections.Generic.IList<System.String> |
Temperature
Gets or sets the sampling temperature to use that controls the apparent creativity of generated completions. Has a valid range of 0.0 to 2.0 and defaults to 1.0 if not otherwise specified.
Declaration
public Nullable<float> Temperature { get; set; } Property Value
| System.Nullable<System.Single> |
TokenSelectionBiases
Gets a dictionary of modifications to the likelihood of specified GPT tokens appearing in a completions result. Maps token IDs to associated bias scores from -100 to 100, with minimum and maximum values corresponding to a ban or exclusive selection of that token, respectively.
Declaration
public System.Collections.Generic.IDictionary<int,int> TokenSelectionBiases { get; } Property Value
| System.Collections.Generic.IDictionary<System.Int32,System.Int32> |
User
Gets or sets an identifier for a request for use in tracking and rate-limiting.
Declaration
public string User { get; set; } Property Value
| System.String |