Skip to content

OpenAIProviderOptions

Namespace AgentPrism · Assembly AgentPrism.OpenAI.dll

The OpenAI provider options of AgentPrism.

public sealed class OpenAIProviderOptions

objectOpenAIProviderOptions

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Validation is written by hand inside OpenAIProviderOptionsValidator; DataAnnotations is not used.

public OpenAIProviderOptions()

Gets the full path of the configuration section the options are read from.

public const string SectionName = "AgentPrism:Providers:OpenAI"

string

Gets or sets the OpenAI API key.

public string? ApiKey { get; set; }

string?

This value is a secret and is never written to a file. Use dotnet user-secrets, an environment variable or a secret manager. The key is never written to the database, never returned from the API and never shown in the user interface.

Gets or sets the model name to use when ModelBinding.Model is left empty.

public string? DefaultModel { get; set; }

string?

Gets or sets a value indicating whether the Responses API surface is also enabled for a provider registered with UseOpenAICompatible.

public bool EnableResponsesSurface { get; set; }

bool

Only UseOpenAICompatible reads it. UseOpenAI ignores this field; the official OpenAI provider always registers both surfaces (OpenAIProviderNames.ChatCompletions and OpenAIProviderNames.Responses).

The default is false: most OpenAI compatible servers do not implement the /v1/responses endpoint. When it is on, a second provider is registered under the name {name}-responses.

Gets or sets the request address. When null, the OpenAI address is used. Set it for OpenAI compatible proxies.

public Uri? Endpoint { get; set; }

Uri?

Gets the model catalog shown in the user interface.

public IList<ModelDescriptor> Models { get; }

IList<ModelDescriptor>

AgentPrism carries no built-in model list; the catalog comes entirely from here. Model names and prices change much faster than the package is released.

This list is not a validation list. A model name that is absent here can still be used; the catalog only feeds the model picker screen and the cost calculation of the user interface.

Gets or sets the organization id. It is used by multi organization accounts.

public string? Organization { get; set; }

string?

Gets or sets the upper time limit of a single request. When null, the library default is used.

public TimeSpan? Timeout { get; set; }

TimeSpan?