You need to add a folder called .streamlit, then add a file called secrets.toml that looks like this: secrets.toml OPENAI_API_KEY = "Put your API key here"