[ 
https://issues.apache.org/jira/browse/CAMEL-27402?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-27402.
---------------------------------
    Resolution: Fixed

Fixed by https://github.com/apache/camel/pull/30620 (merged as 
b805517674128753a17ee12d902064a40dc73aac).

_Claude Code on behalf of Claus Ibsen_

> camel-openai - work without an API key, for local OpenAI-compatible servers 
> such as Ollama
> ------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-27402
>                 URL: https://issues.apache.org/jira/browse/CAMEL-27402
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-openai
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Major
>             Fix For: 4.24.0
>
>
> {{OpenAIEndpoint}} sets {{apiKey}} on the {{OpenAIOkHttpClient}} builder only 
> when one is configured (the option, or the {{OPENAI_API_KEY}} environment 
> variable). Without one, the OpenAI SDK refuses to build the client:
> {noformat}
> java.lang.IllegalStateException: At least one credential source must be 
> specified: credential (apiKey), workloadIdentity, or adminApiKey
> {noformat}
> So a route that calls a local server that checks no key, such as Ollama, vLLM 
> or LM Studio with {{baseUrl}} set, has to configure a dummy key.
> Expected: with no {{apiKey}}, no {{OPENAI_API_KEY}} and no {{oauthProfile}}, 
> the component builds the client without a credential, so no {{Authorization}} 
> header is sent (or, if the SDK cannot do that, with an internal placeholder 
> that is never logged), and a server that needs a key answers 401 as usual. 
> The docs of {{apiKey}} say that it is optional for such servers. A test with 
> a stub server checks that the request is sent without a key.
> Found while adding the openai-chat-action Kamelet to the Kamelet catalog 
> (apache/camel-kamelets#3365, 2026-11-22).



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to