Skip to content

How to use dynamic api keys with openAI #2731

Closed
@tzcsx

Description

@tzcsx

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 #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?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions