I want to enable users to enter their own API key (e.g. OpenAI) so that they can submit requests that they will pay for.
What is the recommended way to do this?
Looks like this app did it using a one way hash + encrypted session state storage. See the FAQ “How does GPT Lab ensure the security of my information?”. The details are not provided.
Unless you need to store them in your data store, just use session state variables.