OpenAIClient getSyncClient(String apiKey, String endpoint) {
        // If we have a cached client and the parameters match the cached parameters, reuse it
        if (defaultSyncClient != null && 
            apiKey != null && apiKey.equals(cachedSyncApiKey) &&
            endpoint != null && endpoint.equals(cachedSyncEndpoint)) {
            return defaultSyncClient;
        }
        
        // Different API key or endpoint, create new client
        defaultSyncClient = OpenAIOkHttpClient.builder()
                .apiKey(apiKey)
                .baseUrl(endpoint)
                .responseValidation(false)
                .build();
        
        // Update cached values after successful creation
        cachedSyncApiKey = apiKey;
        cachedSyncEndpoint = endpoint;
        
        return defaultSyncClient;
    }
A configurable OpenAI client that extends the {@link ConfigurableLanguageModel} class.
Uses Official OpenAI java client (https://github.com/openai/openai-java)
Supports basic completion and structured JSON output. Extensible to support Embedding, Tool Calling and Moderations.
Will reuse clients for Completions using same endpoint and API key to reduce connection overhead for multiple requests to the same endpoint with the same API key.
@author lesters
@author glebashnik
@author thomasht86
model-integration/src/main/java/ai/vespa/llm/clients/OpenAI.java