Class ClientOptions
- 
                    
                    - All Implemented Interfaces:
 
 public final class ClientOptionsA class representing the SDK client configuration. 
- 
                
                    
                    - 
                                
                            
                                Nested Class SummaryNested Classes Modifier and Type Class Description public final classClientOptions.BuilderA builder for ClientOptions. 
 - 
                                
                            
                                Field SummaryFields Modifier and Type Field Description public final static StringPRODUCTION_URLprivate final HttpClienthttpClientprivate final BooleancheckJacksonVersionCompatibilityprivate final JsonMapperjsonMapperprivate final ExecutorstreamHandlerExecutorprivate final Sleepersleeperprivate final Clockclockprivate final Headersheadersprivate final QueryParamsqueryParamsprivate final BooleanresponseValidationprivate final Timeouttimeoutprivate final IntegermaxRetriesprivate final Credentialcredentialprivate final AzureOpenAIServiceVersionazureServiceVersionprivate final AzureUrlPathModeazureUrlPathMode
 - 
                                
                            
                                Method SummaryModifier and Type Method Description final HttpClienthttpClient()The HTTP client to use in the SDK. final BooleancheckJacksonVersionCompatibility()Whether to throw an exception if any of the Jackson versions detected at runtime are incompatible with the SDK's minimum supported Jackson version (2.13.4). final JsonMapperjsonMapper()The Jackson JSON mapper to use for serializing and deserializing JSON. final ExecutorstreamHandlerExecutor()The executor to use for running AsyncStreamResponse.Handler callbacks. final Sleepersleeper()The interface to use for delaying execution, like during retries. final Clockclock()The clock to use for operations that require timing, like retries. final Headersheaders()Headers to send with the request. final QueryParamsqueryParams()Query params to send with the request. final BooleanresponseValidation()Whether to call validateon every response before returning it.final Timeouttimeout()Sets the maximum time allowed for various parts of an HTTP call's lifecycle, excluding retries. final IntegermaxRetries()The maximum number of times to retry failed requests, with a short exponential backoff between requests. final Credentialcredential()final AzureOpenAIServiceVersionazureServiceVersion()final AzureUrlPathModeazureUrlPathMode()final StringbaseUrl()The base URL to use for every request. final Optional<String>organization()final Optional<String>project()final Optional<String>webhookSecret()final ClientOptions.BuildertoBuilder()final Unitclose()Closes these client options, relinquishing any underlying resources. final static ClientOptions.Builderbuilder()Returns a mutable builder for constructing an instance of ClientOptions. final static ClientOptionsfromEnv()Returns options configured using system properties and environment variables. - 
                    
                    
                    - 
                                
                            
                                Method Detail- 
                                        httpClientfinal HttpClient httpClient() The HTTP client to use in the SDK. Use the one published in openai-java-client-okhttpor implement your own.This class takes ownership of the client and closes it when closed. 
 - 
                                        checkJacksonVersionCompatibilityfinal Boolean checkJacksonVersionCompatibility() Whether to throw an exception if any of the Jackson versions detected at runtime are incompatible with the SDK's minimum supported Jackson version (2.13.4). Defaults to true. Use extreme caution when disabling this option. There is no guarantee that the SDK will work correctly when using an incompatible Jackson version. 
 - 
                                        jsonMapperfinal JsonMapper jsonMapper() The Jackson JSON mapper to use for serializing and deserializing JSON. Defaults to com.openai.core.jsonMapper. The default is usually sufficient and rarely needs to be overridden. 
 - 
                                        streamHandlerExecutorfinal Executor streamHandlerExecutor() The executor to use for running AsyncStreamResponse.Handler callbacks. Defaults to a dedicated cached thread pool. This class takes ownership of the executor and shuts it down, if possible, when closed. 
 - 
                                        sleeperfinal Sleeper sleeper() The interface to use for delaying execution, like during retries. This is primarily useful for using fake delays in tests. Defaults to real execution delays. This class takes ownership of the sleeper and closes it when closed. 
 - 
                                        clockfinal Clock clock() The clock to use for operations that require timing, like retries. This is primarily useful for using a fake clock in tests. Defaults to Clock.systemUTC. 
 - 
                                        queryParamsfinal QueryParams queryParams() Query params to send with the request. 
 - 
                                        responseValidationfinal Boolean responseValidation() Whether to call validateon every response before returning it.Defaults to false, which means the shape of the response will not be validated upfront. Instead, validation will only occur for the parts of the response that are accessed. 
 - 
                                        timeoutfinal Timeout timeout() Sets the maximum time allowed for various parts of an HTTP call's lifecycle, excluding retries. Defaults to Timeout.default. 
 - 
                                        maxRetriesfinal Integer maxRetries() The maximum number of times to retry failed requests, with a short exponential backoff between requests. Only the following error types are retried: - Connection errors (for example, due to a network connectivity problem) 
- 408 Request Timeout 
- 409 Conflict 
- 429 Rate Limit 
- 5xx Internal 
 The API may also explicitly instruct the SDK to retry or not retry a request. Defaults to 2. 
 - 
                                        credentialfinal Credential credential() 
 - 
                                        azureServiceVersionfinal AzureOpenAIServiceVersion azureServiceVersion() 
 - 
                                        azureUrlPathModefinal AzureUrlPathMode azureUrlPathMode() 
 - 
                                        baseUrlfinal String baseUrl() The base URL to use for every request. Defaults to the production environment: https://api.openai.com/v1.
 - 
                                        organizationfinal Optional<String> organization() 
 - 
                                        webhookSecretfinal Optional<String> webhookSecret() 
 - 
                                        toBuilderfinal ClientOptions.Builder toBuilder() 
 - 
                                        closefinal Unit close() Closes these client options, relinquishing any underlying resources. This is purposefully not inherited from AutoCloseable because the client options are long-lived and usually should not be synchronously closed via try-with-resources. It's also usually not necessary to call this method at all. the default client automatically releases threads and connections if they remain idle, but if you are writing an application that needs to aggressively release unused resources, then you may call this method. 
 - 
                                        builderfinal static ClientOptions.Builder builder() Returns a mutable builder for constructing an instance of ClientOptions. The following fields are required: .httpClient() .apiKey()
 - 
                                        fromEnvfinal static ClientOptions fromEnv() Returns options configured using system properties and environment variables. 
 
- 
                                        
 
- 
                                
                            
                                
 
- 
                    
                    
                    
 
-