chatgpt-ui icon indicating copy to clipboard operation
chatgpt-ui copied to clipboard

Feature request: let users set OpenAI API tokens for their own accounts

Open SlimShadyIAm opened this issue 1 year ago • 5 comments

I want to host this as a service for me and a few friends but would like for each user to be able to use their own OpenAI token so they can pay for what they use themselves. Is this possible, or would it be a possible extension?

SlimShadyIAm avatar Mar 23 '23 12:03 SlimShadyIAm

Hello,

Thanks for the feedback!

In the latest version, the admin panel has an option to control whether to enable the API Key configuration function on the front-end.

You can try it out by going to the CHAT module in the admin panel, opening the Settings model, and finding a record with the name "open_api_key_setting". Change its value to "True". This will make the option to set API KEY visible in the left navigation bar on the front-end.

WongSaang avatar Mar 24 '23 07:03 WongSaang

Hello. I realised by allowing user to use their own api key, the api key will disappear after some time. Is this intended?

For example when I --restart my server, the api key disappears.

spencerwongfeilong avatar Mar 29 '23 15:03 spencerwongfeilong

Hello. I realised by allowing user to use their own api key, the api key will disappear after some time. Is this intended?

For example when I --restart my server, the api key disappears.

Hello, currently the client-side API key is stored in the browser's localStorage, so if the user switches browsers or clears their cache, the API key will be lost. Do you think it is necessary to store this in the database?

WongSaang avatar Apr 02 '23 06:04 WongSaang

Just checked this out, nice! What if the token was also stored in the database so that you can log in to multiple devices and not have to paste in the API key everywhere?

SlimShadyIAm avatar Apr 02 '23 17:04 SlimShadyIAm

Hello. I realised by allowing user to use their own api key, the api key will disappear after some time. Is this intended? For example when I --restart my server, the api key disappears.

Hello, currently the client-side API key is stored in the browser's localStorage, so if the user switches browsers or clears their cache, the API key will be lost. Do you think it is necessary to store this in the database?

Sorry, just saw this reply. Personally I'd like this as an option as well.

SlimShadyIAm avatar Apr 02 '23 17:04 SlimShadyIAm