How to see the API Key?
How to get the value of OPENAI_API_KEY?
How to see the API Key? : OpenAI
No access to dalle api key?
Can I use the OpenAI API for free?
How does OpenAI API handle API key rotation?
How can I keep my OpenAI API key secure?
Videos
Hi. Can someone tell me how I can see my API Key? When I login to OpenAI to see it, it only shows me the "sk" and the last four characters. Is there a way to see the full API Key? Thank you.
Hello @Rao, Vinod (CTR) HHHH
Thanks for reaching out to us, you can find the key by going to your resource in the Azure portal. The Endpoint and Keys can be found in the Resource Management section. Copy your endpoint and access key as you'll need both for authenticating your API calls. You can use either KEY1 or KEY2. Always having two keys allows you to securely rotate and regenerate keys without causing a service disruption.
Then you need to create and assign persistent environment variables for your key and endpoint before you run the line - openai.api_key = os.getenv("OPENAI_API_KEY") You need to save it to your Environment variables, please open your command line and run below, replace with your key value -
setx OPENAI_API_KEY "REPLACE_WITH_YOUR_KEY_VALUE_HERE"
You can also use PowerShell as below -
[System.Environment]::SetEnvironmentVariable('OPENAI_API_KEY', 'REPLACE_WITH_YOUR_KEY_VALUE_HERE', 'User')
Please let me know if you need more help, we are happy to help you further.
Regards,
Yutong
-Please kindly accept the answer and vote 'Yes' if you feel helpful to support the community, thanks a lot.
Hello!
Please check out the Python quickstart for details on retrieving and using your API keys for Azure OpenAI.
In short, once you've onboarded with Azure OpenAI and created an Azure OpenAI resource, you can copy one of the two keys from the "Keys and Endpoint" pane for the resource in Azure Portal and use that as the value for the environment variable.