TsgcHTTP_API_OpenAIProperties › ReadTimeout

ReadTimeout Property

HTTP read timeout in milliseconds applied to every OpenAI REST request

Syntax

property ReadTimeout: Integer read FReadTimeout write FReadTimeout;

Default Value

Remarks

Maximum time, in milliseconds, that the client waits for the server to start returning data before aborting the request. The default is 30000 (30 seconds), which covers most Chat Completions, Responses and Images calls. Increase this value for long running operations such as large image generations, reasoning models or streaming workloads that keep the connection idle between chunks. Setting 0 means wait indefinitely.

Example

oAPI.ReadTimeout := 60000;
// allow up to 60 seconds for slow reasoning models
ShowMessage('Read timeout: ' + IntToStr(oAPI.ReadTimeout) + ' ms');

Back to Properties