spring-ai icon indicating copy to clipboard operation
spring-ai copied to clipboard

How to use dynamic api keys with openAI

Open tzcsx opened this issue 7 months ago • 1 comments
trafficstars

I am trying to use Spring AI in a multi-tenant application. The openAI api key needs to be set on a per request basis according to our user context. I think this functionality was added in https://github.com/spring-projects/spring-ai/pull/2164 however the documentation uses the OpenAiChatClient class which I cannot find in milestone 7 (appears to be gone after 0.8.1?). How can I set the api key for chat and embedding requests?

tzcsx avatar Apr 14 '25 13:04 tzcsx