diff --git a/apps/opik-backend/src/main/java/com/comet/opik/domain/llmproviders/LlmProviderFactory.java b/apps/opik-backend/src/main/java/com/comet/opik/domain/llmproviders/LlmProviderFactory.java index 86c1931c6..34ad3f808 100644 --- a/apps/opik-backend/src/main/java/com/comet/opik/domain/llmproviders/LlmProviderFactory.java +++ b/apps/opik-backend/src/main/java/com/comet/opik/domain/llmproviders/LlmProviderFactory.java @@ -25,8 +25,9 @@ public LlmProviderFactory( public LlmProviderService getService(@NonNull String workspaceId, @NonNull String model) { var llmProvider = getLlmProvider(model); + var apiKey = EncryptionUtils.decrypt(getEncryptedApiKey(workspaceId, llmProvider)); + if (llmProvider == LlmProvider.OPEN_AI) { - var apiKey = EncryptionUtils.decrypt(getEncryptedApiKey(workspaceId, llmProvider)); return new OpenAi(llmProviderClientConfig, apiKey); }