Hello!
I have an error when I try to use the API in Google Colab:
Thanks for everything!
Greta
Add a new code cell:
!pip install python-dotenv
Hello @Greta_Garcia ,
Welcome to the community!!
As per the error in the screenshot, it seems you have not used your API key in your code.
You need to go to this link : OpenAI API
Then generate your API KEY.
Then use it in your colab.
Like this : OPEN_API_KEY =
If this is not the case, feel free to send your notebook to me via dm.
With regards,
Nilosree Sengupta
It occurred to me too and still unable to solve. Generated the secret key from openai.com, and used in the code. Still error persists. Looks like it is related to colab and windows OS (I guess).
Made several attempts, now it is giving another error message as below
RateLimitError: You exceeded your current quota, please check your plan and billing details.
If solved for you, please post the code.
Thank you!!
I’m still getting the same error.
I have the same error but I didn’t use my password for anything, I already reset it and I still get the usage limit error. The only thing I use is ChatGPT on the web. I don’t know how to make it work.
Did you set up a payment method for the OpenAI API? The service is not free (after a test period). Not having a payment method set up could result in this error.
I’m in the free period
The issue is solved for me after setting up the payment method.
I’m really grateful to the community. Let us keep this tempo of open discussions and enhance individual skills together.
@Greta_Garcia and Carla_Pezzone, I suggest you to setup payment method. It costs very very less. And assign the openai.api_key directly. It worked for me. Refer below snippet.
!python -m pip install python-dotenv
import openai
import os
from dotenv import load_dotenv, find_dotenv_ = load_dotenv(find_dotenv())
openai.api_key = “ENTER YOUR API KEY”
Have fun!!
If you’re doing this…
Then you don’t need this…
The second block is only used when reading the key from an environment variable
Thank you @ai_curious.
Checked. It is working as you said. Thank you.