TsgcHTTP_API_OpenAIProperties › OpenAIOptions

OpenAIOptions Property

Container for all OpenAI REST client settings including credentials, organization, HTTP, logging and retry options

Syntax

property OpenAIOptions: TsgcHTTPOpenAI_Options read FOpenAIOptions
      write SetOpenAIOptions;

Default Value

Remarks

Exposes a TsgcHTTPOpenAI_Options instance that groups every parameter used to authenticate and configure calls against https://api.openai.com/v1. The sub-properties are ApiKey (bearer token sent in the Authorization header), Organization (optional OpenAI-Organization header), HttpOptions (proxy and low-level HTTP tuning), LogOptions (request/response tracing) and RetryOptions (automatic retry of transient failures). Changes take effect on the next API request; they are not cached per connection.

Example

oAPI.OpenAIOptions.ApiKey := 'sk-...';
oAPI.OpenAIOptions.Organization := 'org-12345';
oAPI.OpenAIOptions.RetryOptions.Enabled := True;
oAPI.OpenAIOptions.LogOptions.Enabled := True;

Back to Properties