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.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.