.env file in the root of your project. This file should be added to your .gitignore file so that it is not committed to your repository.
.env
Public Apps & Environment Variables
If you want to share your app to a broader audience, you should not put your own OpenAI API keys in the.env file.
Instead, you should use user_env in the Chainlit config to ask each user to provide their own keys.
You can then access the user’s keys in your code using: