I need some help so i try to access my chatgpt api using the secret key option directly in my streamlit app i’ve added manually the variable with my key.
However, it’s impossible to get some thing i have the same error message (impossible to process my request at this time).
Normaly, i writed correctly i tried many option and combinaison but i m getting the same issue:
import openai
import json
import requests
import streamlit as st
import os
openai.api_key=st.secrets["openai_apikey"]
thank you for your answer.
I removed my api key. The problem is that i don’t really have an error I mean he cannot get an access to chat gpt and localy it works perfectly this is what i have :
So you’re missing the secrets.toml file that should contain your API key. I would advise against using .env which exposes your API key in your commit to GitHub; security risk.
Here’s what you should do instead:
In your root directory, create the file .streamlit/secrets.toml
Paste your API key inside the secrets.toml file and save
In the root folder, create a file named .gitignore and add this path to the file .streamlit/secrets.toml (this will ensure your API key is not deployed to GitHub)
In my side, I tried many times, I follow also your link and this one:
But each time I get an email from openai which told me that my api is disabled.
I try like you said and I also try by adding a variable name inside toml but it doesn’t work. Same Issue.