TsgcHTTP_API_OpenAI › Properties › OpenAIOptions
Container for all OpenAI REST client settings including credentials, organization, HTTP, logging and retry options
property OpenAIOptions: TsgcHTTPOpenAI_Options read FOpenAIOptions
write SetOpenAIOptions;
—
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.
oAPI.OpenAIOptions.ApiKey := 'sk-...';
oAPI.OpenAIOptions.Organization := 'org-12345';
oAPI.OpenAIOptions.RetryOptions.Enabled := True;
oAPI.OpenAIOptions.LogOptions.Enabled := True;