diff --git a/providers/OpenAICompatProvider.cpp b/providers/OpenAICompatProvider.cpp index a0ea2bb..93e1a42 100644 --- a/providers/OpenAICompatProvider.cpp +++ b/providers/OpenAICompatProvider.cpp @@ -77,6 +77,10 @@ void OpenAICompatProvider::prepareRequest(QJsonObject &request, LLMCore::Request request["frequency_penalty"] = settings.frequencyPenalty(); if (settings.usePresencePenalty()) request["presence_penalty"] = settings.presencePenalty(); + const QString &apiKey = settings.apiKey(); + if (!apiKey.isEmpty()) { + request["api_key"] = apiKey; + } }; QJsonArray messages = prepareMessages(request);