This question has been around my mind lately.<p>The context is, if you are building a web application that allows user to use their own OpenAI API key to interact with OpenAI, how would you store their API key?<p>1. Local storage, let them send your API key through your server<p>2. Local storage, and the API key is called right from the user's browser<p>3. On your server??? How to store it securely? Using a vault manager?<p>#2 seems like a good choice, but in case you need to secure your prompt, then this is not feasible.<p>I've been struggling to find a good way to handle this situation.<p>Anyone have any idea or best practice on how to go about this scenario?
It’s technically prohibited by OpenAI’s ToS to share your key with any third party, so presumably options 1 and 3 could get your users’ accounts banned. That being said, until OpenAI releases some kind of OAuth, there isn’t a great option unless your app is entirely client side.