spring-ai
spring-ai copied to clipboard
How to use dynamic api keys with openAI
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?